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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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 (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int X;
	int ans = 0;
	cin >> X;
	ans = X / 11*2;

	if (X % 11 != 0)
	{
		if (X % 11 <= 6)
		{
			ans++;
		}
		else
		{
			ans += 2;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N;
  std::cin >> N;
  std::vector< std::pair<ll, ll> > vp(N);
  std::map< std::pair<ll, ll>, bool > mp;
  for (ll i = 0; i < N; i++) {
    std::cin >> vp[i].first >> vp[i].second;
    mp[vp[i]] = true;
  }

  ll ans = N;
  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < N; j++) {
      if (i == j) continue;
      ll p = vp[j].first  - vp[i].first;
      ll q = vp[j].second - vp[i].second;
      ll cost = N;
      for (ll k = 0; k < N; k++) {
	if (mp[{(vp[k].first - p), (vp[k].second - q)}] == true) {
	  cost--;
	}
      }
      ans = std::min(ans, cost);
    }
  }

  print(ans);
  return 0;
}


Measured memory_bytes: 4096
// C - Write and Erase
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define all(x) (x).begin(),(x).end()

int main(){
	int N; cin>>N;
	vi A(N); rp(i, 0, N) scanf("%d", &A[i]);
	sort(all(A));
	int ans = 0;
	int count = 1;
	for(int i=0; i<N-1; ++i, ++count)
		if(A[i] != A[i+1]){
			if(count&1) ans++;
			count = 0;
		}
	if(count&1) ans++;
	printf("%d\n", ans);
}

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

int main(){
  int H, W, A, B;
  cin >> H >> W >> A >> B;
  vector<vector<int>> vec(H, vector<int>(W));
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if((j < A && i < B) || (j >= A && i >= B)){
        vec.at(i).at(j) = 1;
        if(j == W - 1){
          cout << vec.at(i).at(j) << endl;
        }
        else{
          cout << vec.at(i).at(j);
        }
      }
      else{
        vec.at(i).at(j) = 0;
        if(j == W - 1){
          cout << vec.at(i).at(j) << endl;
        }
        else{
          cout << vec.at(i).at(j);
        }
      }
    }
  }
}

Measured memory_bytes: 5120
#include<bits/stdc++.h>
#include <math.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 all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
 ll N;
  cin >>N;

  vl A(N+1);
  
   rep(i,N+1) {
cin >>A.at(i);
   }
vl B(N);
  rep(i,N) {
cin >>B.at(i);
  }
 
 
  ll C[N];
  ll D[N];
     C[0]=min(A.at(0),B.at(0));
     D[0]=min(A.at(1),B.at(0)-C[0]);
     repl(i,1,N) {
       C[i]=min(B.at(i),A.at(i)-D[i-1]);
       D[i]=min(A.at(i+1), B.at(i)-C[i]);
       
     }
     
  
     
     
     
     
     
     
     
     
     
     ll sum=0;
  rep(i,N) {
    sum +=C[i]+D[i];
  }
  cout<<sum<<endl;

  
    

 
 
 }
  
 

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

bool allLettersAreEqual(string s){
  for(int i=0; i<s.size(); i++){
    if(s[i] != s[0]) return false;
  }
  return true;
}

int solve(string s){

  int result = 1e9;
  for(int i = 0; i < s.size(); i++){
    char target = s[i];
    
    int steps = 0;
    string t = s;
    while(!allLettersAreEqual(t)) {
      string tnew = "";
      for(int i=0; i<t.size()-1; i++){
        if(t[i] == target || t[i+1] == target) {
          tnew += target;
        }
        else tnew += t[i];
      }

      t = tnew;
      steps++;
    } 

    result = min(result, steps);
  }

  return result;
}

int main() {
  string s;
  cin >> s;
  cout << solve(s) << endl;
}

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

int main(void){
    int n, count=0;
    int *p;
    int bigger = -1;
    cin >> n;
    p = (int *)malloc(sizeof(int)*n);
    for(int i=0;i<n;++i){
        cin >> p[i];
        if(i>0){
            if(p[i-1]<p[i]){
                if(bigger==1) count++;
                bigger = 1;
            }else{
                if(bigger==0) count++;
                bigger = 0;
            }
        }
    }
    cout << count << "\n";
    free(p);
    return 0;
}


Measured memory_bytes: 256
/*                                              不开long long见祖宗                                                           */
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n;
int a[2000100];
int b[2000010];
int main()
{
	cin>>n;
	for(int i=2;i<=n;i++) cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		b[a[i]]++;
	}
	for(int i=1;i<=n;i++) cout<<b[i]<<endl;
	return 0;
}


Measured memory_bytes: 5152
#include <iostream>
#include <vector>
#include <bitset>
#include <algorithm>
#include <utility>
#include <map>
#include <functional>
#include <initializer_list>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
using namespace std;
typedef long long ll;

