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

int L[2200][2200], R[2200][2200], U[2200][2200], D[2200][2200];

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

    std::vector<std::string> s(H);
    for(int i = 0; i < H; i++){
        std::cin >> s[i];
    }

    //From left
    for(int i = 1; i <= H; i++){
        for(int j = 0; j < W; j++){
            L[i][j+1] = L[i][j] + 1;
            if(s[i-1][j] == '#')L[i][j+1] = 0;
        }
    }

    //From right
    for(int i = 1; i <= H; i++){
        for(int j = W; j >= 1; j--){
            R[i][j] = R[i][j+1] + 1;
            if(s[i-1][j-1] == '#')R[i][j] = 0;
        }
    }

    //from upper side
    for(int j = 1; j <= W; j++){
        for(int i = 0; i < H; i++){
            U[i+1][j] = U[i][j] + 1;
            if(s[i][j-1] == '#')U[i+1][j] = 0;
        }
    }

    //from bottom side
    for(int j = 1; j <= W; j++){
        for(int i = H-1; i >= 0; i--){
            D[i+1][j] = D[i+2][j] + 1;
            if(s[i][j-1] == '#')D[i+1][j] = 0;
        }
    }
   
   int ans = 0;

   for(int i = 1; i <= H; i++){
       for(int j = 1; j <= W; j++){
           ans = std::max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j]-3);
       }
   }
   std::printf("%d\n", ans);
   return 0;
}

Measured memory_bytes: 78208
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
#include <map>
#include <set>
#include <math.h>
#include <cmath>
#define ll long long

using namespace std;

int main(){

  int N, a;
  cin >> N;
  int ans = 0;
  vector<int> vec(N);

  for (int i = 0; i < N; i++){
    cin >> a;
    vec.at(i) = a;
  }

  int x = 0;
  for (int i = 0; i < N-1; i++) {
    if(vec.at(i) >= vec.at(i+1)){
      x++;
    } else if(vec.at(i) < vec.at(i+1) || i == N-2) {
      x = 0;
    }
    ans = max(x, ans);
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 640
"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const K = parseInt(arg[0].split(" ")[1]);
    
    const x = arg[1].split(" ").map(n=>parseInt(n));
    
    const list = [];
    
    for(let i=0; i<=N - K; i++) {
        let left  = x[i];
        let right = x[~~i + K - 1];
        
        // 左側から先にいく or 右側しかいかないパターン
        if(Math.abs(left) < Math.abs(right)) {
            list.push(Math.abs(left) + Math.abs(right - left));
        
        // 右側から先にいく or 左側しかいかないパターン
        } else {
            list.push(Math.abs(right) + Math.abs(right - left));
        }
        
        // console.log(list);
    }
    
    console.log(Math.min(...list));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 29040
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> a(n);
  REP(i,n) cin >> a[i];
  int sum = 0;
  REP(i,n) sum += a[i];
  
  sort(a.begin(),a.end());
    
  int c = 0;
  REP(i,n){
    if((a[n-i-1]) * 4 * m >= sum) c++;
  }
  
  if(c >= m) cout << "Yes" << endl;
  else cout << "No" << endl;
    

}

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

int main(int argc, char const *argv[])
{
	int n;
	long long k;
	cin>>n>>k;
	long long a[n],s=0LL;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		s+=a[i];
	}
	vector<long long> v;
	for (int i = 1; i < 25000; ++i)
	{
		if (s<(long long)i)
		{
			break;
		}
		if (s%(long long)i==0)
		{
			v.emplace_back((long long)i);
			v.emplace_back((long long)s/i);
		}
	}
	long long ans=1LL;
	for (auto i = v.begin(); i != v.end(); ++i)
	{
		long long r[n],left=0LL,right=0LL;
		for (int j = 0; j < n; ++j)
		{
			r[j]=a[j]%(*i);
			left+=r[j];
		}
		sort(r,r+n);
		if (max(left,right)<=k&&(left-right)%(*i)==0)
		{
			ans=max(ans,(*i));
		}
		for (int j = n-1; j >= 0; --j)
		{
			left-=r[j];
			right+=(*i)-r[j];
			if (max(left,right)<=k&&(left-right)%(*i)==0)
			{
				ans=max(ans,(*i));
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    pw.println(n == m ? "Yes" : "No");
  }
}


Measured memory_bytes: 25172
import collections
from collections import  OrderedDict

num = [int(x) for x in input().split()]
val = input().split()

count_dict = collections.Counter(val)

cant = 0

if len(count_dict) <= num[1]:
    print(0)
else:
    sort_dict = OrderedDict(sorted(count_dict.items(), key=lambda x:x[1], reverse= True))
    value_dict = sort_dict.values()
    print(sum(list(value_dict)[num[1]:]))

Measured memory_bytes: 114072
fn main() {
	let mut s = String::new();
	use std::io::Read;
	std::io::stdin().read_to_string(&mut s).unwrap();
	let mut s = s.split_whitespace();
	let n: usize = s.next().unwrap().parse().unwrap();
	let a: i32 = s.next().unwrap().parse().unwrap();
	let b: i32 = s.next().unwrap().parse().unwrap();
	let ans = s.by_ref().take(n).fold(0, |s, t|{
		let t = t.parse::<i32>().unwrap();
		s + if t < a || t >= b { 1 } else { 0 }
	});
	println!("{}", ans);
}

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

int main(){

  int k,x;
  scanf("%d %d", &k, &x );

  int a=x-k+1;

  rep(i,2*k-1){
    if(a+i>=-1000000 && a+i<=1000000)
    printf("%d ",a+i);
  }


}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();
    return x*f;
}
#define mod 1000000007
void MOD(int &x){if(x>=mod)x-=mod;}
#define maxn 100010
#define inf (1<<30)
char s[maxn];
unsigned int h[maxn],b[maxn];
#include<map>
map<unsigned int,bool>mp;
unsigned int get(int i,int j){
	return h[i]-h[i-j]*b[j];
}
int main(){
	int n;
	in(n);
	scanf("%s",s+1);
	b[0]=1;
	FOR(i,1,n)h[i]=h[i-1]*233+s[i],b[i]=b[i-1]*233;
	int c=0;
	FOR(i,1,n)
		FOR(j,i+1,n){
			while(i+c<j&&get(i,c+1)==get(j,c+1))c++;
		}
	out(c);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
const ll mod= 998244353;
const ll INF = 1LL<<40;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll x[110];
int main() {
  ll n,k,ans=0;
  cin>>n>>k;
  ll y=(n/k);
  ll z=ceil((ld)n/k);
  cout<<min(labs(n-y*k),labs(n-z*k));
}



Measured memory_bytes: 3600
def resolve():
    n, m = map(int, input().split())
    a = []
    b = []

    for _ in range(n):
        a.append([int(s) for s in input().split()])

    for _ in range(m):
        b.append([int(input())])

    for i in range(n):
        s = 0
        for j in range(m):
            s += a[i][j] * b[j][0]
        print(s)


resolve()


Measured memory_bytes: 5936
#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s,t;
  cin>>s>>t;

  int len=s.size();
  int tmp,i=0,flag=0;
  string ans;

  while(i<=len)
  {
    tmp=s.at(len-1);
    for(int j=len-1;j>0;j--) s.at(j)=s.at(j-1);
    s.at(0)=tmp;
    i++;

    if(s==t)
    {
      flag=1;
      break;
    }
  }

  if(flag==0) ans="No";
  else ans="Yes";

  cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n;
		int pm, pe, pj;
		String[] s;
		
		while(true){
			n = scan.nextInt();
			if(n == 0)break;
			
			s = new String[n];
			for(int i = 0; i < n; i++){
				pm = scan.nextInt();
				pe = scan.nextInt();
				pj = scan.nextInt();
				
				if(pm == 100 || pe == 100 || pj == 100)s[i] = "A";
				else if((pm + pe) / 2 >= 90)s[i] = "A";
				else if((pm + pe + pj) / 3 >= 80)s[i] = "A";
				else if((pm + pe + pj) / 3 >= 70)s[i] = "B";
				else if((pm + pe + pj) / 3 >= 50 && (pm >= 80 || pe >= 80))s[i] = "B";
				else s[i] = "C";
			}
			for(int i = 0; i < n; i++){
				System.out.println(s[i]);
			}
		}
	}
}

