akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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


int main(){
    ll H,W;
    cin>>H>>W;
    vector<string> S(H);
    rep(i,0,H)cin>>S[i];

    rep(i,-1,H+1){
        if(i == -1 || i == H){
            rep(i,0,W+2)cout<<"#";
            cout<<endl;
        }
        else{
            cout<<"#";
            cout<<S[i];
            cout<<"#";
            cout<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().rstrip()

N, X, M = map(int, input().split())

numlist = [-1] * M

num = X
ans = num
roop_start = -1
for i in range(N-1):
    new_num = (num * num) % M
    if numlist[num] == -1:
        numlist[num] = new_num
        ans += new_num
        num = new_num
    else:
        roop_start = num
        break

num = roop_start
if roop_start == -1:
    print(ans)
else:
    roop_sum = [num]
    for i in range(N-1):
        new_num = numlist[num]
        numlist[num] = -1
        if numlist[new_num] == -1:
            break
        else:
            roop_sum.append(roop_sum[-1] + new_num)
            num = new_num
        
    if numlist[X] != -1:
        count = 0
        ans = 0
        for i in range(M):
            if numlist[i] != -1:
                ans += i
                count += 1
        N -= count
    else:
        ans = 0

    size = len(roop_sum)
    div = N // size
    rest = N % size
    ans += div * roop_sum[-1]
    if rest != 0:
        ans += roop_sum[rest-1]
    print(ans)

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

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

#define fr first
#define sc second
#define mp1(a,b,c) P1(a,P(b,c))

int main(){
	static int n;
	static int a[102],b[102];
	static int c[102],d[102];
	scanf("%d",&n);
	for(int i = 0 ; i < n ; i ++){
		scanf("%d%d",&a[i],&b[i]);
	}
	for(int i = 0 ; i < n ; i ++){
		scanf("%d%d",&c[i],&d[i]);
	}
	
	vector<P1> vec;
	for(int i = 0 ; i < n ; i ++){
		vec.push_back(mp1(a[i],b[i],0));
		vec.push_back(mp1(c[i],d[i],1));
	}
	sort(vec.begin(),vec.end());
	
	int ret = 0;
	set<int> S;
	for(int i = 0 ; i < vec.size() ; i ++){
		P1 p = vec[i];
		if(p.sc.sc == 0){
			S.insert(p.sc.fr);
		}
		else {
			set<int>::iterator itr = S.lower_bound(p.sc.fr);
			if(itr == S.begin()){}
			else {
				itr--;
				S.erase(itr);
				ret ++;
			}
		}
	}
	cout << ret << endl;
}



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

struct UnionFind {
    vector<int> par;

    UnionFind(int N) : par(N, -1) {};

    int find (int x){
        if(par[x] < 0) return x;
        return par[x] = find(par[x]);  
    }

    bool unite (int x, int y){
        int rx = find(x); int ry = find(y); //xとyの根
        if(rx == ry) return false; //根が同じならreturn
        if(par[rx] > par[ry]){   //xの木のサイズのほうが小さければ要素を交換
            swap(rx, ry);
        }
        par[rx] += par[ry];
        par[ry] = rx;
        return true;
    }

    bool same(int x, int y){
        int rx = find(x); int ry = find(y);
        if(rx == ry) return true;
        return false;
    }

    int size(int x){
        return -par[find(x)];
    }
};

int deg[100005];
vector<int> block[100005];

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

    UnionFind tree(n);

    rep(i,n) deg[i] = 0;

    rep(i,m){
        int a, b;
        cin >> a >> b;
        --a; --b;
        tree.unite(a, b);
        deg[a]++;
        deg[b]++;
    }

    rep(i,k){
        int a, b;
        cin >> a >> b;
        --a; --b;
        block[a].push_back(b);
        block[b].push_back(a);
    }

    //rep(i,n) cout << tree.size(i) << " ";

    rep(i,n){
        int ans = tree.size(i) - 1 - deg[i];
        for(int u : block[i]){
            if(tree.same(i,u)) --ans;
        }
        printf("%d%c", ans, i == n ?'\n':' ');
    }
    
    return 0;
}

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

using namespace std;

using ll = long long;

int main(){
    ll n; cin >> n;
    map<ll, ll> mp;
    for(ll i = 0; i < n; ++i){
        ll tmp; cin >> tmp;
        mp[tmp]++;
    }
    ll ans = 0;
    for(auto x:mp){
        if(x.first > x.second)ans += x.second;
        else ans += abs(x.first - x.second);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 6272
input_data = list(map(int,input().split()))

rank1 = input_data[0]
rank2 = input_data[1]

my_sum = 0

if(rank1 == 1):
  my_sum = my_sum + 300000
elif(rank1 == 2):
  my_sum = my_sum + 200000
elif(rank1 == 3):
  my_sum = my_sum + 100000

  
if(rank2 == 1):
  my_sum = my_sum + 300000
elif(rank2 == 2):
  my_sum = my_sum + 200000
elif(rank2 == 3):
  my_sum = my_sum + 100000

if(rank1 == 1 and rank2 == 1):
  my_sum = my_sum + 400000
  
print(my_sum)

Measured memory_bytes: 3064
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

template<typename T>
T absi(T x) {
    if (x < static_cast<T>(0)) {
        x *= static_cast<T>(-1);
    }
    return x;
}

template<typename T>
T factorial(T n, T mod)
{
    T ret = static_cast<T>(1);
    for (T i = 1; i <= n; ++i) {
        ret *= i;
        ret %= mod;
    }
    return ret;
}


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

    constexpr int64_t DIV = 1000000007;

    if (absi(N - M) > 1) {
        std::cout << 0 << std::endl;
        return 0;
    }

    if (N > M) {
        auto m = factorial(M, DIV);
        auto n = m * N;
        n %= DIV;
        n *= m;
        n %= DIV;
        std::cout << n << std::endl;
    }
    else if (N == M) {
        auto m = factorial(M, DIV);
        m *= m;
        m %= DIV;
        m *= 2;
        m %= DIV;
        std::cout << m << std::endl;
    }
    else {
        // N < M
        auto n = factorial(N, DIV);
        auto m = n * M;
        m %= DIV;
        m *= n;
        m %= DIV;
        std::cout << m << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;
typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}

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

	int N; cin >> N;
	vector<ll> v(N);
	int ans = 0;
	for (int i = 0; i < N; i++) { cin >> v[i]; }
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			if (v[i] == v[j]) { continue; }
			for (int k = j + 1; k < N; k++) {
				if (v[i] == v[k] || v[j] == v[k]) { continue; }
				ll s = v[i] + v[j] + v[k];
				if (v[i] * 2 < s && v[j] * 2 < s && v[k] * 2 < s) {
					ans++;
				}
			}
		}
	}
	cout << ans << endl;

	return 0;
}

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

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

using namespace std;

bool marked[100000];
int prt[100000];

int gm(int i) {
  if (marked[i]) return i;
  return prt[i] = gm(prt[i]);
}

int main() {
  while(1) {
    int n,q;
    cin>>n>>q;
    if(!n) break;
    REP(i,n)marked[i]=false;
    marked[0] = true;
    REP(i,n-1) {
      cin>>prt[i+1];
      --prt[i+1];
    }
    vector<tuple<int,int>> ql;
    REP(i,q){
      string c;
      int v;
      cin>>c>>v;
      --v;
      if (c=="M") {
        if (marked[v]) continue;
        marked[v] = true;
      }
      ql.emplace_back(c=="Q"?1:0, v);
    }
    reverse(begin(ql),end(ql));
    int64_t sum = 0;
    REP(i,ql.size()){
      int c,v;
      tie(c,v) = ql[i];
      if(c)
        sum += gm(v) + 1;
      else
        marked[v] = false;
    }
    cout<<sum<<endl;
  }
  return 0;
}

Measured memory_bytes: 3408
#e

n = int(input())

#f(n) = 1 (n < 2)
#f(n) = n*f(n - 2)  (n>=2)
#def f(n):
#    if n < 2: return 1
#    else: return n * f(n - 2)

#n * (n-2) * ... * 3  if n is odd
#n * (n-2) * ... * 2 if n is even
# 2,4,6,8,10,...50,...,250,...,1250
# 10
# 20 * 50
# 40 * 250
# 60 * 500
if n % 2 == 1: ans = 0
else:
    ans = 0
    k = 5
    while 2 * k <= n:
        ans += n // (2 * k)
        k *= 5

print(int(ans))


Measured memory_bytes: 2940
//config = { input: 'tmp', newline: '\r\n' }; // win
config = { input: '/dev/stdin', newline: '\n' }; // linux

line = require('fs').readFileSync(config.input, 'ascii')
  .split(config.newline, 2);

A = line[1].split(' ').map(Number);

q = partition(A, 0, A.length);
A[q] = '[' + A[q] + ']';
console.log(A.join(' '));

function partition(A, p, r) {
  var x, i, j, tmp;
  x = A[r - 1];
  i = p;
  for (j = p; j < r - 1; j++) {
    if (A[j] <= x) {
      tmp = A[i];
      A[i] = A[j];
      A[j] = tmp;
      i++;
    }
  }
  tmp = A[i];
  A[i] = A[r - 1];
  A[r - 1] = tmp;
  return i;
}

Measured memory_bytes: 27088
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;


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

	cin >> N;
	vector<pair<pair<int, int>, int>>v(N);
	int box = 0;
	for (auto &i : v) {
		cin >> i.first.first >> i.first.second >> i.second;
		box |= i.second;
	}
	if (!box) {
		vector<vector<int>>w(101, vector<int>(101,MOD));
		int  m = 0;
		for (int i = 0; i <= 100; i++) {
			for (int j = 0; j <= 100; j++) {
				for (auto k : v) {
					w[i][j] = min(w[i][j], abs(i - k.first.first) + abs(j - k.first.second));
					m = max(m, w[i][j]);
				}
			}
		}
		for (int i = 0; i <= 100; i++) {
			for (int j = 0; j <= 100; j++) {
				if (w[i][j] == m) {
					cout << i << " " << j << " " << m << endl;
				}
			}
		}
		return 0;
	}
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			bool flag = true;
			int h = 0;
			for (int k = 0; k < N; k++) {
				if (v[k].second) {
					h = abs(i - v[k].first.first) + abs(j - v[k].first.second) + v[k].second;
					break;
				}
			}
			for (auto k : v) {
				if (max(h - abs(i - k.first.first) - abs(j - k.first.second), 0) != k.second)flag = false;
			}
			if (flag) {
				cout << i << " " << j << " " << h << endl;
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>


#define rep(i,p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

/*
//D
int main(void) {
	ll n, k;
	cin >> n >> k;
	vector<ll> a = vector<ll>(n);
	rep(i, 0, n)cin >> a[i];
	ll lastIndex = 0;
	ll ans = 0;
	ll sum = 0;
	rep(i, 0, n) {
		sum += a[i];
		if (sum >= k) {
			rep(j, lastIndex, i) {
				if (sum - a[j] >= k) {
					sum -= a[j];
					lastIndex++;
				}
				else {
					break;
				}
				
			}
			ans += lastIndex + 1;
		}
	}
	cout << ans << endl;
}*/

int main(void) {
	double w, h, x, y;
	cin >> w >> h >> x >> y;
	double c = 2 * y - h;
	double d = w - 2 * x;
	double ans = 0;
	bool isMulti = true;
	if (0 <= y * d / c + x && y * d / c + x <= w && 0 <= (y - h) * d / c + x && 0 <= (y - h) * d / c + x <= w);
	else isMulti = false;
	if (c == 0 || d == 0) {
		ans = (double)w * h / (double)2;
		
	}
	ans = w * h / (double)2;
	if (x * 2 == w && y * 2 == h) {
		cout << fixed << setprecision(9) << ans << " " << 1 << endl;
	}
	else cout << fixed << setprecision(9) << ans << " " << 0 << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()
#define pb         push_back
#define mp         make_pair

typedef pair<int,int> pii;

const int N=800;
const int Rs='z'+1;
const int SPACE='A'-1;
bool isequal[N][N];
bool leadSpace[N];
string table[21][N];
bool   isexist[21][N];

void get_input(int n,vector<pii> *rule,int &p){
  rep(i,n){
    string in;
    cin>>in;
    if (in.size()== 2){//SPACE
      leadSpace[in[0]]=true;
      rule[in[0]].pb(mp(SPACE,SPACE));
    }else{
      int me  = in[0];
      REP(j,2,(int)in.size()-1){
	//	cout <<"rule "<< me <<" " << (int)in[j] <<" " <<p << endl;
	rule[me].pb(mp(in[j],p));
	me=p;
	p++;
      }
      //      cout <<"rule "<< me <<" " << (int)in[in.size()-1] << " " << SPACE<<endl;
      rule[me].pb(mp(in[in.size()-1],SPACE));
    }
  }
}

void make_space(int p,vector<pii> *rule){
  rep(k,p){
    rep(i,p){
      rep(j,rule[i].size()){
	if (leadSpace[rule[i][j].first]&&leadSpace[rule[i][j].second]){
	  leadSpace[i]=true;
	}
      }
    }
  }
}

bool vis[N];
void make_equal(int from,int now,vector<pii>*rule){
  if (vis[now])return;
  vis[now]=true;
  if (now != SPACE && !((int)'a'<=now && now <=(int)'z'))isequal[from][now]=true;
  rep(i,rule[now].size()){
    if (leadSpace[rule[now][i].first]){
      make_equal(from,rule[now][i].second,rule);
    }
    if (leadSpace[rule[now][i].second]){
      make_equal(from,rule[now][i].first,rule);
    }
  }
}

string solve(int p,int len,vector<pii> *rule){
  rep(i,p){
    rep(j,21){
      table[j][i]=string(1,(char)'z'+1);
      isexist[j][i]=false;
    }
  }

  rep(i,p){
    if (leadSpace[i]){
      table[0][i]="";
      isexist[0][i]=true;
    }
  }

  REP(k,1,len+1){
    rep(i,p){
      rep(j,rule[i].size()){
	if ('a'<= rule[i][j].first && rule[i][j].first <='z'){
	  if (isexist[k-1][rule[i][j].second]){
	    isexist[k][i]=true;
	    table[k][i]=min(table[k][i],string(1,(char)rule[i][j].first)+table[k-1][rule[i][j].second]);
	  }
	}else {
	  rep(l,k+1){
	    if (isexist[l][rule[i][j].first] &&
		isexist[k-l][rule[i][j].second]){
	      isexist[k][i]=true;
	      table[k][i]=min(table[k][i],
			      table[l][rule[i][j].first]+table[k-l][rule[i][j].second]);
	    }
	  }
	}
      }
    }
    
    
    rep(i,p){
      rep(j,p){
	if (i != j && isequal[i][j]){
	  if (isexist[k][i] && isexist[k][j]){
	    table[k][i]=min(table[k][i],table[k][j]);
	  } else if (isexist[k][j] && !isexist[k][i]){
	    isexist[k][i]=true;
	    table[k][i]=table[k][j];
	  }
	}
      }
    }
  }
   
  if (isexist[len]['S'])return table[len]['S'];
  return "-";
}

main(){
  int n,l;
  while(cin>>n>>l && n){
    rep(i,N){
      rep(j,N)isequal[i][j]=false;
      isequal[i][i]=true;
    }
    rep(i,N)leadSpace[i]=false;
    leadSpace[SPACE]=true;

    vector<pii> rule[N];
    int p = Rs;
    get_input(n,rule,p);

    make_space(p,rule);

    rep(i,p){
      rep(j,p)vis[j]=false;
      make_equal(i,i,rule);
    }

    cout << solve(p,l,rule) << endl;
  }
  return false;
}

Measured memory_bytes: 2036
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int c, a, b;
  cin >> a >> b >> c;
 
if (a < b)
  {if (a<c&&c<b) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;}
else if (a>b)
  {if (b<c&&c<a) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;}
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i=0;i<n;i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){

    int N;
    cin >> N;
    double y = 0.0;
    for(int i = 0; i < N; i++){
        double x;
        string u;
        cin >> x >> u;
        if(u=="JPY")y += x;
        else y += x * 380000;
    }
    printf("%.9f\n", y);
    return 0;
}

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

int main() {
  int n, a, b, max_a, max_b;
  scanf("%d", &n);
  max_a = max_b = -1;
  for (int i=0; i<n; i++) {
    scanf("%d %d", &a, &b);
    if (max_b<b) {
      max_b = b;
      max_a = a;
    } else if (max_b==b && max_a>a) {
      max_a = a;
    }
  }
  printf("%d %d\n", max_a, max_b);
  return 0;
}

Measured memory_bytes: 1028
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 16:22:00 2020

@author: neb0123
"""

def maxProductSubarrayOfSizeK(A, n, k): 
    A.sort() 
    product = 1
  
    if (A[n - 1] == 0 and (k & 1)): 
        return 0
  
    if (A[n - 1] <= 0 and (k & 1)) : 
        for i in range(n - 1, n - k - 1, -1): 
            product *= A[i] 
            product %= (10**9 + 7)
        return product 

    i = 0
    j = n - 1

    if (k & 1): 
        product *= A[j] 
        product %= (10**9 + 7)
        j-= 1
        k-=1
    k >>= 1

    for itr in range( k) : 
        left_product = A[i] * A[i + 1] 
        right_product = A[j] * A[j - 1] 
  
        if (left_product > right_product) : 
            product *= left_product 
            product %= (10**9 + 7)
            i += 2
          
        else : 
            product *= right_product
            product %= (10**9 + 7) 
            j -= 2

    return product

if __name__ == "__main__":
    N,K = map(int, input().split(' '))
    A = list(map(int,input().split(' ')))
    print(maxProductSubarrayOfSizeK(A,N,K))

Measured memory_bytes: 93616
#include <iostream>
using namespace std;
int main()
{
    string s;
    cin>>s;
    if(s=="Sunny")
        cout<<"Cloudy"<<endl;

    if(s=="Cloudy")
        cout<<"Rainy"<<endl;


    if(s=="Rainy")
        cout<<"Sunny"<<endl;


    return 0;
}


Measured memory_bytes: 256
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

n = int(input())
seq = sorted((int(x) for x in input().split()), reverse=True)
ans = seq[0]

i = 1
cnt = 2
cnt_in = 0
while cnt < n:
    ans += seq[i]
    cnt_in += 1
    if cnt_in == 2:
        cnt_in = 0
        i += 1
    cnt += 1

print(ans)


Measured memory_bytes: 113772
/**
	������������ Author : Avi J Patel ������������
	������������ University : DA-IICT ������������
**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair 
#define mt make_tuple
#define N 100000
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define large 10000000000000001

#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));

bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 
/*void calc()
{
	for(int i=0;i<2005;i++)
	{
		a[i][0]=1;
		a[i][i]=1;
		for(int j=1;j<i;j++)
		{
			a[i][j]=(a[i-1][j-1]+a[i-1][j])%MOD;	
		}
	}
}*/
int main()
{
	int n;
	cin>>n;
	vector<ll> a(n);
	int temp=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	//vector<ll> t;
	int cnt=0;
	multiset<ll> b;
	for(int i=0;i<n;i++)
	{
		auto it=b.lower_bound(a[i]);
		if(it==b.begin())
		{
			cnt++;
		}
		else
		{
			it--;
			b.erase(it);
		}
		b.insert(a[i]);
	}
	cout<<cnt;
	return 0;
}









Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define ff first
#define setp(a) setprecision(a)<<fixed
#define ss second
#define fori(v) for(ll i=0; i<v; i++)
#define forj(v) for(ll j=0; j<v; j++)
#define fork(v) for(ll k=0; k<v; k++)
#define forl(v) for(ll l=0; l<v; l++)
#define fort(v) for(ll t=0; t<v; t++)
#define forz(v) for(ll z=0; z<v; z++)
#define ll long long
#define ld long double
#define MAX (int)(7*pow(10,2) + 10)
#define pb(a) push_back(a)
// #define cout out
// #define cin in
ll inf = pow(10,9);
ll INF = inf;
ll modulo = inf;
double eps = 1e-10;
ifstream in;
ofstream out;

 
void deal(){
	ll a, b, c;
	cin>>a>>b>>c;
	string ans[2] = {"No", "Yes"};
	cout<<ans[((a==b)&&(b==c))];
}



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



/*
	
*/

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

#define int long long
#define INT int
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}
typedef long long ll;

int dbl[63][200005];

signed main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);

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

    rep(i, n)
    {
        dbl[1][i] = a[i];
    }

    for (int i = 2; i <= 62; i++)
    {
        rep(j, n)
        {
            dbl[i][j] = dbl[i - 1][dbl[i - 1][j]];
        }
        if ((1ll << i) > k)
            break;
    }
    vector<int> f1;
    int s = 0;
    rep(i, 61)
    {
        int t = 1ll << i;
        if (s > k)
            break;
        if (k & t)
        {
            s += t;
            f1.pb(i + 1);
        }
    }

    int result = 0;

    for (int p : f1)
    {
        result = dbl[p][result];
    }
    cout << result + 1 << endl;

    return 0;
}


Measured memory_bytes: 98392
#include<stdio.h>
int main(void)
{
	int n,m,i,a;
	int x[51];
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++) x[i]=0;
	for(i=0;i<m*2;i++){
		scanf("%d",&a);
		x[a]+=1;
	}
	for(i=1;i<=n;i++) printf("%d\n",x[i]);
	return 0;
}	

Measured memory_bytes: 128
#include <cmath>
#include <cstdio>
#include <limits>
#include <tuple>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <string>
#include <array>
#include <iomanip>

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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);

  ll n, k;
  cin >> n >> k;
  vector<ll> x(n);
  rep(i, n) {
    cin >> x.at(i);
  }
  ll zeropoint = 100000000000000000;
  rep(i, n - 1) {
    if (x.at(i) <= 0 and 0 < x.at(i + 1)) {
      zeropoint = i;
      break;
    }
  }
  if (zeropoint == 100000000000000000) {
    if (x.at(0) >= 0) zeropoint = 0;
    else zeropoint = n - k;
  }
  ll sp = zeropoint - k < 0 ? 0 : zeropoint - k;
  ll ep = sp + 2 * k >= n ? n - k : sp + k;
  ll ans = 1000000000000000000;
  if (k > 1) {
    for (int i = sp; i <= ep; ++i) {
      ll time = 0;
      if (x.at(i) < 0 and x.at(i + k - 1) > 0) {
        time = abs(x.at(i)) + abs(x.at(i + k - 1));
        time += min(abs(x.at(i)), abs(x.at(i + k - 1)));
      } else {
        time = max(abs(x.at(i)), abs(x.at(i + k - 1)));
      }
      ans = min(ans, time);
    }
  } else {
    rep(i, n) ans = min(ans, abs(x.at(i)));
  }

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

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

int main() {
  int l, n;
  scanf("%d %d", &l, &n);
  vector<int> a(n);
  for (int i = 0; i < n; ++i)
    scanf("%d", &a[i]);
  if (n == 1)
    return 0 * printf("%d\n", max(a[0], l - a[0]));

  long long ans = max(a[n - 1], l - a[0]);

  vector<long long> pref(n, a[0]), suf(n, l - a[n - 1]);
  for (int i = 1; i < n; ++i)
    pref[i] = pref[i - 1] + a[i];
  for (int i = n - 2; i >= 0; --i)
    suf[i] = suf[i + 1] + l - a[i];
  for (int i = -1; i < n - 1; ++i) {
    long long cur = 2 * (i == -1 ? 0 : a[i]);
    int sisa = n - i - 1;
    cur += 2 * (pref[i + sisa / 2] - (i == -1 ? 0 : pref[i]));
    cur += 2 * suf[i + sisa / 2 + 1];
    if (sisa % 2 == 0)
      cur -= a[i + sisa / 2];
    else
      cur -= l - a[i + sisa / 2 + 1];
    ans = max(ans, cur);
  }
  reverse(a.begin(), a.end());
  for (int i = 0; i < n; ++i)
    a[i] = l - a[i];
  fill(pref.begin(), pref.end(), a[0]);
  fill(suf.begin(), suf.end(), l - a[n - 1]);
  for (int i = 1; i < n; ++i)
    pref[i] = pref[i - 1] + a[i];
  for (int i = n - 2; i >= 0; --i)
    suf[i] = suf[i + 1] + l - a[i];
  for (int i = -1; i < n - 1; ++i) {
    long long cur = 2 * (i == -1 ? 0 : a[i]);
    int sisa = n - i - 1;
    cur += 2 * (pref[i + sisa / 2] - (i == -1 ? 0 : pref[i]));
    cur += 2 * suf[i + sisa / 2 + 1];
    if (sisa % 2 == 0)
      cur -= a[i + sisa / 2];
    else
      cur -= l - a[i + sisa / 2 + 1];
    ans = max(ans, cur);
  }

  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 4096
x,y = map(int, input().split())

s = 0

if x == 1:
    s += 300000
if y == 1:
    s += 300000

if x == 2:
    s += 200000
if y == 2:
    s += 200000

if x == 3:
    s += 100000
if y == 3:
    s += 100000

if x == 1 and y == 1:
    s += 400000

print(s)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int ctr[MAXN];
bool poss[MAXN];
int main()
{
	int n,m;
	scanf("%d %d", &n, &m);
	poss[1] = true;
	for (int i = 1; i <= n; ++i)
		ctr[i]++;
	for (int i = 0; i < m; ++i)
	{
		int u,v;
		scanf("%d %d", &u, &v);
		if(poss[u])
		{
			if(ctr[u] == 1)
			{
				poss[u] = false;
			}
			poss[v] = true;
		}
		ctr[u]--;
		ctr[v]++;
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i)
		if(poss[i])
			ans++;
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 768
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
    ll n;
    cin >> n;
    ll p[n];
    ll i;
    for(i=0;i<n;i++){
        cin >> p[i];
    }
    ll ans =0;
    for(i=1;i<n-1;i++){
        if(p[i-1]<p[i]&&p[i]<p[i+1])ans++;
        if(p[i-1]>p[i]&&p[i]>p[i+1])ans++;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#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
s=input()
t=input()
import bisect
dist=[[]for i in range(30)]


for j in range(len(s)):
    dist[ord(s[j])-ord("a")].append(j+1)

cnt=0
nw = 1

for i in range(len(t)):
    chrno=ord(t[i])-ord("a")
    if len(dist[chrno]) == 0:
        print(-1)
        exit()

    neIdx = bisect.bisect_left(dist[chrno], nw)
    if neIdx == len(dist[chrno]):
        cnt+=1
        nw = dist[chrno][0]+1
    else:
        nw=dist[chrno][neIdx]+1

print(len(s)*cnt+nw-1)

Measured memory_bytes: 7540
#include <iostream>
#define N 10
using namespace std;
int main()
{
	int p[N];
	for (int i=0;i<N;i++)
		cin>>p[i];
	for (int n=0;n<N-1;n++)
		for (int m=n+1;m<N;m++)
			if (p[n]<p[m])
			{
				int temp=p[n];
				p[n]=p[m];
				p[m]=temp;
			}
			for (int k=0;k<3;k++)
				cout<<p[k]<<endl;
	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
char s[200];
int f[200][4],b[4]={1,9,81,729};
int c(int n,int m){
	if(m>n)return 0;
	int ans=1;
	for(int i=1;i<=m;i++)ans*=n-i+1;
	for(int i=1;i<=m;i++)ans/=i;
	return ans;
}
int main(){
	int k;scanf("%s%d",s,&k);
	int l=strlen(s);
	f[l][0]=1;
	for(int i=l-1;~i;i--){
		int x=s[i]-'0';
		f[i][0]=1;
		for(int j=1;j<=k;j++){
			if(x==0)f[i][j]=f[i+1][j];
			else f[i][j]=f[i+1][j-1]+(x-1)*c(l-i-1,j-1)*b[j-1]+c(l-i-1,j)*b[j];
		}
	}
	printf("%d",f[0][k]);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int cnt = 0;
        String target = sc.next();
        String input = sc.next();

        while (!input.equals("END_OF_TEXT")) {
            if (input.equalsIgnoreCase(target)) cnt++;
            input = sc.next();
        }

        System.out.println(cnt);

        sc.close();
    }
}


Measured memory_bytes: 26112
#include <stdio.h>
#include <string.h>
 
int stricmp(char* ch1,char* ch2){
    int ch1_length = 0,ch2_length = 0,div;
    for(int i = 0; ch1[i] != '\0';i++) ch1_length++;
    for(int i = 0; ch2[i] != '\0';i++) ch2_length++;
    if(ch1_length != ch2_length) return -1;
    for(int i = 0; ch1[i] != '\0';i++)
    {
        div = ch1[i] -ch2[i];
        if(div != 0 && div != 32 && div != -32)
            return -1;
    }
    return 0;
}
 
int main(){
    char W[11],T[1001];
    int count = 0;
    scanf("%s",W);
    while(true){
        scanf("%s",T);
        if(strcmp("END_OF_TEXT",T) == 0) break;
        if(stricmp(T, W) == 0) count++;
    }
    printf("%d\n",count);
}


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


int main(){
    long long h;
    int n;
    cin>>h>>n;
    int x,sum=0;
    for(int i=0;i<n;i++){
        cin>>x;
        sum+=x;
        
    }
    if(sum>=h)
    cout<<"Yes";
    else
    cout<<"No";
    
    
    
    return 0;
}


Measured memory_bytes: 256
S=input()
ans_list=[0]*len(S)

rmode=True
cnt_R=0
cnt_L=0
border_R=0
border_L=0
for i in range(len(S)):
  if rmode:
    if S[i]=="R":
      cnt_R+=1
    else:
      border_R=i-1
      border_L=i      
      rmode=False
      cnt_L=1
  else:
    if S[i]=="L":
      cnt_L+=1
    else:
      ans_list[border_R]+=(cnt_R+1)//2
      ans_list[border_L]+=cnt_R//2
      ans_list[border_R]+=cnt_L//2
      ans_list[border_L]+=(cnt_L+1)//2
      rmode=True
      cnt_R=1
      cnt_L=0
else:
  ans_list[border_R]+=(cnt_R+1)//2
  ans_list[border_L]+=cnt_R//2
  ans_list[border_R]+=cnt_L//2
  ans_list[border_L]+=(cnt_L+1)//2
  
      
ans_list_str=map(str,ans_list)
print(" ".join(ans_list_str))
  

Measured memory_bytes: 10484
N = int(input())
A = [int(x) for x in input().split()]

reg = A[0]
flg=True
if 0 in A:
    print(0)
    flg=False
    reg=0
for i in range(1, N):
    reg *= A[i]
    if reg>10**18:
        print(-1)
        flg=False
        break
if flg:
    print(reg)

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

vector<ll> pw2(51,1);
vector<ll> pw10(19,1);

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*(y/gcd(x,y));
}
ll myceil(ll x,ll y){
	if(x<=y) return 1;
	else if(x%y==0) return x/y;
	else return x/y+1;
}

//a,b x
int main(){
	//rep1(i,50) pw2[i]=2*pw2[i-1];
	//rep1(i,18) pw10[i]=10*pw10[i-1];
	ll A,B,C; cin>>A>>B>>C;
	if(A-B>C) cout<<0;
	else cout<<C-A+B;
		
}

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

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl



signed main(){

	set<string> s;

	int n;
	cin >> n;
	while (n--){
		string a, b;
		cin >> a >> b;
		if (a == "insert") s.insert(b);
		else{
			if (s.find(b) != s.end()) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}


	return 0;
}



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

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

    //int p_mem[m];
    //std::string p_str_mem[m];
    //std::string s_mem[m];
    //std::string s_mem[m];
    int penalty_cnt = 0;
    int correct_cnt = 0;

    bool correct_flg[n];
    int tmp_penalty_cnt[n];
    for ( int i = 1; i <= n; i++ ) {
        correct_flg[i] = false;
        tmp_penalty_cnt[i] = 0;
    }

    while(m--){
        int p;
        std::string s;
        cin >> p >> s;
        if ( correct_flg[p] == true ) {
//            cout<<"END A"<<endl;
            continue;
        }
        if ( s == "AC" ) {
            correct_flg[p] = true;
            correct_cnt++;
            penalty_cnt += tmp_penalty_cnt[p];
//            cout<<"END B"<<endl;
        }
        else if ( s == "WA") {
            tmp_penalty_cnt[p]++;
//            cout<<"END C"<<endl;
        }
    }

    cout<<correct_cnt<<" "<<penalty_cnt<<endl;

    return 0;
}

Measured memory_bytes: 768
n = int(input())
a = [int(c) for c in input().split()]
a = sorted(a)
ret = n*(n-1)*(n-2)//6
for i in range(n):
	for j in range(i+1, n):
		low, high = 0, n-1
		pivot = -1
		while (low <= high):
			mid = low + (high - low)//2
			if (a[mid] >= a[i] + a[j]): 
				pivot = mid
				high = mid-1
			else: low = mid+1
		if (pivot != -1): ret -= n-pivot
print(ret) 


Measured memory_bytes: 68232
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
 
#define INF 10000000000
#define M 1000000007

#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))

int main() {
	long N;
	char s[200001];
	long ans = 0;
	long i, j;
	int g = 0, p = 0;
	
	scanf("%s", s);
	N = strlen(s);
	for(i=0;i<N;i++) {
		if(p < g) {
			p++;
			if(s[i] == 'g') {
				ans++;
			}
		} else {
			g++;
			if(s[i] == 'p') {
				ans--;
			}
		}
	}
	
	printf("%ld\n", ans);
	
	return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

struct SegmentTree{
  vector <ll> Tree[21];
  void Make(){
    for (int i = 0; i < 21; i++) Tree[i].resize(1<<i);
  }
  void Add(int loc, ll val){
    for (int i = 20; i >= 0; i--){
      Tree[i][loc] += val;
      loc /= 2;
    }
  }

  ll Sum(int loc){
    ll ans = Tree[20][loc];
    int now = 20;
    while (loc > 0){
      if (loc % 2 == 0){
        loc /= 2; loc--; now--;
      }else{
        loc--;
      }
      ans += Tree[now][loc];
    }
    return ans;
  }
};

int main(){
  SegmentTree T; T.Make();
  int N, Q; cin >> N >> Q;
  for (int i = 1; i <= N; i++){
    ll A; cin >> A;
    T.Add(i, A);
  }

  for (int i = 0; i < Q; i++){
    ll A, B, C; cin >> A >> B >> C;
    if (A == 0){
      T.Add(B + 1, C);
    }else{
      cout << T.Sum(C) - T.Sum(B) << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 20744
#include <cstdio>
using namespace std;
int N, M, ans, g[51][51] = {{0}};
void rec(int p, int *c) {
  if(c[p]) return;
  c[p] = 1; c[0]++;
  if(c[0] == N) {ans--; return;}
  for(int i = 1; i <= N; i++) {
    if(g[p][i]) rec(i, c);
  }
}
int main() {
  scanf("%d %d", &N, &M);
  for(int i = 0, a, b; i < M; i++) {
    scanf("%d %d", &a, &b);
    g[a][b] = g[b][a] = 1;
  }
  ans = M;
  for(int i = 1; i < N; i++) {
    for(int j = i+1; j <= N; j++) {
      if(!g[i][j]) continue;
      g[i][j] = g[j][i] = 0;
      int c[51] = {0}; rec(1, c);
      g[i][j] = g[j][i] = 1;
    }
  }
  printf("%d", ans);
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<numeric>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>

using namespace std;

typedef pair<int,int> P;


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

	vector<int> es[n];
	int u,k;
	for(int i=0;i<n;i++){
		cin >> u >> k;
		int v;
		for(int j=0;j<k;j++){
			cin >> v;
			es[i].push_back(v-1);
		}
	}

	int d[n];
	fill(d,d+n,-1);
	queue<P> que;
	que.push(P(0,0)); //点番号（0オリジン）、距離
	d[0] = 0;
	while(!que.empty()){
		P t = que.front(); que.pop();
		for(int i=0;i<es[t.first].size();i++){
			if(d[es[t.first][i]] == -1){
				que.push(P(es[t.first][i],t.second+1));
				d[es[t.first][i]] = t.second+1;
			}
		}
	}

	for(int i=0;i<n;i++){
		cout << i+1 << " " << d[i] << "\n";
	}
	return 0;
}


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

void solver() {
  int a, b, c;
  cin >> a >> b >> c;

  string ans = "No";
  if (a == b && a != c) ans = "Yes";
  if (a == c && a != b) ans = "Yes";
  if (b == c && b != a) ans = "Yes";

  cout << ans << "\n";
}

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


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int h[] = new int[n];
		int min = 1000000000;
		for(int i = 0; i < n; i++){
			h[i] = sc.nextInt();
		}
		Arrays.sort(h);
		for(int i = 0; i < n - k + 1; i++){
			int num = Math.abs(h[i+k-1]-h[i]);
			if(min > num){
				min = num;
			}
		}
		System.out.print(min);
	}
}


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

int main(void)
{
    long long X,K,D;
    long long ans = 0;
    cin >> X >> K >> D;

    if(K  <  abs(X) / D){
        ans = abs(X) - K * D;
    }else{
        if( (abs(X) / D) % 2 == 0 ){
            if( K % 2 == 0){
                ans = abs(X) % D;
            }else{
                ans = abs(abs(X) % D  - D);
            }
            
        }else{
            if( K % 2 == 0){
                ans = abs(abs(X) % D  - D);
            }else{
                ans = abs(X) % D;
            }
        }
    }

    cout << ans << endl;

}


Measured memory_bytes: 3648
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
      int N = nextInt();
      ArrayList<Integer> list = nextIntArray();
      int output = 0;
      for(int i = 0; i < N - 1; i++){
        int mae = list.get(i);
        int ato = list.get(i + 1);
        if(mae == ato){
          output++;
          list.set(i + 1, -1);
        }
      }
      myout(output);
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 33076
#include<stdio.h>
#include<limits.h>

int main(void)
{
	int i, n;
	scanf("%d", &n);
	
	int r[n];
	
	for(i = 0; i <= n - 1; i++)
	{
		scanf("%d", &r[i]);
	}
	
	int max = INT_MIN;
	int min = r[0];
	
	for(i = 1; i <= n - 1; i++)
	{
		if(max < r[i] - min) 
		{
		    max = r[i] - min;
		}
		
		if(min > r[i])
		{
		    min = r[i];
		}
	}
	
	printf("%d\n", max);
	
	return 0;
}


Measured memory_bytes: 2620
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int main(){
  int N,M;
  cin >> N >> M;
  vector< pair<int,int> > v(M);
  for(int i=0;i<M;i++){
    cin >> v[i].first >> v[i].second;
  }
  int i,maxy,c = 0;
  for(i=0;i<N;i++){
    maxy = c;
    for(int j=0;j<M;j++){
      if(v[j].first <= c + 1){
        maxy = max(maxy,v[j].second);
      }
    }
    if(maxy == c) break;
    c = maxy;
  }
  if(c < N) cout << "Impossible" << endl;
  else cout << i << endl;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    vector<int> a(3);
    rep(i, 3) cin >> a[i];
    int sum = 0;
    rep(i, 3) sum += a[i];
    if (sum <= 21) cout << "win" << endl;
    else cout << "bust" << endl;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 1000010
#define rep(i,n) for (int i = 0; i < (n); ++i)
const ll mod = 1e9+7;

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; }

bool flag[MAXN];
int pe[MAXN];
int main() {
    int n, m;
    cin >> n >> m;

    int p;
    string ju;

    rep(i, m) {
        cin >> p;
        --p;
        cin >> ju;
        
        if (ju == "AC") {
            flag[p] = true;
        }

        if (ju == "WA" and flag[p] == false) {
            pe[p]++;
        }
    }

    ll ans_pe = 0;
    ll ans_ac = 0;

    rep(i, n) {
        if (flag[i]) {
            ans_ac ++;
            ans_pe += pe[i];
        }

    }
    cout << ans_ac << " " << ans_pe << endl;

}



Measured memory_bytes: 2688
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll MAXN=3e3+69,INF=1e16;
struct vl{
    ll x,y;
    bool operator<(vl t)const{
        return x<t.x;
    }
};
ll n,t,ans;
vl a[MAXN];
ll dp[MAXN*2];
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n>>t;
    for(ll i=1;i<=n;i++)cin>>a[i].x>>a[i].y;
    sort(a+1,a+1+n);
    fill(dp,dp+MAXN*2,-INF);
    dp[0]=0;
    for(ll i=1;i<=n;i++){
        for(ll j=t-1;j>=0;j--)if(dp[j]!=-INF){
            dp[j+a[i].x]=max(dp[j+a[i].x],dp[j]+a[i].y);
            ans=max(ans,dp[j+a[i].x]);
        }
    }
    cout<<ans;
}

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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

ll a, b, c;

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> a >> b >> c;

	if (c - a - b > 0 && __int128(4) * a * b < __int128(c - a - b) * (c - a - b))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
    int a,b;

    cin >> a >> b;

    if(a < b)cout << "0";
    else cout << "10";

    return 0;
}


Measured memory_bytes: 256
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};

use std::collections::HashSet;

#[fastout]
fn main() {
    input! {
       n:usize,
       s:[String;n]
    }
    let mut set = HashSet::new();
    for i in s {
        set.insert(i);
    }
    println!("{}", set.len());
}


Measured memory_bytes: 24832
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };


int main() {
	long long n,a;
	double m;
	int x,ans;
	ans=0;
	cin>>n;	
	m=sqrt(n);
	x=m;
	//cout<<x<<endl;
	if(x*x==n){
		while(x>0){
			x=x/10;
			//cout<<x<<endl;
			ans++;
		}
	}
	else{
		while(n%x!=0){
			x--;
		}
		x=n/x;
		while(x>0){
			x=x/10;
			ans++;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256