int main(){
    ll N;
    cin >> N;
    cout << N*N;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys

[H, W] = [int(i) for i in input().split()]

ans = 0

if H == 1 or W == 1:
    ans = 1
    print(ans)
    sys.exit()

HW = H * W

if HW % 2 == 0:
    ans = int(HW / 2)
else:
    ans = int(HW / 2) + 1

print(ans)

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


int main() { 
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(v.begin(), v.end());
    int res = 1;
    int last = v[0];
    for (int i = 1; i < n; i++) {
        if (v[i] > last) {
            res++;
        }
        last = v[i];
    }
    cout << res << endl;
}




Measured memory_bytes: 3628
import java.io.PrintWriter
import java.util.*

val pw = PrintWriter(System.out)
val sc = Scanner(System.`in`)


fun main(args: Array<String>) {
    val A = sc.nextInt()
    val B = sc.nextInt()

    var ans = -1
    for(i in 1..1000){
        if(Math.floor(i*0.08) == A.toDouble() && Math.floor(i*0.1) == B.toDouble()){
            ans = i
            break
        }
    }

    println(ans)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextListOfString() = next().split(" ")
fun nextListOfInt() = nextListOfString().map { it.toInt() }
fun nextListOfLong() = nextListOfString().map { it.toLong() }
fun nextListOfDouble() = nextListOfString().map { it.toDouble() }



Measured memory_bytes: 31400
n = int(input())
l = [list(map(int,input().split())) for _ in range(n)]
l1 = sorted([i for i,k in l])
l2 = sorted([k for i,k in l])[::-1]

if n%2!=0:
  a = l1[int(n//2)]
  b = l2[int(n//2)]
  print(b-a+1)
  
else:
  a1 = l1[int(n//2)-1]
  a2 = l1[int(n//2)]
  b1 = l2[int(n//2)-1]
  b2 = l2[int(n//2)]
  print((b1-a1+1)+(b2-a2+1)-1)

Measured memory_bytes: 50940
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAX 1000000000
#define PI 3.14159265359
int dx[] = {1,0,-1,0};
int dy[] = {0,-1,0,1};
const ll INF = 10010010010001;
vector<vector<bool>> graph;
vector<bool> reached;
ll MOD = 1000000007;


int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    if(N%2 == 1){
        cout << "No" << endl;
        exit(0);
    }
    else{
        int ci = N/2;
        for(int i=0;i<ci;i++){
            if(S[i] != S[i+ci]){
                cout << "No" << endl;
                exit(0);
            }
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
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(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;cin>>n>>m;
    vector<ll> a(n),b(m);
    vector<pair<ll,ll>> ab;
    rep(i,n){
        cin>>a[i];
        ab.push_back(make_pair(a[i],0));
    }
    ab.push_back(make_pair(0,0));
    rep(i,m){
        cin>>b[i];
        ab.push_back(make_pair(b[i],1));
    }
    sort(begin(a),end(a),greater<ll>());
    sort(begin(b),end(b),greater<ll>());
    sort(begin(ab),end(ab),greater<pair<ll,ll>>());
    rep(i,n-1){
        if(a[i]==a[i+1]){
            cout << 0 << endl;
            return 0;
        }
    }
    rep(i,m-1){
        if(b[i]==b[i+1]){
            cout << 0 << endl;
            return 0;
        }
    }
    ll cntw=0,cnth=0,cur=0,now=n*m,decided=0;
    ll res = 1;
    while(ab[cur].first!=0){
        if(ab[cur].first==ab[cur+1].first){
            DEBUG{
                printf("determined\n");
            }
            cntw++;cnth++;
            now--;
            decided++;
            cur+=2;
        }else{
            ab[cur].second==0 ? cnth++ : cntw++;
            res *= (ab[cur].second==0 ? cntw : cnth);
            res %= MOD;
            decided++;
            now--;
            cur++; 
        }
        ll tmp = 0;
        while(now>ab[cur].first){
            tmp++;
            now--;
        }
        if(cnth*cntw<decided+tmp){
            DEBUG{
                cout << "no" << endl;
            }
            cout << 0 << endl;
            return 0;
        }
        DEBUG{
            printf("now: %lld\n", ab[cur-1].first);
            printf("next: %lld\n", ab[cur].first);
            printf("tmp: %lld\n",tmp);
            printf("field: %lld\n",cnth*cntw-decided);

        }
        while(tmp>0){
            res *= cnth*cntw-decided;
            res %= MOD;
            decided++;
            tmp--;
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
#define inf 200000000000000
#define MAXN 1000001
#define eps 0.0000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();

//////////////

#define S second
#define F first
#define int long long  

//////////
int n;
long double dp[301][301][301];
long double f(int i,int j,int k)
{
    if(i<0||j<0||k<0)
        return 0;
    if(dp[i][j][k]>-0.5)
        return dp[i][j][k];
    long double d=i+j+k;
    dp[i][j][k]=n+k*f(i,j,k-1)+j*f(i,j-1,k+1)+i*f(i-1,j+1,k);
    dp[i][j][k]/=d;
    return dp[i][j][k];
}
signed main()
{
    fastio;
    
    cin>>n;
    for(int i=0;i<=n;++i)
    {
        for(int j=0;j<=n;++j)
            for(int k=0;k<=n;++k)
            {
                dp[i][j][k]=-1;
            }
    }
    dp[0][0][0]=0;
    int a[4]={};
    for(int i=0;i<n;++i)
    {
        int d;
        cin>>d;
        a[d]++;
    }
    cout<<fixed<<setprecision(20)<<f(a[3],a[2],a[1]);
}

Measured memory_bytes: 426496
n,m,q = gets.chomp.split.map(&:to_i)
qs = q.times.map{gets.chomp.split.map(&:to_i)}
ans = 0
stack = [[1]]
while !stack.empty?
	s = stack.pop
	sum = 0
	if s.size < n
		r = s[-1]
		(r..m).each do |i|
			temp = s.dup
			temp << i
			stack << temp
		end
	else
		qs.each do |a,b,c,d|
			if s[b-1] - s[a-1] == c
				sum += d
			end
		end
	end
	ans = sum if ans < sum
end

puts ans

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

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((int)(x).size())
#define REP(i, n) for(ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define ps(s) cout << #s << endl;
#define pv(v) cout << (v) << endl;

int main() {
	int a, p;
	cin >> a >> p;
	p += 3 * a;
	int res = p / 2;
	pv(res)

	return(0);
}

Measured memory_bytes: 256
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    return fac[n] * ifac[k] * ifac[n-k] % mod


def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac


X, Y = map(int, input().split())
# 後の、n, mの大小を一定にするため
if X > Y:
    X, Y = Y, X
dist = X + Y

if dist % 3 != 0:
    print(0)
else:
    # (+1,+2) の移動の回数を n、(+2,+1) の移動の回数を m とする)
    # total = n + m
    # 以下の式は、2n + m = X, n + 2m = Y の連立方程式を解いた結果
    total = int((X+Y) / 3)
    n = X - total

    # n < 0 もしくは m < 0 の場合、たどり着けない
    # Y > X なので、m > n
    # n < 0 → 2X - Y < 0
    if Y > 2*X:
        print(0)
    else:
        MOD = 10**9 + 7

        fac, ifac = make_tables(MOD, total)
        ans = cmb(total, n, MOD, fac, ifac)
        print(ans)

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

using ll = long long;
constexpr ll INF = 1e18;

int dfs(vector<vector<int>> const& g, int v, int p, vector<int>& d, vector<int>& sz, vector<int>& par) {
    int res = 1;
    par[v] = p;
    if(p == -1) {
        d[v] = 0;
    } else {
        d[v] = d[p] + 1;
    }
    for(auto to : g[v]) {
        if(to != p) {
            res += dfs(g, to, v, d, sz, par);
        }
    }
    return sz[v] = res;
}

int main() {
    int N;
    cin >> N;
    vector<vector<int>> g(N);
    for(int i = 0; i < N - 1; ++i) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<int> sz(N);
    vector<int> par(N, -1);
    vector<int> d(N);
    dfs(g, 0, -1, d, sz, par);
    int mid = d[N - 1] - (d[N - 1] - 1) / 2;
    int mid_v = N - 1;
    while(d[mid_v] > mid) {
        mid_v = par[mid_v];
    }
    if(sz[mid_v] >= (N + 1) / 2) {
        cout << "Snuke" << endl;
    } else {
        cout << "Fennec" << endl;
    }
}


Measured memory_bytes: 16256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

type bufReader struct {
	r   *bufio.Reader
	buf []byte
	i   int
}

var reader = &bufReader{
	bufio.NewReader(os.Stdin),
	make([]byte, 0),
	0,
}

func (r *bufReader) readLine() {
	if r.i < len(r.buf) {
		return
	}
	r.buf = make([]byte, 0)
	r.i = 0
	for {
		line, isPrefix, err := r.r.ReadLine()
		if err != nil {
			panic(err)
		}
		r.buf = append(r.buf, line...)
		if !isPrefix {
			break
		}
	}
}

func (r *bufReader) next() string {
	r.readLine()
	from := r.i
	for ; r.i < len(r.buf); r.i++ {
		if r.buf[r.i] == ' ' {
			break
		}
	}
	s := string(r.buf[from:r.i])
	r.i++
	return s
}

func (r *bufReader) nextLine() string {
	r.readLine()
	s := string(r.buf[r.i:])
	r.i = len(r.buf)
	return s
}

var writer = bufio.NewWriter(os.Stdout)

func next() string {
	return reader.next()
}

func nextInt64() int64 {
	i, err := strconv.ParseInt(reader.next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func nextInt() int {
	return int(nextInt64())
}

func nextLine() string {
	return reader.nextLine()
}

func out(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func max64(x, y int64) int64 {
	if x > y {
		return x
	}
	return y
}

func max(x, y int) int {
	return int(max64(int64(x), int64(y)))
}

func min64(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func min(x, y int) int {
	return int(min64(int64(x), int64(y)))
}

func abs64(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

func abs(x int) int {
	return int(abs64(int64(x)))
}

func joinInt64s(a []int64, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.FormatInt(v, 10)
	}
	return strings.Join(b, sep)
}

func joinInts(a []int, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.Itoa(v)
	}
	return strings.Join(b, sep)
}

func divUp64(x, y int64) int64 {
	return (x + y - 1) / y
}

func divUp(x, y int) int {
	return int(divUp64(int64(x), int64(y)))
}

func gcd64(x, y int64) int64 {
	if x < y {
		x, y = y, x
	}
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func gcd(x, y int) int {
	return int(gcd64(int64(x), int64(y)))
}

func lcm64(x, y int64) int64 {
	return x * y / gcd64(x, y)
}

func lcm(x, y int) int {
	return int(lcm64(int64(x), int64(y)))
}

func pow64(x, y int64) int64 {
	return int64(math.Pow(float64(x), float64(y)))
}

func pow(x, y int) int {
	return int(pow64(int64(x), int64(y)))
}

func main() {
	solve()
	writer.Flush()
}

func solve() {
	a, b, c := next(), next(), next()
	if a[len(a)-1] == b[0] && b[len(b)-1] == c[0] {
		out("YES")
	} else {
		out("NO")
	}
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void){

    int H,N;
    scanf("%d %d",&H,&N);
    int *a;
    a = (int *)malloc(sizeof(int)*N);
    for(int i=0;i<N;i++){
        scanf("%d",&a[i]);
    }
    int Total = H;
    for(int i=0;i<N;i++){
        Total -= a[i];
    }

    if(Total>0){
        printf("No");
    }else{
        printf("Yes");
    }
    return 0;
}

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

int main() {
  int N,K;
  cin >> N >> K;
  int t=N,num=1;
  for(t=N;t>0;t--){
    if(num*2<num+K) num*=2;
    else num+=K;
  }
  cout << num << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<bitset>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define arep(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    vector<ll> A(N), B(N);
    rep(i, 0, N) cin >> A[i] >> B[i];
    ll ans = 0;
    bitset<30> X(K);
    rep(i, 0, N) {
        bool is_ok = true;
        rep(j, 0, 30) {
            if (X[j] == 0 && ((A[i] >> j) & 1)) {
                is_ok = false;
                break;
            }
        }
        if (is_ok) ans += B[i];
    }
    rep(i, 0, 30) {
        if (X[i] == 0) continue;
        bitset<30> now_k(X);
        rep(j, 0, i) now_k[j] = 1;
        now_k[i] = 0;
        ll now_ans = 0;
        rep(j, 0, N) {
            bool is_ok = true;
            rep(k, 0, 30) {
                if (now_k[k] == 0 && ((A[j] >> k) & 1)) {
                    is_ok = false;
                    break;
                }
            }
            if (is_ok) now_ans += B[j];
        }
        ans = max(ans, now_ans);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1920
#include "bits/stdc++.h"
typedef long long ll;
using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    if (13 <= a) {
        cout << b << endl;
    } else if (a <= 5){
        cout << 0 << endl;
    } else {
        cout << b / 2 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	int tmp = a%b;
	while (tmp != 0)
	{
		a = b;
		b = tmp;
		tmp = a%b;
	}
	cout << b << endl;
	return 0;
}


Measured memory_bytes: 3072
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
using namespace std;
typedef long long int ll;

#define MOD 998244353


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

bool primeNumber(ll n){
    if(n < 2) return false;
    else{
        for(ll i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
  
  

int main(){
    ll h,n;
    cin>>h>>n;
    vector<ll> a(n);
    for(ll i = 0; i<n; i++){
        cin>>a[i];
    }
    ll total = 0;
    for(ll i = 0; i<n; i++){
        total += a[i];
    }
    if(total < h)puts("No");
    else puts("Yes");
    return 0;
}



Measured memory_bytes: 1024
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	int N, M;
	std::vector<std::string> S, T;
	std::cin >> N;
	S.resize(N);
	for (auto& s : S) {
		std::cin >> s;
	}
	std::cin >> M;
	T.resize(M);
	for (auto& t : T) {
		std::cin >> t;
	}
	
	std::map<std::string, int> V;
	for (const auto& s : S) {
		++V[s];
	}
	for (const auto& t : T) {
		--V[t];
	}
	int result = 0;
	for (const auto& v : V) {
		result = std::max(result, v.second);
	}
	std::cout << result << "\n";
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if (1 <= a && a <= 9 && 1 <= b && b <= 9) {
    cout << a * b << endl;
  } else {
    cout << -1 << endl;
  }
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))

    for _ in range(min(100,K)):
        B = [0] * (N + 1)
        for i,a in enumerate(A):
            B[max(i - a,0)] += 1
            B[min(i + a + 1,N)] -= 1
        for i in range(N):
            B[i + 1] += B[i]
        A = B
    print(' '.join(map(str,A[:-1])))            
if __name__ == '__main__':
    main()

Measured memory_bytes: 222908
#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() {
  string a,b;
  cin >> a >> b;

  int ans = 0;
  REP(i,(int)a.size()){
	if(a[i] != b[i]) ans++;
  }
  
  cout << ans << endl;
      

}

Measured memory_bytes: 3920
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<sstream>
#include<algorithm>
#include<stack>
#include<bitset>
#include<map>
#include<set>
#define rep(i,n) for(int i=0;(i)<(n);i++)
#define rep1(i,n) for(int i=1;(i)<=(n);i++)
#define mst(a,b) memset(a,b,sizeof(a))
#define scd(a) scanf("%d",&a)
#define scdd(a,b) scanf("%d%d",&a,&b)
#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define dbg(a) cout<<"* "<< #a <<" : "<<a<<endl
#define fr first
#define se second
#define ls x<<1
#define rs x<<1|1
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define lowbit(x) x&(-x)
#define ac cout<<ans<<endl
//#define DEBUG 0
using namespace std;
const double pi=acos(-1.0);
const double eps=1e-6;
const ull hashp=1e7+19;
const ll INF=0x3f3f3f3f3f3f3f3fll;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int maxn=3e5+100;
bool dp[85][85][26000];
int g[100][100];
void solve(){
	int h,w;
	scdd(h,w);
	rep1(i,h)
		rep1(j,w){
			scd(g[i][j]);
		}
	rep1(i,h)
		rep1(j,w){
			int x;
			scd(x);
			g[i][j]=abs(g[i][j]-x);
		}
	dp[1][1][12800-g[1][1]]=dp[1][1][12800+g[1][1]]=1;
	rep1(i,h)
		rep1(j,w){
			if(i>1){
				rep(l,25601){
					if(dp[i-1][j][l]){
						if(l+g[i][j]<25601)dp[i][j][l+g[i][j]]=1;
						if(l-g[i][j]>=0)dp[i][j][l-g[i][j]]=1;
					}
				}
			}
			if(j>1){
				rep(l,25601){
					if(dp[i][j-1][l]){
						if(l+g[i][j]<25601)dp[i][j][l+g[i][j]]=1;
						if(l-g[i][j]>=0)dp[i][j][l-g[i][j]]=1;
					}
				}
			}
		}
	int num=inf,ans;
	rep(i,25601)if(dp[h][w][i]&&num>abs(12800-i))num=abs(12800-i),ans=abs(i-12800);ac;
}
int main(){
    //IOS;
    //freopen("D://data.txt","r",stdin);
    solve();
    return 0;
}

Measured memory_bytes: 174336
//0515-School Road
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	while(1){
		cin>>a>>b;
		if(a==0)	return 0;
		int n,x,y;	cin>>n;
		int dp[a][b];
		memset(dp,-1,sizeof(dp));
		for(int i=0;i<n;i++){
			cin>>x>>y;
			dp[x-1][y-1]=0;
		}
		dp[0][0]=1;
		for(int i=1;i<a;i++){
			if(dp[i][0]!=0)	dp[i][0]=dp[i-1][0];
		}
		for(int i=1;i<b;i++){
			if(dp[0][i]!=0)	dp[0][i]=dp[0][i-1];
		}
		for(int i=1;i<a;i++){
			for(int j=1;j<b;j++){
				if(dp[i][j]!=0)	dp[i][j]=dp[i-1][j]+dp[i][j-1];
			}
		}
		cout<<dp[a-1][b-1]<<endl;
	}
}

Measured memory_bytes: 1168
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <vector>
#define pb push_back
#define ms(a) memset(a,0,sizeof(a))
#define ll long long
#define ull unsigned ll
using namespace std;
#define MAXN 60

ll data[MAXN];
int n;

ll maxnum , maxpos;
void getmax(){
	maxnum = -1;
	for( int i = 1 ; i <= n ; i++ )
		if( data[i] > maxnum ){
			maxnum = data[i];
			maxpos = i;
		}
}

int main(){
	//freopen("E.txt","r",stdin);
	
	scanf("%d",&n);
	for( int i = 1 ; i <= n ; i++ )
		scanf("%lld",&data[i]);
	
	ll ans = 0;
	getmax();
	while( maxnum >= n ){
		ll huan = (maxnum-(n-1)) % n;
		ll dec = (maxnum-(n-1)) / n;
		//cout << "[] " << huan << " " << dec << endl;
		if( huan ){
			dec++;
		}
		ans += dec;
		for( int i = 1 ; i <= n ; i++ ){
			if( i == maxpos )
				data[i] -= dec*n;
			else
				data[i] += dec;
		}
		//for( int i = 1 ; i <= n ; i++ )
		//	cout << data[i] << " ";
		//cout << endl;
		//for( ll i = 1 ; i <= 100000000;i++);
		getmax();
	}
	printf("%lld\n",ans);
	return 0;
};

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

int main(){
	int n, aa, bb;
	vector<pair<int, int> > v;
	while(1){
		aa = 0;
		bb = 0;
		scanf("%d", &n);
		if(n == 0){
			break;
		}
		int a, b;
		for(int i = 0; i < n; i++){
			scanf("%d %d", &a, &b);
			if(a > b){
				aa += a + b;
			}else if(b > a){
				bb += a + b;
			}else{
				aa += a;
				bb += b;
			}
		}
		v.push_back(make_pair(aa, bb));
	}
	for(int i = 0; i < v.size(); i++){
		printf("%d", v[i].first);
		printf(" ");
		printf("%d\n", v[i].second);
	}
	return 0;
}

Measured memory_bytes: 2588
#include<iostream>
#include<string>
#include<cstdlib>
#define DIGIT 80
using namespace std;

class largenum{
  int nums[DIGIT];
  bool overflow;
  int most;
public:
  largenum(){
    overflow=false;
    most=DIGIT-1;
    for(int i=0;i<DIGIT;i++)
      nums[i]=0;
  }
  bool isoverflow(){ return overflow;}
  friend ostream& operator<<(ostream &out,largenum &l);
  friend istream& operator>>(istream &is,largenum &l);
  friend largenum operator+(largenum l1,largenum l2);
};

largenum operator+(largenum l1,largenum l2){
  bool carry=false;
  largenum ans;
  for(int i=DIGIT-1;i>=0;i--){
    int tmp=l1.nums[i]+l2.nums[i]+carry;
    carry=bool((tmp)/10);
    ans.nums[i]=(tmp)%10;
  }
  for(int i=0;i<DIGIT;i++){
    if(ans.nums[i]!=0){
      ans.most=i;
      break;
    }
  }  
  ans.overflow=carry;
  return ans;
}

ostream& operator<<(ostream &out,largenum &l){
  for(int i=l.most;i<DIGIT;i++){
    out<<l.nums[i];
  }
  return out;
}

istream& operator>>(istream &is,largenum &l){
  string str;
  is>>str;
  if(str.size()>DIGIT){
    l.overflow=true;
  }else{
    for(int i=0;i<(int)str.size();i++){
      int index = DIGIT-str.size()+i;
      switch(str[i]){
      case '0':
	l.nums[index]=0;
	break;
      case '1':
	l.nums[index]=1;
	break;
      case '2':
	l.nums[index]=2;
	break;
      case '3':
	l.nums[index]=3;
	break;
      case '4':
	l.nums[index]=4;
	break;
      case '5':
	l.nums[index]=5;
	break;
      case '6':
	l.nums[index]=6;
	break;
      case '7':
	l.nums[index]=7;
	break;
      case '8':
	l.nums[index]=8;
	break;
      case '9':
	l.nums[index]=9;
	break;
      }
    }
    
    l.most=DIGIT-str.size();
  }
  return is;
}

int main(){
  int num;
  cin>>num;
  while(num--){
    largenum a,b;
    cin>>a>>b;
    if(a.isoverflow() || b.isoverflow()){
      cout<<"overflow"<<endl;
      continue;
    }
    a = a+b;
    if(a.isoverflow()){
      cout<<"overflow"<<endl;
    }else{
      cout<<a<<endl;
    }
  }
  return 0;
}

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

int main(){
	int n;
	std::cin >> n;
	std::vector<int> l(n);
	for(int i=0; i<n; i++){
		std::cin >> l[i];
	}
	std::sort(l.begin(), l.end());
	long long count = 0;
	for(int ia=n-1; ia>=2; ia--){
		for(int ib=ia-1; ib>=1; ib--){
			if(l[ia] > l[ib]*2) break;
			for(int ic=ib-1; ic>=0; ic--){
				if(l[ia] < l[ib] + l[ic]){
					count++;
				}else{
					break;
				}
			}
		}
	}
	std::cout << count << std::endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair

#define REP(i, n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,h) for(int i=(int)(l);i<=(int)(h);++i)
#define FORD(i,h,l) for(int i=(int)(h);i>=(int)(l);--i)

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

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

#define dump(x)  cerr << #x << " = " << (x) << endl
#define ALL(t) (t).begin(),(t).end()

using namespace std;

/*
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;cin>>n>>m;
    if(n > m){
        cout<<"No\n";
    }
    else{
        cout<<"Yes\n";
    }
    return 0;
}
*/
/*
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;cin>>n>>m;
    if(n > m){
        for (size_t i = 0; i < n; i++) {
            cout<<m;
        }
    }
    else{
        for (size_t i = 0; i < m; i++) {
            cout<<n;
        }
    }
    return 0;
}
*/

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;cin>>n;
    std::vector<int> v(n);
    REP(i,n)cin>>v[i];
    ll int cnt = 0 , mn = v[0];
    for (size_t i = 1; i < n; i++) {
        mn = min(mn , v[i]);
        if(mn < v[i]){
            cnt++;
        }
    }
    cout<<(n - cnt);
    return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string>
#include <tuple>
#include <random>
#include <map>
#include <queue>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <cmath>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

const double eps = 1e-6;
const ll MOD = 1000000007;
const ll INF = 1e15;


int main() {
	string s;
	cin >> s;
	ll K;
	cin >> K;
	set<string> sts;
	string now;
	for (int len = 1;len <= K;len++) {
		now = "a" + s.substr(0, len - 1);
		for (int i = 0;i + len <= s.size();i++) {
			now.erase(now.begin());
			now.push_back(s[i + len - 1]);
			sts.insert(now);
		}
	}
	auto ans = sts.begin();
	for (int i = 1;i < K;i++)
		ans++;
	cout << *ans << endl;
	return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <cmath>
using namespace std;
int main(){
  int a[5], ans=0, res=0;
  for(int i=0; i<5; i++){
  cin >> a[i];
  ans+=10*ceil(a[i]/10.0);
  if(res<10*ceil(a[i]/10.0)-a[i])
    res=10*ceil(a[i]/10.0)-a[i];
  
  }
  cout << ans-res;
  return 0;
}


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

using lint = long long;
using ldouble = long double;

void solve() {
    int a, b, c, d, p;
    std::cin >> a >> b >> c >> d >> p;
    std::cout << std::min(a * p, b + std::max(0, p - c) * d)
              << std::endl;
}

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

    solve();

    return 0;
}



Measured memory_bytes: 3116
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
      int n=sc.nextInt();
      int ap=0;
      int bp=0;
      for(int i=0; i<n; i++){
    	  String a=sc.next();
    	  String b=sc.next();
    	  if(a.compareTo(b)>0){
    		  ap+=3;
    	  }else if(a.compareTo(b)==0){
    		  ap++;
    		  bp++;
    	  }else{
    		  bp+=3;
    	  }
      }
      System.out.println(ap+" "+bp);

    }
}


Measured memory_bytes: 30252
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int main() {
    int r; cin >> r;
    cout << r*r << endl; 
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long INF = 1e9;
long n ;
long k;
long ans=INF; 
long dp[100009];
vector<int>v;
long dfs(long long i){
    
    if(i >= n)return INF;
    if(i == n-1) return 0;
    
    if(dp[i] != -1)return dp[i];
    long ans=INF; 
    for(long j=1;j<=k;j++){
    if(j == n)break;
     ans = min(ans,abs(v[i]-v[i+j]) + dfs(i+j));
        
    }
    dp[i] = ans;
    
    return ans;
}
int main(){
    cin>>n>>k;
    v.resize(n+2);
    for(int i=0;i<n;i++)
        cin>>v[i];
    
  
    memset(dp,-1,sizeof dp);
 
    cout<<dfs(0)<<endl;
    return 0;
}


Measured memory_bytes: 7680
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

const (
	non = ":("
	ok  = "Yay!"
)

func calcDistance(a, b, c, d, e, k int) string {
	antennas := []int{a, b, c, d, e}
	n := 5

	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			p := antennas[i]
			q := antennas[j]
			if k < q-p {
				return non
			}
		}
	}
	return ok
}
func main() {
	a, b, c, d, e, k := nextInt(), nextInt(), nextInt(), nextInt(), nextInt(), nextInt()
	r := calcDistance(a, b, c, d, e, k)
	fmt.Println(r)
}


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

int main(){
    while(true){
        int a,b;
        string op;
        cin >> a >> op >> b;
        if (op == "+") cout << a+b << "\n";
        else if(op == "-") cout << a-b << "\n";
        else if(op == "*") cout << a*b << "\n";
        else if(op == "/") cout << a/b << "\n";
        else break;
    }
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e16+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    double N,K;
    cin >> N >> K;
    double cnt = 0;
    for(double i = 1; i <= N; i++) {
        double res = 1;
        double X = i;
        while(X < K) {
            X*=2;
            res/=2;
        }
        cnt+=res;
    }
    cout << fixed << setprecision(20) << cnt/N << endl;
}

Measured memory_bytes: 3732
#include<bits/stdc++.h>
#define int long long
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
 
int b[200001], a[200001];
signed main() {
	int n, q, s, t; scanf("%lld%lld%lld%lld", &n, &q, &s, &t);
	rep(i, n + 1) {
		scanf("%lld", &b[i]);
		if (i)a[i] = b[i] - b[i - 1];
	}
	int x = 0;
	for (int i = 1; i <= n; i++) {
		if (a[i] >= 0)x -= a[i] * s;
		else x -= a[i] * t;
	}
	rep(i, q) {
		int l, r, y; scanf("%lld%lld%lld", &l, &r, &y);
		if (a[l] >= 0)x += a[l] * s;
		else x += a[l] * t;
		a[l] += y;
		if (a[l] >= 0)x -= a[l] * s;
		else x -= a[l] * t;
		if (r < n) {
			if (a[r + 1] >= 0)x += a[r + 1] * s;
			else x += a[r + 1] * t;
			a[r + 1] -= y;
			if (a[r + 1] >= 0)x -= a[r + 1] * s;
			else x -= a[r + 1] * t;
		}
		printf("%lld\n", x);
	}
}

Measured memory_bytes: 6348
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=1000005;
#define M 1000000007
#define double long double
#define BINF 1000000000000001
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 15000001
const int LG = 22;

int a[N];

#undef int 
int main() { 
#define int long long int 
 
ios_base::sync_with_stdio(false); 
cin.tie(0); 
cout.tie(0); 

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

	for(int i = 2; i < n; i++){
		int x = a[i];
		vector<int>v;
		v.pb(a[i]),v.pb(a[i - 1]), v.pb(a[i + 1]);
		sort(v.begin(),v.end());
		if(x == v[1]) c++;
	}
	cout << c;
		
	

	
	

	
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <numeric>
#include <string>
#include <cassert>

using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;
  vector<string> v(N);
  for (int i = 0; i < N; ++i) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    v[i] = s;
  }
  sort(v.begin(), v.end());

  ll ans = 0;
  string cur = v[0];
  ll cnt = 1;
  for (int i = 1; i < N; ++i) {
    if (v[i] == cur) {
      ++cnt;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cur = v[i];
      cnt = 1;
    }
  }
  ans += cnt * (cnt - 1) / 2;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	char x;
	cin>>x;
	if(x=='a'||x=='e'||x=='i'||x=='o'||x=='u')
	cout<<"vowel"<<endl;
	else cout<<"consonant"<<endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using static System.Console;
using System.Linq;

namespace AC
{
   public class shiokara
   {
      static void Main(string[] args)
      {
          long x = long.Parse(ReadLine());
          long happy = (x / 500) * 1000;
          x -= (happy / 1000) * 500;
          happy += (x / 5) * 5;
          WriteLine(happy);
      }
   }
}

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

int main() {
	int n, sum = 0;
	vector<int> a;
	cin >> n;
	rep(i, n + 2) {
		int ai;
		if (i == 0) a.push_back(0);
		else if (i == n + 1) a.push_back(0);
		else {
			cin >> ai;
			a.push_back(ai);
		}
		if (i != 0) sum += abs(a[i] - a[i - 1]);
	}
	int tmp = sum;
	rep(i, n + 2) {
		sum = tmp;
		if (i != 0 && i != n + 1) {
			sum -= abs(a[i + 1] - a[i]) + abs(a[i] - a[i - 1]) - abs(a[i + 1] - a[i - 1]);
			cout << sum << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3852
#include <stdio.h>

int main(void) {
	int m,nmin,nmax,sc[256],i,k,a,maxg,maxp;
	while(scanf("%d%d%d",&m,&nmin,&nmax) , m != 0){
		maxg = 0;
		maxp = 0;
		for(i = 0;i <= 255;i++){
			sc[i] = 0;
		}
		for(i = 1;i <= m;i++){
			scanf("%d",&k);
			sc[i] = k;
		}
		for(i = nmin;i <= nmax;i++){
			a = sc[i] - sc[i+1];
			if(maxg<=a){
				maxg = a;
				maxp = i;
			}
		}
		printf("%d\n",maxp);
	}
	return 0;
}

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

void solve() {
  string s;
  cin >> s;
  map<char, int> mp;
  rep(i,s.size()) {
    if (mp[s[i]]) {
      cout << "no" << endl;
      return;
    }
    mp[s[i]]++;
  }
  cout << "yes" << endl;
}

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

Measured memory_bytes: 3564
a,b,c=map(int,input().split())
if a%2==0 or b%2==0 or c%2==0:
    print(0)
else:
    if a==1 or b==1 or c==1:
        print(a*b*c)
    else:
        l=[a*b,b*c,c*a]
        print(min(l))
        

Measured memory_bytes: 38508
#include<iostream>
#include<functional>
#include<utility>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;
const auto MOD = 1000000007;
const int INF = 1e9;
const long long LINF = 1e18;
#define rep(i,n) for(int i = 0; i < (n);i++)
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef vector<int> VI;
typedef vector<long long> VLL;


int n, m;
string s;

int main() {
	cin >> n;
	VI p(n);
	for (int i = 0; i < n; i++)
	{
		cin >> p[i];
	}
	sort(p.begin(), p.end());
	cout << p[n / 2] - p[n / 2 - 1] << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

#define Int long long
#define pb push_back

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> 

Int N,M,K;
Int X,Y,Z,D;

Int B,C;

const long MOD=(long)(1e9+7);
const int MAXN=500005;


vector<Int> adj[MAXN];
vector<Int> degree;
bool VIS[MAXN];     

Int mul(Int x,Int y){
    return ((x%MOD)*(y%MOD))%MOD;
}


long long ModExpo(long long x,unsigned long long y,long long M){
    Int ans=1;
    ans=(long long)ans;
    
    while(y>0){
        if(y&1) ans=((ans%M)*(x%M))%M;
        y>>=1LL;
        x=((x%M)*(x%M))%M;
    }
    return ans%M;
}

long long ModInv(long long n){
    return ModExpo(n,MOD-2,MOD);
}

int main()
{
       cin>>N;
       vector<Int> A(N);
       for(auto &x:A) cin>>x;
       
       Int sum=0;
       
       for(int i=0;i<N;++i) sum=(sum%MOD + A[i]%MOD)%MOD;
       sum=mul(sum,sum);
       Int removeSum=0;
       for(int i=0;i<N;++i) removeSum=(removeSum%MOD+mul(A[i],A[i]))%MOD;
       
       
       sum=(sum-removeSum+MOD)%MOD;
     
       
       Int ans=(sum*ModInv(2LL))%MOD;
       cout<<ans<<"\n";
}

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

int main(){
char X='A';
string s;
while(cin>>s){
for(int i=0;i<1;i++){
if(s[0]==X){X=s[2]; break;}
if(s[2]==X)X=s[0];}}
cout<<X<<endl;}

Measured memory_bytes: 1172
package main

import "fmt"

func main() {
	var n, k int
	var s string
	fmt.Scan(&n, &k, &s)

	cnt := 0
	for i := 1; i < n; i++ {
		if s[i-1] == s[i] {
			cnt++
		}
	}

	ans := min(n-1, cnt+2*k)
	fmt.Println(ans)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


Measured memory_bytes: 1280