Measured memory_bytes: 39940
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define at(x,i) get<i>(x);
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n;cin >> n;
    if(n==1){
        cout << "Yes" <<endl;
        cout << 2 <<endl;
        cout << 1 <<" "<<1<<endl;
        cout << 1 <<" "<<1<<endl;
        return 0;
    }
    ll p=2*n;
    p=sqrt(p);
    if(p*(p+1)!=2*n){
        cout << "No" <<endl;
        return 0;
    }
    ll sz=p;
    cout << "Yes" <<endl;
    cout << p+1 <<endl;
    vvl v(p+1);
    v[0].pb(1);
    v[0].pb(2);
    v[1].pb(1);
    v[1].pb(3);
    v[2].pb(2);
    v[2].pb(3);
    ll a=3,y=3;
    while(a<n){
        ll b=a;
        rep(i,y){
            a++;
            v[i].pb(a);
        }
        rep(i,y){
            b++;
            v[y].pb(b);
        }
        y++;
    }
    rep(i,p+1){
        cout << p <<" ";
        rep(j,p){
            cout << v[i][j];
            if(j!=p-1)cout <<" ";
        }
        cout <<endl;
    }
}


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

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

    int result = 0;

    for (int i = 0; i < N; i++) {
        int A = 0;
        cin >> A;

        if (A % 2 != 0) {
            result = 0;
            break;
        }

        int count = 0;
        while (A % 2 == 0) {
            count++;
            A = A / 2;
        }
        if (result == 0) {
            result = count;
        } else if (result > count) {
            result = count;
        }
    }

    cout << result << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9+7;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=5*1e5+5;

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

	int h,w;
	cin>>h>>w;
	if(h==1||w==1)
	{
		cout<<1;
		return 0;
	}
	int ans1=w-w/2;
	int ans2=w/2;
	int ans=(h/2)*(ans1+ans2);
	if(h%2)
	{
		ans+=ans1;
	}
	cout<<ans;
}
// a+b+2*sqrt(a*b)<c
// 
// Don't be afraid to fail. Be afraid not to try.
// "Become grindian instead of greendian" - aryanc403
// When you want to succeed as bad as you want to breathe, only then you’ll Be Successful!
// No Matter,How Fast You Are Driving If You Are Driving in a Wrong Direction You Will Never Reach Your Destination
// When failures hit you, you hit the failures back with Bounce Back!
// When you face failures, Don’t change your goal, Change your strategy!

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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef pair<int, int> p;

int main(){
  string s;
  cin >> s;
  for (int i = 0; i < 300; i++)
  {
    s = s.substr(0, int(s.size()) - 1);
    if(int(s.size()) % 2 == 1) continue;
    string s1 = s.substr(0, int(s.size()) / 2);
    string s2 = s.substr(int(s.size()) / 2);
    if(s1 == s2)
    {
      cout << s.size() << endl;
      return 0;
    }

  }

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define db double
#define ll long long
vector<int> get(vector<int> a, vector<int> b){
    multiset<int> kek;
    for (int i=0;i<a.size();i++) kek.insert(a[i]);
    for (int i=0; i < b.size(); i++){
        if (!kek.count(b[i])) continue;
        kek.erase(kek.find(b[i]));
    }
    vector<int> res;
    if (!kek.size()) return {};
    for (auto it = kek.begin(); it != kek.end(); it++){
        res.push_back(*it);
    }
    return res;
}
struct Snm{int f; int r;};
vector<Snm> snm;
int g(int v){
    if (snm[v].f != v) snm[v].f = g(snm[v].f);
    return snm[v].f;
}
void un(int u, int v){
    if (u==v) return;
    if (snm[u].r > snm[v].r) swap(u, v);
    snm[u].f=v;
    if (snm[u].r==snm[v].r) snm[v].r++;
}
void solve(vector<int> a, vector<int> b, int add){
    vector<int> c, d;
    for (int i=0;i<a.size(); i++){
        if (a[i] == b[i]) continue;
        c.push_back(a[i]);
        d.push_back(b[i]);
    }
    int n = c.size();
    if (n==0){
        cout << 0;
        exit(0);
    }
    if (add==0){
        int X=0;
        for (int i=0;i<n;i++) X ^= c[i];
        bool can=false;
        for (int i=0;i<n;i++) if (d[i]==X) can=true;
        if (!can)add++;
    }
    for (int i=0; i < n; i++){
        snm.push_back({i, 1});
    }
    map<int, int> last;
    for (int i=0; i < n; i++){
        if (last.count(c[i])) un(g(last[c[i]]), g(i));
        if (last.count(d[i])) un(g(last[d[i]]), g(i));
        last[c[i]]=i;
        last[d[i]]=i;
    }
    set<int> tet;
    for (int i=0;i<n;i++) tet.insert(g(i));
    cout << n-1+(int)tet.size()+add;
    exit(0);
}
main(){  
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i=0;i<n;i++) cin >> a[i];
    for (int i=0;i<n;i++) cin >> b[i];
    int X = 0;
    for (int i=0; i < n; i++) X ^= a[i];
    vector<int> t = get(a, b), q = get(b, a);
    if (t.size() >= 2){
        cout << -1;
        return 0;
    }
    if (t.size() == 1 && q[0] != X){
        cout << -1;
        return 0;
    }
    int tet = 0;
    if (t.size() == 1){
        a.push_back(q[0]);
        b.push_back(t[0]);
        tet=1;
    }
    solve(a, b, -tet);
}

Measured memory_bytes: 10520
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> v(10);
    int ans = 0;
    while(n--){
        string s;
	    cin>>s;
	    for(int j=2;j<s.size();j++){
		    if(s[j-2]=='A'&&s[j-1]=='O'&&s[j]=='R')ans++;
	    }
	    if(s.size()==1&&s[0]=='O')v[9]++;
	    else if(s[0]=='R'){
		    if(s.back()=='A')v[1]++;
		    else if(s.size()>=2&&s[s.size()-2]=='A'&&s.back()=='O')v[2]++;
		    else v[3]++;
    	}
	    else if(s.size()>=2&&s[0]=='O'&&s[1]=='R'){
		    if(s.back()=='A')v[4]++;
    		else if(s.size()>=2&&s[s.size()-2]=='A'&&s.back()=='O')v[5]++;
	    	else v[6]++;
	    }
    	else {
    		if(s.back()=='A')v[7]++;
    		else if(s.size()>=2&&s[s.size()-2]=='A'&&s.back()=='O')v[8]++;
    	}
    }
    while(v[2]>=1&&v[1]+v[2]+v[3]+v[5]+v[8]>=2)--v[2],++ans;
    while(v[4]>=1&&v[4]+v[5]+v[6]+v[1]+v[7]>=2)--v[4],++ans;

    while(v[1]&&v[5]){
        --v[1],--v[5],++ans;
        if(v[5]+v[6]+v[1]+v[7]>=1)++ans;
        else if(v[1]+v[3]+v[5]+v[8]>=1)++ans;
        else ++v[4];
    }
    while(v[1]){
        if(v[1]&&v[6])--v[1],--v[6],++v[3],++ans;
        else if(v[1]&&v[8])--v[1],--v[8],++v[7],++ans;
        else break;
    }
    while(v[5]){
        if(v[5]&&v[3])--v[5],--v[3],++v[6],++ans;
        else if(v[5]&&v[7])--v[5],--v[7],++v[8],++ans;
        else break;
    }
    
    while(v[2]){
        if(v[2]&&v[3])--v[2],++ans;
        else if(v[2]&&v[8])--v[2],++ans;
        else break;
    }
    while(v[4]){
        if(v[4]&&v[6])--v[4],++ans;
        else if(v[4]&&v[7])--v[4],++ans;
        else break;
    }
    
    while(v[3]&&v[8])--v[3],--v[8],++ans;
    while(v[6]&&v[7])--v[6],--v[7],++ans;
    
    while(v[9]){
        if(v[2]&&v[4])--v[2],--v[4],--v[9],++ans;
        else if(v[2]&&v[4])--v[2],--v[4],--v[9],++ans;
        else if(v[2]&&v[7])--v[2],--v[7],--v[9],++ans;
        else if(v[3]&&v[4])--v[3],--v[4],--v[9],++ans;
        else if(v[3]&&v[7])--v[3],--v[7],--v[9],++ans;
        else break;
    }
    while(v[9]){
        if(v[1]&&v[7])--v[1],--v[7],--v[9],++ans;
        else if(v[1]&&v[4])--v[1],--v[4],--v[9],++ans;
        else break;
    }
    while(v[9]){
        if(v[1]&&v[2])--v[1],--v[2],--v[9],++ans;
        else if(v[1]&&v[3])--v[1],--v[3],--v[9],++ans;
        else break;
    }
    while(v[9]){
        if(v[1]>=2)v[1]-=2,--v[9],++ans;
        else break;
    }
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  VI p(n);
  int ans = 0;
  REP(i, n) cin >> p[i];
  REP(i, n-2){
    if(p[i] < p[i+1] && p[i+1] < p[i+2]) ans++;
    else if(p[i] > p[i+1] && p[i+1] > p[i+2]) ans++;
  }
  out(ans);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
typedef pair<int,pair<int, int>> P1;

using Graph = vector<vector<int>>;


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

  int N, M;
  cin >> N >> M;
  int A[N];
  rep(i,N) A[i] = -1;
  int a, b;
  rep(i,M){
    cin >> a >> b;
    --a;
    if(A[a] != -1 && A[a] != b){
      cout << -1 << endl;
      return 0;
    }
    else{
      A[a] = b;
    }
  }
  if(N == 1 && A[0] == -1){
    cout << 0 << endl;
    return 0;
  }
  else if(N == 1 && A[0] == 0){
    cout << 0 << endl;
    return 0;
  }
  else if(N == 1){
    cout << A[0] << endl;
    return 0;
  }
  if(A[0] == -1) A[0] = 1;
  if(A[0] == 0){
    cout << -1 << endl;
    return 0;
  }
  cout << A[0];
  for(int i=1;i<N;i++){
    if(A[i] == -1){
      cout << 0;
    }
    else{
      cout << A[i];
    }
  }
}

Measured memory_bytes: 256
/* I have already deleted My old account because somebody stole my code
and i have no idea how. If you are copying this code atleast make it look different 
Yours Faithfully
Shobhit Yadav */

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

ll Q,N,T;

void solve(){
	 cin>>N;
	 ll temp;
	 ll sum = 0;
	 ll b1 , c1;
     map<ll , ll> cnt;
	 for(ll i = 0 ; i<N ; i++){
	 	cin>>temp;
	 	sum += temp;
	 	cnt[temp]++;
	 }
    cin>>Q;
    ll op[Q];
	 for(ll i = 0 ; i<Q ; i++){
	 	cin>>b1>>c1;

	 	sum = sum -(b1*cnt[b1]) + (c1*cnt[b1]);
	 	cnt[c1]+=cnt[b1];
	 	cnt[b1] = 0;
	 	op[i] = sum;
	 }

	 for(ll i = 0 ; i<Q ; i++)
	 	cout<<op[i]<<'\n';





}



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

	return 0;
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

namespace
{
	map<ll, int> PrimeFactorization(ll x)
	{
		map<ll, int> ret;
		for (int i = 2; i * i <= x; ++i)
		{
			while (x % i == 0)
			{
				x /= i;
				++ret[i];
			}
		}
		if (x > 1)
		{
			++ret[x];
		}
		return ret;
	}
}

void ABC114D()
{
	int N;
	cin >> N;
	map<int,int> primes;
	for (int i = 2; i <= N; ++i)
	{
		auto pf = PrimeFactorization(i);
		for (auto& x : pf)
		{
			primes[x.first] += x.second;
		}
	}
	int n74 = 0;
	int n24 = 0;
	int n14 = 0;
	int n4 = 0;
	int n2 = 0;
	for (auto& x : primes)
	{
		if (x.second >= 74)
			++n74;
		if (x.second >= 24)
			++n24;
		if (x.second >= 14)
			++n14;
		if (x.second >= 4)
			++n4;
		if (x.second >= 2)
			++n2;
	}
	int ct = 0;
	ct += n74;
	ct += n24 * (n2-1);
	ct += n14 * (n4-1);
	ct += n4 * (n4 - 1) / 2  * (n2-2);
	cout << ct << endl;
}

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



Measured memory_bytes: 256
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long ll;
const int MYINF = 1e9+7;

int n;
int x[128];
int y[128];

double identity(double x) { return x; }

double distance(int degree) {
	int i;
	double tmp;
	double ret = 0;
	double (*rtfn)(double) = identity;
	if (degree == 1) ;
	else if (degree == 2) rtfn = sqrt;
	else if (degree == 3) rtfn = cbrt;
	else {
		for (i = 0; i < n; i++) {
			tmp = abs(x[i] - y[i]);
			if (tmp > ret) ret = tmp;
		}
		return ret;
	}
	for (i = 0; i < n; i++) {
		ret += pow(abs(x[i] - y[i]), degree);
	}
	return rtfn(ret);
}

int main(int argc, char **argv)
{
	int i;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &x[i]);
	}
	for (i = 0; i < n; i++) {
		scanf("%d", &y[i]);
	}
	printf("%lf\n", distance(1));
	printf("%lf\n", distance(2));
	printf("%lf\n", distance(3));
	printf("%lf\n", distance(-1));
	return 0;
}

Measured memory_bytes: 712
$s = gets.split("").map(&:to_i)
array = [$s.shift]
$answers = []
def dfs(array, digit)
  if digit + 2 > $s.size
    $answers << array
    return
  end
  dfs([*array, $s[digit]], digit + 1)
  dfs([*array[0..-2], array[-1] * 10 + $s[digit]], digit + 1)
end
dfs(array, 0)
puts $answers.flatten.inject(:+)

Measured memory_bytes: 1916
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;

using namespace std;

int main(void){
    priority_queue<ll> goods;
    ll N, M, val;
    cin >> N >> M;
    rep(i, N){
        cin >> val;
        goods.push(val);
    }
    ll newval;
    rep(i, M){
        newval = (goods.top()/2);
        goods.pop();
        goods.push(newval);
    }
    ll count=0;
    rep(i, N){
        count += goods.top();
        goods.pop();
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define lli long long int
#define f(i,a,b) for(i=a;i<b;i++)
#define ff first
#define sc second
#define pb push_back
#define full(v) v.begin(),v.end()
#define ms(a) memset(a,0,sizeof(a))
#define mod 1000000007
#define mod2 998244353
#define msb(b) memset(b,true,sizeof(b))
#define msf(b) memset(b,false,sizeof(b))
#define MAXN 100005

int main()
{
    fio;
    int t,n,i,a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    if(a == 0)
        cout << 1;
    if(b == 0)
        cout << 2;
    if(c == 0)
        cout << 3;
    if(d == 0)
        cout << 4;
    if(e == 0)
        cout << 5;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int i,i0,n,m,ans[100005],dp[2];
char s[100005];
int main()
{
    scanf("%s",s+1);
    int len=strlen(s+1);
    for(i=1;i<=len;i++)ans[i]=1;
    for(i=1;i<=len;i++)
    {
        if(s[i]=='R')
        {
            dp[i%2]++;
            ans[i]--;
        }
        else
        {
            ans[i]+=dp[i%2];
            ans[i-1]+=dp[!(i%2)];
            dp[1]=dp[0]=0;
        }
    }
    for(i=len;i>=1;i--)
    {
        if(s[i]=='L')
        {
            dp[i%2]++;
            ans[i]--;
        }
        else
        {
            ans[i]+=dp[i%2];
            ans[i+1]+=dp[!(i%2)];
            dp[1]=dp[0]=0;
        }
    }
    for(i=1;i<=len;i++)printf("%d%c",ans[i],i==len?'\n':' ');
    return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
inline int read()
{
    int x=0,t=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-') t=-1,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return x*t;
}
int a,b,c;
int main ()
{
	a=read(),b=read(),c=read();
	if(c-(a-b)>=0) printf("%d\n",c-(a-b));
	else printf("0\n");
	return 0;
}


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

#define show(x) cerr << #x << " = " << x << endl ;
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define output_to_error freopen("error.txt" , "w" ,stderr)
#define fastio ios_base::sync_with_stdio(0)
#define endl '\n'

const int N = 3e3+1;
int dp[2*N][N];
pair < int , int > p[N];

int main()
{
	#ifdef LOCAL
        input_from_file;
        output_to_file;
        output_to_error;
    #endif
	fastio;cin.tie(0);cout.tie(0);
	int n , t ; cin >> n >> t ;
	for(int i = 1 ; i <= n ; ++i)
		cin >> p[i].first >> p[i].second;
	sort(p +1 , p + n + 1);
	for(int i = 1 ; i <= t + 3000 ; ++i){
		for(int j = 1 ; j <= n ; ++j){
			dp[i][j] = dp[i][j-1];
			if(i >= p[j].first && i - p[j].first < t) dp[i][j] = max(dp[i][j] , dp[i-p[j].first][j-1] + p[j].second);
 			// cerr << i << " "<< j << " "<<b[j] << " "<< dp[i][j] << endl;
		}
	}
	int ans = 0;
	for(int i = 1 ; i <= t + 3000 ; ++i)
		ans = max(dp[i][n] , ans);
	cout << ans;

	return 0;
}


Measured memory_bytes: 70656
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<iomanip>
#include<iterator>
#include<vector>
#include<map>
#include<utility>
#include<set>
#include<stack>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);


    int x;
    cin>>x;
    for(;;)
    {
        int tmp=0;
        for(int i=2;i<=sqrt(x);i++)
        {
            if(x%i==0){tmp++;break;}
        }
        if(tmp==0)  {break;}
        else        {x++;}
    }
    cout<<x<<"\n";
    return 0;
}


Measured memory_bytes: 3644
num = int(input())
data = []
dataAlpha = []

def div_sho(a):
  sho = a // 26
  if a % 26 == 0:
    sho -= 1
  return sho

def div_amari(a):
  amari = a % 26
  if amari == 0:
    amari = 26
  return amari

while num > 26:
  data.append(div_amari(num))
  num = div_sho(num)
  
data.append(num)
data.reverse()

for d in data:
  dataAlpha.append(chr(d + 96))

print("".join(dataAlpha))

Measured memory_bytes: 9084
N = int(input())
if 0 <= N <= 1000:
  print(1000 - N)
elif 1001 <= N <= 2000:
  print(2000 - N)
elif 2001 <= N <= 3000:
  print(3000 - N)
elif 3001 <= N <= 4000:
  print(4000 - N)
elif 4001 <= N <= 5000:
  print(5000 - N)
elif 5001 <= N <= 6000:
  print(6000 - N)
elif 6001 <=N <= 7000:
  print(7000 - N)
elif 7001 <= N <= 8000:
  print(8000 - N)
elif 8001 <= N <= 9000:
  print(9000 - N)
else:
  print(10000 - N)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if( a + b > c + d){
    cout << "Left" << endl;
  }else if( a + b == c + d){
    cout << "Balanced" << endl;
  }else{
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const ll INF = 1e18;
int N;
ll a[3009], pre[3009];
ll dp[3009][3009];

ll sum(int l, int r) { return pre[r] - pre[l - 1]; }

ll solve(int l, int r)
{
    if (l > r) return -INF - 1;

    if (dp[l][r] != -INF)
    {
        return dp[l][r];
    }

    if (l == r) return dp[l][r] = a[l];

    if (solve(l + 1, r) < solve(l, r - 1))
    {
        return dp[l][r] = sum(l, r) - solve(l + 1, r);
    }
    else
    {
        return dp[l][r] = sum(l, r) - solve(l, r - 1);
    }
}

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

    cin >> N;
    for (int i = 1; i <= N; i++)
    {
        cin >> a[i];
        pre[i] = pre[i - 1] + a[i];
    }

    for (int i = 1; i <= N; i++)
    {
        for (int j = 1; j <= N; j++)
        {
            dp[i][j] = -INF;
        }
    }

    ll X = solve(1, N);
    ll Y = sum(1, N) - solve(1, N);

    cout << X - Y << "\n";
}

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

int main() {
  unsigned long long int A,B,C;
  cin >> A >> B >> C;
  if(A % 2 == 0 || B % 2 == 0 || C % 2 == 0) {
    cout << 0 << endl;
  }
  else {
    if(max(A,max(B,C)) == A) {
      cout << B * C << endl;
    }
    else if(max(A,max(B,C)) == B) {
      cout << A * C << endl;
    }
    else {
      cout << A * B << endl;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 101010
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template <typename T>
void DEBUG(T e)
{
  if (DEBUG_OUT == false)
    return;
  std::cout << e << " ";
}
template <typename T>
void DEBUG(const std::vector<T> &v)
{
  if (DEBUG_OUT == false)
    return;
  for (const auto &e : v)
  {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void DEBUG(const std::vector<std::vector<T>> &vv)
{
  if (DEBUG_OUT == false)
    return;
  for (const auto &v : vv)
  {
    DEBUG(v);
  }
}
template <class T, class... Ts>
void DEBUG(T d, Ts... e)
{
  if (DEBUG_OUT == false)
    return;
  DEBUG(d);
  DEBUG(e...);
}
template <class T>
void corner(bool flg, T hoge)
{
  if (flg)
  {
    cout << hoge << endl;
    abort();
  }
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

struct Edge
{
  int to, id;
  Edge(int to, int id) : to(to), id(id) {}
};
vector<Edge> g[55];

vector<int> es;

bool dfs(int v, int tv, int p = -1)
{
  if (v == tv)
  {
    es = vector<int>();
    return true;
  }
  for (auto &&e : g[v])
  {
    if (e.to == p)
      continue;
    if (dfs(e.to, tv, v))
    {
      es.push_back(e.id);
      return true;
    }
  }
  return false;
}

void solve(void)
{
  int n;
  cin >> n;
  vector<vector<int>> graph(n);

  for (int i = 0; i < n - 1; i++)
  {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].emplace_back(b, i);
    g[b].emplace_back(a, i);
  }

  int m;
  cin >> m;
  vector<int> eset(m);
  vector<pair<int, int>> vp;
  for (int i = 0; i < m; i++)
  {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    dfs(a, b);
    for (auto &&e : es)
    {
      eset[i] |= 1LL << e;
    }
    // DEBUG(es);
  }

  int res = 0;
  for (int i = 0; i < 1 << m; i++)
  {
    int mask = 0;
    for (int j = 0; j < m; j++)
    {
      if (i >> j & 1)
        mask |= eset[j];
    }
    int white = __builtin_popcountll(mask);
    int now = 1LL << (n - 1 - white);
    if (__builtin_popcountll(i) % 2 == 0)
      res += now;
    else
      res -= now;
  }
  cout << res << endl;

  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 3652
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <sstream>
#include <vector>

struct City {
  int p = -1;
  int year = -1;
  int index = -1;
  int x = -1;
  City(int a, int b, int c) : p(a), year(b), index(c) {}
};

int main() {
  int n, m; std::cin >> n >> m;
  std::vector<std::vector<City> > belong_cities(n);
  for (int i = 0; i < m; ++i) {
    int p, y; std::cin >> p >> y;
    City c(p, y, i);
    belong_cities[p-1].push_back(c);
  }

  std::vector<City> cs;
  for (int i = 0; i < n; ++i) {
    auto cities = belong_cities[i];
    std::sort(cities.begin(),  cities.end(),
        [](const City& a,  const City& b) { return a.year < b.year; });
    int x = 1;
    for (auto c : cities) {
      c.x = x;
      cs.push_back(c);
      ++x;
    }
  }

  std::sort(cs.begin(),  cs.end(),
      [](const City& a,  const City& b) { return a.index < b.index; });
  for (const auto c : cs) {
    std::cout << std::setw(6) << std::setfill('0') << c.p
              << std::setw(6) << std::setfill('0') << c.x
              << std::endl;;
  }
}


Measured memory_bytes: 8816
import numpy as np
N = input()
N = int(N)
S = input()
S = list(S)
data = np.array(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
                 "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"])

out = ""
for i in range(len(S)):
  idx = np.where(data == S[i])[0]
  out += data[int((idx + N) % 26)]

print(out)

Measured memory_bytes: 21396
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll n, x;
    cin >> n >> x;
    vector<ll> a(n);
    rep(i, 0, n) cin >> a[i];
    ll ans = 0;
    rep(i, 1, n) {
        ll sum = a[i] + a[i-1];
        if (sum > x) {
            ll d = sum - x;
            ans += d;
            if (a[i] >= d) a[i] -= d;
            else a[i] = 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main()
{
    int a, b, c, t;
    int sa, sb, sc;
 
    sa = sb = sc = 0;
    while (183748917) {
        scanf("%d%d%d", &a, &b, &c);
        if (a + b <= c || b + c <= a || c + a <= b) break;
        if (c < a) t = c, c = a, a = t;
        if (c < b) t = c, c = b, b = t;
        t = a*a + b*b;
        if      (c*c == t) sa++;
        else if (c*c <  t) sb++;
        else               sc++;
    }
    printf("%d %d %d %d\n", sa+sb+sc, sa, sb, sc);
    return 0;
}


Measured memory_bytes: 2144
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>
#include <stack>
#include <math.h>
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define RREP(i,n) for(ll i=(n)-1; i>=0; --i)
#define SREP(i,s,n) for(ll i=(s), i##_len=(n); i<i##_len; ++i)


using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

template <typename T>
T gcd(T a, T b) {
    if(a < b) gcd(b, a);
    if (b == 1) return 1;
    T r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

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

struct UnionFind {
    vector<int> par;
    vector<int> rank;
    
    UnionFind(int n = 1) {
        init(n);
    }
    
    void init(int n = 1) {
        par.resize(n); rank.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
        }
    }
    
    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};

#define MOD (1000000007)

void d(vector<vector<pair<ll, ll>>> &EV, vector<ll> &C, ll s, ll N) {
    map<ll, bool> seeked;
    stack<ll> st;
    st.push(s);
    while (st.size()) {
        ll node = st.top();
        st.pop();
        REP(i, EV[node].size()) {
            ll next = EV[node][i].first;
            ll edge_cost = min(EV[node][i].second, C[node]);
            C[next] = max(C[next], edge_cost);
            if (!seeked[next]) st.push(next);
        }
        seeked[node] = true;
    }
}

int main(int argc, const char * argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, M;
    cin >> N >> M;
    
    vector<pair<ll, ll>> E(M);
    REP(i, M) {
        ll A, B;
        cin >> A >> B;
        E[i] = make_pair(A-1, B-1);
    }
    
    
    UnionFind uf(N);
    vector<ll> S(M+1, 0);
    S[M] = N*(N-1)/2;
    vector<ll> C(N, 1);
    ll col = 1;
    REP(i, M-1) {
        ll j = M-1-i;
        ll A = E[j].first;
        ll B = E[j].second;
        int ra = uf.root(A);
        int rb = uf.root(B);
        if (ra == rb) {
            S[j] = S[j+1];
        } else {
            uf.merge(A, B);
            int rc = uf.root(A);
            ll ca = C[ra];
            ll cb = C[rb];
            ll cc = ca+cb;
            ll d = - ca*(ca-1)/2 - cb*(cb-1)/2 + cc*(cc-1)/2;
            C[ra] = 0;
            C[rb] = 0;
            C[rc] = cc;
            S[j] = S[j+1] - d;
        }
    }
    
    REP(i, M) {
        cout << S[i+1] << endl;
    }
}


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

#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define rep(i, x, y) for(decltype(y) i = (x) - ((x) > (y)); i != (y) - ((x) > (y)); i += 1 - 2 * ((x) > (y)))
#define trav(i,a) for(auto& (i) : (a))
#define all(a) (a).begin(),(a).end()
#define sz(a) int((a).size())
#define clr(a,x) memset((a),(x),sizeof(a)) // array (0,-1)
#define dbg(x) cerr << "STDERR => " << __LINE__ << ": " << #x << " = " << (x) << "  :(\n";
#define pb push_back
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline void cpuTime() { cerr << "cpu time : " << double(clock())/CLOCKS_PER_SEC << "\n"; return; }
using ll = long long;
using ull = unsigned long long;
using F = float;
using D = double;
using vi = vector<int>;
using pii = pair<int,int>;



void solve(){

    int n = 0, k = 0;
    cin >> n >> k;

    vi a(n);
    rep(i,0,n) cin >> a[i];

    rep(i,0,n-k){
        if(a[i] < a[k+i]) cout << "Yes\n";
        else cout << "No\n";
    }
    return;
}

/*
 read the question carefully ( what're the exact constraints? )
 look out for SPECIAL CASES (n=1?) and OVERFLOW (ll vs int?) ARRAY OUT OF BOUNDS
 Check datatypes
*/
int main(){

    fast_io;
    int t=1;
    // cin >> t;

    while(t--){
        solve();
    }

    cpuTime();
return 0;
}


Measured memory_bytes: 4016
#include <bits/stdc++.h>
#define bug1(x) cout<<#x<<" = "<<x<<endl
#define bug2(x,y) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<endl
#define bug3(x,y,z) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<endl
#define bug4(x,y,z,m) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<" "<<#m<<" = "<<m<<endl

using namespace std;

class Debugger {
public:
	template<typename T>
	void printVector(vector<T> const &vec, bool printSize=true){
		if(printSize){
			cout << vec.size() << endl;
		}
		for(auto &elem : vec){
			cout << elem << " ";
		}
		cout << endl;
	}

	template<typename T>
	void printMatrix(vector<vector<T>> const &matrix){
		cout << matrix.size()<< " ";
		if(!matrix.empty()){
			cout << matrix[0].size();
		}
		cout << endl; 
		for(auto &vec : matrix){
			printVector(vec, false);
		}
		cout << endl;
	}
};

const int maxN = 100005;
const int INF = 1e9;
#define ll long long

class TaskA {
private:
	Debugger debugger;

public:
	void solveOne(int it){
		string s;
		cin >> s;
		cout << s.substr(0,3) << endl;
	}

	void solve(){
		int tc = 1;
		for(int it = 1; it <= tc; it++){
			solveOne(it);
		}
	}
};

int main(){
	srand(time(NULL));
	ios_base::sync_with_stdio(false);
	TaskA solver;
	solver.solve();
	return 0;
}


Measured memory_bytes: 3616
def main():
    A, B = map(int, input().split())
    s = input()
    numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
    flag = True
    if len(s) == A + B + 1:
        if s[A] != '-':
            flag = False
        for a in s[:A]:
            if a not in numbers:
                flag = False
        for b in s[A+1:]:
            if b not in numbers:
                flag = False
    else:
        flag = False
    
    if flag:
        print("Yes")
    else:
        print("No")
        

if __name__ == "__main__":
    main()

Measured memory_bytes: 9208
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static void Main(string[] args)
        {
            int N = ReadInt();
            var S = Read();
            Console.WriteLine(new string(S.Select(c => (char)('A' + ((c - 'A') + N) % 26)).ToArray()));
        }
    }
}


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

int main() {
  int N;
  cin>>N;
  vector<int> data(N);
  rep(i,N){cin>>data[i];}
  sort(data.begin(),data.end());
  reverse(data.begin(),data.end());
  int a=0,b=0;
  if(N%2==0){
    rep(i,N/2){
    a+=data[i*2]; b+=data[i*2+1];
    }
  }
  else{
    rep(i,N/2){
    a+=data[i*2]; b+=data[i*2+1];
    }
    a+=data[N-1];
  }
  cout<<(a-b)<<endl;
}

Measured memory_bytes: 256
import bisect
import sys
INF = 10**18

A,B,Q=map(int, input().split())
s=[-INF]+[int(input()) for _ in range(A)]+[INF]
t=[-INF]+[int(input()) for _ in range(B)]+[INF]
x=[int(input()) for _ in range(Q)]
s.sort()
t.sort()
"""
A,B,Q = 2,3,4
s=[-INF,100,600,INF]#要ソート
t=[-INF,400,900,1000,INF]
x=[150,2000,899,799]"""
ls = len(s)
lt = len(t)
for xi in x:
    s2 = bisect.bisect_left(s,xi)#誰の左に入るかが出力される
    s1=s2-1
    t1 = 0
    t2 = bisect.bisect_left(t,xi)
    t1=t2-1
    l1 = l2 = l3 = l4 = sys.maxsize
    l1 = max(abs(s[s1]-xi),abs(t[t1]-xi))
    l2 = max(abs(s[s2]-xi),abs(t[t2]-xi))
    if abs(s[s1]-xi)<abs(t[t1]-xi):
        l3 = 2*abs(s[s1]-xi) + abs(t[t2]-xi)
    else:
        l3 = 2*abs(t[t1]-xi) + abs(s[s2]-xi)
    if abs(s[s2]-xi)<abs(t[t2]-xi):
        l4 = 2*abs(s[s2]-xi) + abs(t[t1]-xi)
    else:
        l4 = 2*abs(t[t2]-xi) + abs(s[s1]-xi)
    l = [l1,l2,l3,l4]
    print(min(l))

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

int main() {
  string st;
  cin>>st;
  if(st[0]==st[1]||st[2]==st[1]||st[2]==st[3])
    
  cout<<"Bad"<<endl;
  else
    cout<<"Good"<<endl;
      
      
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int long long
int hmt() {int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';if(n) x=-x;return x;}
#define in hmt()
#define ins ({string x;char c=getchar();for(;c==' '||c=='\n';c=getchar());for(;c!=' '&&c!='\n';c=getchar()) x+=c;x;})
#define forinc(i,a,b) for(int i=a,_b=b;i<=_b;++i)
#define fordec(i,a,b) for(int i=a;i>=b;--i)
#define forb(i,BS) for(int i=BS._Find_first();i< BS.size();i = BS._Find_next(i))
#define forv(a,b) for(auto &a:b)
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define reset(f,x) memset(f,x,sizeof(f))
#define bit(x,i) ((x>>(i-1))&1)
#define onbit(x,i) (x|(1<<(i-1)))
#define offbit(x,i) (x&~(1<<(i-1)))
const int N=200010;
int n,Q,A,B,a[N],oo,s[N],f[N],ans;
struct bit
{
	int t[N];
	void rs()
	{
	    reset(t,127);oo=t[0];
	}
	void upd(int i,int x)
	{
		for(;i<=n;i+=i&-i) t[i]=min(t[i],x);
	}
	int get(int i)
	{
		int g=oo;
		for(;i;i-=i&-i) g=min(g,t[i]);
		return g;
	}
}T[2];
void add(int i,int x)
{
	T[0].upd(i,x-i);
	T[1].upd(n-i+1,i+x);
}
main()
{
    //freopen("C.inp","r",stdin);
	n=in,Q=in,A=in,B=in;
	forinc(i,1,Q) a[i]=in;
	forinc(i,2,Q) s[i]=s[i-1]+abs(a[i]-a[i-1]);
	T[0].rs();T[1].rs();
	add(B,abs(A-a[1]));
	add(A,abs(B-a[1]));
	ans=s[Q]+min(abs(A-a[1]),abs(B-a[1]));
	forinc(i,2,Q)
	{
		f[i]=min(T[0].get(a[i])+a[i],T[1].get(n-a[i]+1)-a[i])+s[i-1];
		add(a[i-1],f[i]-s[i]);
		ans=min(ans,f[i]+s[Q]-s[i]);
	}
	cout<<ans<<"\n";
}


Measured memory_bytes: 8064
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
#include <numeric>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void printVector(vector<ll> A){
    cout << "[vector]" << endl;
    for(int i=0; i<A.size(); i++){
        cout << A[i] << " ";
    }
    cout << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    // input
    int N, i;
    cin >> N >> i;

    p(N-i+1);
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
typedef long long int ll;
using namespace std;

ll n;
ll a[1000][1000];

vector<vector<ll>> adjList;
vector<ll> deg;
vector<ll> depth;

ll index(ll x, ll y){
  // (1,0), (2,0), (2,1), (3,0), (3,1), (3,2), ...
  if (x < y) swap(x, y);
  return x * (x-1) / 2 + y;
}

int main(){
  cin >> n;
  ll m = n * (n-1) / 2;
  adjList = vector<vector<ll>>(m);
  deg = vector<ll>(m);
  depth = vector<ll>(m);
  for(int i=0;i<n;i++){
    for(int j=0;j+1<n;j++){
      cin >> a[i][j]; a[i][j]--;
      if (j>0){
        ll x = index(i, a[i][j-1]);
        ll y = index(i, a[i][j]);
        adjList[x].pb(y);
        deg[y]++;
        //cerr << x << " => " << y << endl;
      }
    }
  }
  queue<ll> q;
  for(int i=0;i<m;i++) if (deg[i]==0) q.push(i);
  ll cnt = 0;
  while(!q.empty()){
    ll now = q.front(); q.pop(); cnt++;
    //cerr << "now:" << now << endl;
    for(auto i : adjList[now]){
      deg[i]--;
      if (deg[i]==0) {
        q.push(i);
        depth[i] = depth[now] + 1;
      }
    }
  }
  //cerr << "..." << cnt << " " << m << endl;
  ll ans = -1;
  if (cnt == m){
    ans = 0;
    for(int i=0;i<m;i++) ans = max(ans, depth[i]);
    ans++;
  }
  cout << ans << endl;
  return 0;
}
  

Measured memory_bytes: 43136