akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define tezi ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
typedef long long ll;

int main(){
    tezi;
    int h1, m1, h2 , m2, k, d = 0;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int k1 = h1 * 60 + m1, k2 = h2 * 60 + m2;
    if(k1 > k2) d = abs(k1 - 24 * 60) + k2;
    else d = k2 - k1;
    cout << d - k << "\n";
    return 0;
}


Measured memory_bytes: 3640
# D - Binomial Coefficients

import sys
readline = sys.stdin.readline

n = int(readline())
A = list(int(a) for a in readline().split())
A.sort(reverse=True)

N = A[0]
R = 0
tmpR = 0
for i in range(1, n):
    tmp = min(A[i], N-A[i])
    if tmpR < tmp:
        tmpR = tmp
        R = A[i]       

print(N, R)

Measured memory_bytes: 14008
#include <bits/stdc++.h> 
#define rep(i,n) for(int i=0; i<(n); ++i)
#define cout(x) cout<<x<<endl
#define all(v) v.begin(), v.end()
using namespace std;
//型エイリアス
using vi = vector<int>;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const ll inf = 1e18;
const int N = 2e5 + 10;

ll num_digit(ll x){
    ll num_dig = 0;
    while(x!=0){
        x /= 10;
        num_dig += 1; 
    }
    return num_dig;
}

ll F(ll a, ll b){
    return max(num_digit(a),num_digit(b));
}

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

    ll ans = 1e18;
    for(ll a=1; a<=sqrt(n); ++a){
        if(n%a==0){
            ll b = n/a;
            ll min_dig = F(a,b);
            if(ans>min_dig) ans = min_dig;
        }
    }
    cout(ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main()
{
    int a[6]={},f=-1,g=0,h=0,j=0;
    for (int i=0; i<5; i++)
    {
        cin>>a[i];
        if (10-a[i]%10 > f && 10-a[i]%10 != 10)
        {
            f=10-a[i]%10;
            j=a[i];
        }
    }
    for (int i=0; i<5; i++)
    {
        if (a[i]==j)
        {
            a[i]=0;
            break;
        }
    }
    for (int i=0; i<5; i++)
    {
       if (10-a[i]%10 != 10 && a[i]!=0)
        {
            g=g+10-a[i]%10;
        }
    }
    for (int i=0; i<5; i++)
    {
        h=h+a[i];
    }
    cout<<h+g+j;
    
    return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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

ll mp[222222];

set<pair<ll,ll>> s;
vector<pair<ll,ll>> v;


int main(){
	
	ll h,w,n;cin >> h >> w >> n;
	REP(i,n){
		ll a,b;cin >> a >> b;
		v.PB(MP(a,b));
		s.insert(MP(a, b));
	}
	
	mp[1] = 1;
	ll tmp = 1;
	for(ll i = 2;i < 222222;i++) {
		tmp++;
		for(ll j = tmp;j < 222222;j++){
			if(s.count(MP(j,i))){
				tmp = j + 1;
			}
			else {
				break;
			}
		}
		mp[i] = tmp;
	}
	
	SHOW1d(mp,11);
	
	ll ans = h;
	REP(i,n){
		if(v[i].FI > mp[v[i].SE]){
			ans = min(ans, v[i].FI - 1);
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 18284
n, a, b = map(int, input().split())
pre_h = [int(input()) for _ in range(n)]

def check(cnt):
	h = [0] * n
	for i in range(n):
		if pre_h[i] - b * cnt > 0:
			h[i] = pre_h[i] - b * cnt
		else:
			h[i] = 0

	if sum([(i - 1) // (a - b) + 1 for i in h]) <= cnt:
		return True
	else:
		return False

minimum = 1
maximum = (max(pre_h) - 1) // b + 1

while maximum - minimum > 1:
	if check(minimum + (maximum - minimum) // 2):
		maximum = minimum + (maximum - minimum) // 2
	else:
		minimum = minimum + (maximum - minimum) // 2

print(maximum)

Measured memory_bytes: 15032
N = int(input())
A = [int(i) for i in input().split()]
B = [A[0]]
for i in range(1, N) :
  if A[i] != B[-1] :
    B.append(A[i])

N = len(B)

ret = 1
i = 2
while i < N :
  if (B[i] - B[i-1]) * (B[i-1] - B[i-2]) < 0 :
    ret += 1
    i += 1
  i += 1

print(ret)

Measured memory_bytes: 63724
#include<iostream>
#include<string>

using namespace std;


int main() {
	string a;
	int flag = 1;
	cin >> a;
	if (a.length() % 2 == 1) {
		cout << "No";
		return 0;
	}
	else {
		for (int i = 0; i < a.length() - 1; i+= 2) {
			if (!(i % 2 == 0 && a[i] == 'h' && a[i + 1] == 'i'))
				flag = 0;
		}
	}
	if (flag)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}

Measured memory_bytes: 256
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

A, B, C = LI()

if A==B==C:
    print("Yes")
else:
    print("No")


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
template<class T>bool chmin(T&a,const T&b){return a>b?(a=b,true):false;}
template<class T>bool chmax(T&a,const T&b){return a<b?(a=b,true):false;}

int nextInt() {
  int x; cin >> x; return x;
}

const int MAX_N = 100000 + 10;
int a[MAX_N];
int N;

bool f(int N, int M) {
  if (N <= 0 || M <= 0) return false;
  if (M == 1) return true;
  if (M == N - 1) return true;
  if (N >= 2 * M) 
    return true;
  else
    return false;
}

bool f2(int N, int M, int C) {
  if (N <= 0 || M <= 0 || C <= 0) return false;
  if (N == 1) {
    return C == 1;
  }
  if (N == 2) {
    return M == 1 && (C == 1 || C == 2);
  }
  if (N >= 3) {
    if (M == 1) return C == 1;
    if (M == N - 1) return C == N;
    if (N >= 2 * M) 
      return M == C;
    else
      return false;
  }
  return false;
}

bool solve() {
  if (a[N-1] - a[0] >= 2) return false;
  if (a[0] == a[N-1]) {
    return f(N,  a[0]);
  } else {
    int m = 0;
    REP(i, N) {
      if (a[0] == a[i]) m++;
    }
    return f(N-m, 1+a[0]-m) && f2(N-m, 1+a[0]-m, 1+a[0]-m);
  }
}

int main2() {
  N = nextInt();
  REP(i, N) a[i] = nextInt();
  sort(a, a + N);

  bool res = solve();
  cout << (res ? "Yes":"No") << endl;

  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws) main2();
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <sstream>
#include <iomanip>

using namespace std;
using std::swap;

// priceをキーに降順でソート
//sort(fruits.begin(), fruits.end(),
//     [](const fruit& x, const fruit& y) { return x.price > y.price;});


long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
};

int main() {
    string s;
    std::cin >> s;
    int N =s.length();
    long int q=pow(10, 9)+7;
    long int table[N][13];
    for(int i=0; i<N; i++){
        for(int j=0; j<13; j++){
            table[i][j]=0;
        }
    }
    if(s[N-1]=='?'){
        for(int j=0; j<10; j++){
            table[0][j]=1;
        }
    }

    else{
        table[0][int(s[N-1])-48]=1;
    }
    for(int i=1; i<N; i++){
        if(s[N-1-i]=='?'){
            for(int j=0; j<13; j++){
                for(int t=0; t<10; t++) {
                    table[i][(t * modpow(10, i, 13) + j) % 13] += table[i - 1][j];
                    table[i][(t * modpow(10, i, 13) + j) % 13] %= q;
                }
            }
        }
        else{
            for(int j=0; j<13; j++){
                table[i][((int(s[N-1-i])-48) * modpow(10, i, 13) + j) % 13] += table[i - 1][j];
                table[i][((int(s[N-1-i])-48) * modpow(10, i, 13) + j) % 13] %= q;
            }
        }
    }
    int A=0;

    std::cout << table[N-1][5] << std::endl;
    return 0;
}



Measured memory_bytes: 10624
#include <stdio.h>
long long a [100010];
int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%lld",&a[i]);
int zero =0;

for(int i=0;i<n;i++)if(a[i]==0) zero ++;
if(zero >0){
// a[i] contains 0
printf("0\n");
return 0;
}
long long prod =1;
for(int i=0;i<n;i++){
if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
prod *=a[i];
}else{
printf("-1\n");
return 0;
}
}
printf("%lld\n",prod );
}

Measured memory_bytes: 2464
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int N = input.nextInt();
		int M = input.nextInt();
		int cnt = 0;
		System.out.println(N*(N-1)/2+M*(M-1)/2);
	}
}

Measured memory_bytes: 27076
N, A, B, C, D = map(int,input().split())
 
Px = N // A
Py = N // C
if Px * A >= N:
    pass
else:
    Px = Px + 1

if Py * C >= N:
    pass
else:
    Py = Py + 1

Vx = Px * B
Vy = Py * D
if Vx >= Vy:
    print(Vy)
else :
    print(Vx)


Measured memory_bytes: 5596
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {
    n:i64,m:i64,k:i64,
     }
    let mut md = ModComb::new(MX, MOD);
    let mut xsum = 0;
    let mut ysum = 0;
    for i in 0..m {
        xsum += i * (m - i) * n * n;
    }
    xsum %= MOD;
    xsum *= md.comb(n * m - 2, k - 2);
    for i in 0..n {
        ysum += i * (n - i) * m * m;
    }
    ysum %= MOD;
    ysum *= md.comb(n * m - 2, k - 2);
    println!("{}", (xsum + ysum) % MOD);
}
const MOD: i64 = 1000000007;
const MX: usize = 210101;
pub fn mod_pow(x: i64, n: i64, m: i64) -> i64 {
    let mut res = 1;
    let mut x = x % m;
    let mut n = n;
    while n > 0 {
        if n & 1 == 1 {
            res = (res * x) % m;
        }
        x = (x * x) % m;
        n >>= 1;
    }
    res
}
struct ModComb {
    fact: Vec<i64>,
    fact_inv: Vec<i64>,
    n: usize,
    p: i64,
}
impl ModComb {
    fn initialize(&mut self) {
        let n = self.n;
        self.fact[0] = 1;
        for i in 1..n {
            self.fact[i] = (self.fact[i - 1] * i as i64) % self.p;
        }
        self.fact_inv[n - 1] = mod_pow(self.fact[n - 1], self.p - 2, self.p);
        for i in (0..n - 1).rev() {
            self.fact_inv[i] = (self.fact_inv[i + 1] * (i + 1) as i64) % self.p;
        }
    }
    fn new(max_n: usize, p: i64) -> ModComb {
        let mut ft = ModComb {
            fact: vec![0; max_n + 1],
            fact_inv: vec![0; max_n + 1],
            n: max_n + 1,
            p: p,
        };
        ModComb::initialize(&mut ft);
        ft
    }
    fn fact(&self, n: usize) -> i64 {
        self.fact[n]
    }
    fn comb(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        (self.perm(n, k) * self.fact_inv[k as usize]) % self.p
    }
    fn perm(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        self.fact[n as usize] * self.fact_inv[(n - k) as usize] % self.p
    }
    fn nsk(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        let mut res = 0;
        for i in 0..k + 1 {
            let v = self.comb(k, i) * mod_pow(i, n, self.p) % self.p;
            if (k - i) % 2 == 1 {
                res = (res + self.p - v) % self.p;
            } else {
                res = (res + v) % self.p;
            }
        }
        return res * self.fact_inv[k as usize] % self.p;
    }
}


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

typedef long long ll;

int main(){
    ll N;
    cin >> N;
    vector<string> S(N);
    for(ll i=0; i<N; i++) cin >> S[i];
    
    ll m[5]={0};
    
    string s;
    s = "MARCH";
    for(int i=0; i<N; i++){
        for(int j=0; j<5; j++){
            if(S[i][0]==s[j]){
                m[j]++;
            }
        }
    }
    
    ll sum=0;
    sum += m[0]*m[1]*m[2];
    sum += m[0]*m[1]*m[3];
    sum += m[0]*m[1]*m[4];
    sum += m[0]*m[2]*m[3];
    sum += m[0]*m[2]*m[4];
    sum += m[0]*m[3]*m[4];
    sum += m[1]*m[2]*m[3];
    sum += m[1]*m[2]*m[4];
    sum += m[1]*m[3]*m[4];
    sum += m[2]*m[3]*m[4];
    
    cout << sum << endl;
}



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


#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

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

  int a;
  list<int> score;
  for(int i=0;i<n;i++){
    cin >> a;
    score.push_back(a);
    if(score.size() == k+1){
      int prevA = score.front();
      if(prevA<a) cout << "Yes" << endl;
      else cout << "No" << endl;
      score.pop_front();
    }
  }

  return 0;
}



Measured memory_bytes: 9976
#include<stdio.h>
#define N 100001
int depth(int);
struct Node{
  int p;
  int l;
  int r;
};
struct Node Tree[N];
 
 
int main()
{
 
  int i,j,n,par,child,sib,k,x;
 
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    Tree[i].p = -1;
    Tree[i].l = -1;
    Tree[i].r = -1;
  }
 
  for(i = 0; i < n; i++){
    scanf("%d %d",&par,&k);
    for(j = 0; j < k; j++){
      scanf("%d",&child);
      if(j == 0){
	Tree[par].l = child;
	Tree[child].p = par;
	x = child;
      }
      else {
	Tree[x].r = child;
	Tree[child].p= par;
	x = child;
      }
    }
  }
 
  for(i = 0; i < n; i++){
    printf("node %d: parent = %d, depth = %d, ",i , Tree[i].p,depth(i));
    if(Tree[i].l  == -1 && Tree[i].p != -1)printf("leaf, ");
    else if(Tree[i].p == -1)printf("root, ");
    else if(Tree[i].l != -1)printf("internal node, ");
    printf("[");
 
    if(Tree[i].l != -1){
      printf("%d",Tree[i].l);
 
      sib = Tree[i].l;
 
      while(1){
	if(Tree[sib].r == -1)break;
	printf(", %d",Tree[sib].r);
	sib = Tree[sib].r;
      }
    }
    printf("]\n");
  }
 
  return 0;
}
 
int depth(int k){
  int dep =0;
  for(dep = 0; Tree[k].p != -1; dep++){
    k = Tree[k].p;
  }
  return dep;
}

Measured memory_bytes: 1788
#include<vector>
#include<map>
#include<climits>
#include<set>
#include<queue>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<bitset>
#include<cstring>
#include<list>
using namespace std;
typedef vector<int>VI;
typedef vector<VI>VVI;
typedef vector<string>VS;
typedef pair<int,int>PII;
typedef long long LL;
typedef pair<LL,LL>PLL;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define PB push_back
#define EACH(i,c) for(typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define F first
#define S second

int main(){
    int N,T;scanf("%d%d",&N,&T);
    char str[100];
    int t,m;
    scanf("%d:%d%s",&t,&m,str);
    vector<pair<string,int> >V;
    REP(i,N-1){
        scanf("%d:%d%s",&t,&m,str);
        int val=t*60+m;
        scanf("%d:%d%s",&t,&m,str);
        int v2=t*60+m;
        v2-=val;
        string s=str;
        if(v2>=T)V.PB(pair<string,int>(s,v2));

    }
    cout<<V.size()<<endl;
    REP(i,V.size()){
        cout<<V[i].first<<" "<<V[i].second<<endl;
    }
    return 0;

}

Measured memory_bytes: 1232
n,k = map(int, input().split())
a = list(map(int, input().split()))
r = [0 for _ in range(n)]
for i in a:
    r[i-1] += 1
t = []
for i in r:
    if i:
        t.append(i)
t.sort()
print(sum(t[:len(t)-k]))

Measured memory_bytes: 32292
#include<iostream>
using namespace std;
int main(){
  char c[3][3];
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      cin>>c[i][j];
    }
  }
  cout<<c[0][0]<<c[1][1]<<c[2][2]<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<long>x(n);
  vector<long>l(n);
  int i;
  for(i=0;i<n;i++){
    cin >> x[i] >> l[i];
  }
  vector<pair<long,long> >p(n);
  for(i=0;i<n;i++){
    p[i] = make_pair(x[i]+l[i],x[i]-l[i]);
  }
  sort(p.begin(),p.end());
  long tmp = -9999999999;
  i = 0;
  int cnt = 0;
  while(i<n){
    if(p[i].second>=tmp){
      tmp = p[i].first;
      cnt++;
    }
    i++;
  }
  cout << cnt << endl;

}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD			1000000007
#define FOR(i,l,r)	for(int i=l;i<=r;i++)
#define REP(i,n)	for(int i=1;i<=n;i++)
#define REP0(i,n)	for(int i=0;i<n;i++)
#define PB			push_back
#define MP			make_pair
#define PII			pair<int,int>
#define VI			vector<int>
#define ALL(x)		(x).begin(),(x).end()
string s,t,u;
int nxt[200005][26],last[26],cur=0;
long long ans=0;
int main(){
	memset(nxt,63,sizeof(nxt));
	cin>>s>>t;
	u=" "+s+s;
	for(int i=1;i<u.size();i++){
		for(int j=last[u[i]-'a'];j<i;j++)	nxt[j][u[i]-'a']=i;
		last[u[i]-'a']=i;
	}
	t=" "+t;
//	cout<<nxt[0][18]<<endl;
	for(int i=1;i<t.size();i++){
		if(nxt[cur][t[i]-'a']==0x3f3f3f3f){
			puts("-1");
			return 0;
		}
//		cout<<cur<<" "<<ans<<endl;
		ans+=nxt[cur][t[i]-'a']-cur;
//		cout<<cur<<" "<<ans<<endl;
		cur=nxt[cur][t[i]-'a'];
		if(cur>s.size())	cur-=s.size();
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 21120
n,k,c=map(int,input().split())
s=input()
l=list();r=list()
nex=0
for i in range(n):
	if i<nex:
		continue
	if s[i]=="o":
		nex=i+c+1
		l.append(i)
		if len(l)==k:
			break
nex=-1
for i in range(n):
	if i<nex:
		continue
	if s[-i-1]=="o":
		nex=i+c+1
		r.append(n-i-1)
		if len(r)==k:
			break
r=r[::-1]
for i in range(k):
	if l[i]==r[i]:
		print(l[i]+1)

Measured memory_bytes: 26392
#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C;
    cin >> A >> B >> C;
    if(
        (A==B && A!=C)||(A==C && A!=B)||(B==C && A!=B)
    ){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    s64 x, k, d;
    cin >> x >> k >> d;
    x = abs(x);

    s64 ans;
    if (abs(x) / d > k)
    {
        ans = abs(x) - d * k;
    }
    else
    {
        k -= abs(x) / d;
        x -= abs(x) / d * d;
        if (k % 2 == 0) ans = x;
        else ans = abs(x - d);
    }

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



Measured memory_bytes: 3608
#include<iostream>
#include<algorithm>
#include<map>
#include<cstdio>
#define ll long long
#define lson (rt<< 1)
#define rson (rt<< 1 | 1)
#define gmid ((l+r)>> 1 )
using namespace std;

const int maxn=20000050;

int n,q,a[maxn],f[maxn],ans[maxn],v[maxn];

struct P
{
	int l,r,pos;
}p[maxn];

int lowbit(int x)
{
	return x&(x^(x-1));
}

void add(int pos,int val)
{
	int i=pos;
	while(i<=n)
	  {
	  	  f[i]+=val;
	  	  i+=lowbit(i);
	  } 
}

int sum(int pos)
{
	int ans=0,i=pos;
    while(i>0)
    {
    	ans+=f[i];
    	i-=lowbit(i);
    }
    return ans;
}

bool cmp(P x,P y)
{
	return x.r<y.r;
}
int main()
{
	cin>>n>>q;
	for(int i=1;i<=n;++i)
	  cin>>a[i];
	for(int i=1;i<=q;++i)
	  {
	  	  cin>>p[i].l>>p[i].r;
	  	  p[i].pos=i;
	  }
	sort(p+1,p+1+q,cmp);
	int r=1;
	for(int i=1;i<=q;++i)
	  {
	  	 for(int j=r;j<=p[i].r;++j)
	  	   {
	  	   	  if(v[a[j]]) add(v[a[j]],-1);
	  	   	  add(j,1);
			  v[a[j]]=j;	     
	  	   }
	  	 r=p[i].r+1;
		 ans[p[i].pos]=sum(p[i].r)-sum(p[i].l-1);    
	  }
	for(int i=1;i<=q;++i)
	  cout<<ans[i]<<"\n";  
}


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

int main(int argc, const char * argv[]) {
    int N, A, B;
    
    cin >> N >> A >> B;
    int totalSum = 0;
    for (int i = 1; i <= N; i++) {
        int num = i;
        int total = 0;
        while (num > 0) {
            int mod = num % 10;
            num /= 10;
            total += mod;
        }
        if (total >= A && total <= B) {
            totalSum += i;
        }
    }
    
    cout << totalSum << endl;
    
    return 0;
}

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

int main() {
  int n, k;
  cin >> n >> k;
  int total = 0;
  for(int i=0;i<n;i++) {
    if(i==0) {
      total = k;
    } else {
      total *= k - 1;
    }
  }

  cout << total << endl;
}

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

// varibable settings
#define int long long
const int INF=1e18;
const int MOD=1e9+7;

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define ceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

signed main() {
  int t1,t2,a1,a2,b1,b2;cin>>t1>>t2>>a1>>a2>>b1>>b2;
  dump(b1, b2);

  int da = t1*a1+t2*a2;
  int db = t1*b1+t2*b2;
  if (da==db){
    cout << "infinity" << endl;
    return 0;
  }

  if (da>db){
    swap(da, db);
    swap(a1, b1);
    swap(a2, b2);
  }

  int d = db-da;
  int d1 = t1*a1 - t1*b1;
  dump(d, d1);
  if (d1<0){
    cout << 0 << endl;
    return 0;
  }

  int left = 0;
  int right = 1e16+5;
  auto isright = [&](int i) {  // right is batsu
    // if (d1>=d*i) return false;
    if (d1/i>=d) return false;  // ok
    else return true;
  };
  while (right-left>1){/*{{{*/
    int mid = (right+left)/2;
    if (isright(mid)) { right = mid;}
    else{ left = mid; }
  }/*}}}*/
  dump(right);

  int last = right-1;
  int ans = 1 + (last)*2;
  if (last>=1 && d1/last==d && d1%last==0) ans--;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
n=int(input())
hoge=[]
for i in range(n):
  x,y,z=map(int,input().split())
  if(z!=0):
    hoge.append([x,y,z])
  

if(len(hoge)==1):
  print(*hoge[0])
  exit()

for i in range(101):
  for j in range(101):
    h=[]
    for k in range(len(hoge)):
      h.append(hoge[k][2]+abs(hoge[k][0]-i)+abs(hoge[k][1]-j))
      
    if(h.count(h[0])==len(h)):
      print(i,j,h[0])


Measured memory_bytes: 3064
#include <stdio.h>

int main(){
	int n,i;
	int mp = 0;
	int sum = 0;
	scanf("%d",&n);
	int p[n];
	for(i = 0;i < n;i++){
		scanf("%d",&p[n]);
		sum += p[n];
		if(p[n] > mp)
			mp = p[n];
	}
	printf("%d",sum - mp / 2);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














ll A, B1, B2;
//---------------------------------------------------------------------------------------------------
void _main() {
	scanf("%lld %lld.%lld", &A, &B1, &B2);

	ll ans = A * (B1 * 100 + B2) / 100;
	cout << ans << endl;
}







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

using namespace std;

#define int long long
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll N=1e5+10,M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
const int INF=1e9+7;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}


int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}


int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    int a[n+1];
    int ans=0;
    rep(i,1,n+1){
        cin >> a[i];
        if(i&1 && a[i]&1) ans++;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define eb emplace_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"LINE %d: (%s) = ",__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<", ";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }

const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f;

int cnt[5];
int main(){
    IOS();
    string s;
    cin >> s;
    for (int i=0;i<SZ(s);++i) {
        if (s[i] == 'N') cnt[0]++;
        else if (s[i] == 'S') cnt[1]++;
        else if (s[i] == 'E') cnt[2]++;
        else cnt[3]++;
    }
    for (int i=0;i<3;i+=2) {
        if (cnt[i] != 0 && cnt[i+1] == 0) return cout << "No" << endl,0;
        if (cnt[i] == 0 && cnt[i+1] != 0) return cout << "No" << endl,0;
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 3648
#include <stdio.h>
int main(void){
	int i,tmp,n;
	char str[1000];

	fgets(str,sizeof(str),stdin);
	sscanf(str,"%d",&n);
    for(i=3;i<=n;i++){
        tmp = i;
        if(tmp%3==0)
            printf(" %d",i);
        else{
            while(tmp!=0){
                if(tmp%10==3){
                    printf(" %d",i);
                    break;
                }
                tmp/=10;
            }
        }
    } 
    printf("\n");    
    return 0;
}			

Measured memory_bytes: 608
n = int(input())
A = [int(input()) for _ in range(n)]
ans = 0
for i in range(n-1):
    x,y = A[i], A[i+1]
    ans += x//2
    if x%2!=0 and y > 0:
        ans += 1
        A[i+1] -= 1
ans += A[-1]//2

print(ans)

Measured memory_bytes: 13096
import java.util.*;

public class Main {
	int K, N;
	List<Long> h;
	long result;

	Main() {
		Scanner in = new Scanner(System.in);
		N = in.nextInt();
		K = in.nextInt();
		h = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			h.add(in.nextLong());
		}
		in.close();

		Collections.sort(h);
	}

	void calc() {
		long diff = Long.MAX_VALUE;
		for (int i = 0; i + K <= N; ++i) {
			int largeIndex = i + K - 1;
			if (diff > h.get(largeIndex) - h.get(i)) {
				diff = h.get(largeIndex) - h.get(i);
			}
		}
		result = diff;
	}

	public static void main(String[] args) {
		Main ins = new Main();
		ins.calc();
		System.out.println(ins.result);
	}

}

Measured memory_bytes: 62564
fun main(args: Array<String>) {
    agc034b()
}

fun agc034b() {
    val s = readLine()!!.replace("BC", "D").toCharArray()

    var aCount = 0L
    var answer = 0L
    s.forEach {
        when (it) {
            'A' -> aCount++
            'D' -> answer += aCount
            else -> aCount = 0L
        }
    }

    println(answer)
}


Measured memory_bytes: 44016
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>

int main() {
	std::string S, T;
	std::cin >> S >> T;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] != T[i]) {
			std::cout << "No" << std::endl;
			return 0;
		}
	}
	std::cout << "Yes" << std::endl;
	return 0;
}

Measured memory_bytes: 3528
#include <iostream>
using namespace std;
int main() {
	char s[1];
	cin >> s[0];
	if(s[0]==0x61||s[0]==0x65||s[0]==0x69||s[0]==0x6f||s[0]==0x75){
		cout << "vowel" << endl;
	}
	else {
		cout << "consonant" << endl;
	}
	return 0;
}

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

int N, arr[100005], fac[100005];

int qexp(int b, int p) {
	if (p == 0) return 1;
	else if (p == 1) return b % MOD;
	else if (p % 2 == 0) {
		long long a = qexp(b, p/2);
		a *= a;
		a %= MOD;
		return a;
	} else {
		long long a = qexp(b, p/2);
		a *= a;
		a %= MOD;
		a *= b;
		a %= MOD;
		return a;
	}
}

int modinv(int x) {
	return qexp(x, MOD - 2);
}

int choose(int n, int k) {
	if (k < 0 || k > n) return 0;
	long long ans = fac[n];
	ans *= modinv(fac[k]);
	ans %= MOD;
	ans *= modinv(fac[n-k]);
	ans %= MOD;
	return ans;
}

long long ans[100005];
vector<int> vals[100005];

int main() {
	scanf("%d", &N);
	for (int i = 0; i < N + 1; i++) scanf("%d", &arr[i]);
	long long cur = 1;
	fac[0] = 1;
	for (int i = 1; i <= 100004; i++) {
		cur *= i;
		cur %= MOD;
		fac[i] = cur;
	}
	for (int i = 1; i <= N; i++) ans[i] = choose(N + 1, i);
	for (int i = 0; i < N + 1; i++) vals[arr[i]].push_back(i);
	int l, r;
	for (int i = 1; i <= N; i++) {
		if (vals[i].size() == 2) {
			l = vals[i][0];
			r = vals[i][1];
		}
	}
	printf("%d\n", N);
	for (int len = 2; len <= N; len++) {
		ans[len] -= choose(N - r + l, len - 1);
		ans[len] %= MOD;
		ans[len] += MOD;
		ans[len] %= MOD;
	}
	for (int i = 2; i <= N; i++) printf("%lld\n", ans[i]);
	printf("1\n");
}


Measured memory_bytes: 8192
#include <iostream>
using namespace std;
long long pow5(int x){
  long long ret = 1;
  for(int i = 0; i < 5; i++){
    ret *= x;
  }
  return ret;
}

int main(){

  int X;
  cin >> X;
  
  for(int i = -1000; i <=1000; i++){
    for(int j = -1000; j <= 1000; j++){
      long long val = pow5(i) - pow5(j);
      if(val == X){
	cout << i << " " << j << endl;
	return 0;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 3632
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5+5;

unsigned long long n , a , b;

int main(){
    cin >> n >> a >> b;
    unsigned long long cnt = (n/(a+b)*a);
    n %= a+b;
    cnt += min(a , n);
    cout << cnt << endl;
}


Measured memory_bytes: 384
const mod = 10**9 +7;

function pow (x,y){
    var r = 1;
    for (var i=1; i<=y; i++){
        r = (r * x) % mod;
    }
    return r;
};


function Main (input){
    const [N] = input.trim().split(' ').map(x => parseInt(x));
    var count = pow(10,N)-(pow(9,N)*2)+pow(8,N);
    count = count % mod;
    count = (count + mod) % mod;
    console.log(count)
};


Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 33028
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>

#define For(i, j, k) for(int i = j; i <= k; i++)
#define Forr(i, j, k) for(int i = j; i >= k; i--)

using namespace std;

const int N = 100010;

struct Node{
	int A, B;
}S[N];

typedef long long LL;

LL sumc;
int X, Y, Z, n, val;

bool cmp1(Node& u, Node &v){
	return u.A - u.B > v.A - v.B;
}

LL ans = -1e18, lsum[N], rsum[N];
priority_queue<int, vector<int>, greater<int> > q;

int main(){
	scanf("%d%d%d", &X, &Y, &Z);
	swap(Y, Z);
	n = X + Y + Z;
	For(i, 1, n){
		int c;
		scanf("%d%d%d", &S[i].A, &S[i].B, &c);
		S[i].A -= c, S[i].B -= c, sumc += c;
	}
	sort(S + 1, S + n + 1, cmp1);
	For(i, 1, X) q.push(S[i].A), lsum[X] += S[i].A;
	For(i, X + 1, X + Y){
		q.push(S[i].A);
		lsum[i] = lsum[i - 1] + S[i].A - q.top(); q.pop();
	}
	while(!q.empty()) q.pop();
	Forr(i, n, X + Y + 1) rsum[X + Y + 1] += S[i].B, q.push(S[i].B);
	Forr(i, X + Y, X + 1){
		q.push(S[i].B);
		rsum[i] = rsum[i + 1] + S[i].B - q.top(); q.pop();
	}
	For(i, X, X + Y) ans = max(ans, lsum[i] + rsum[i + 1]);
	printf("%lld\n", ans + sumc);
	return 0;
}

Measured memory_bytes: 2304
<?php
ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%d %d", $H, $W);

for ($y = 0; $y < $H; $y++) {
	fscanf(STDIN, "%s", $S);
	$a[$y] = str_split($S);
	for ($x = 0; $x < count($a[$y]); $x++) {
		if ($a[$y][$x] == "#") {
			$sumX[$x]++;
			$sumY[$y]++;
		}
	}
}

for ($y = 0; $y < $H; $y++) {
	if ($sumY[$y] == 0) {
		continue;
	}

	for ($x = 0; $x < $W; $x++) {
		if ($sumX[$x] == 0) {
			continue;
		}

		echo $a[$y][$x];
	}
	echo "\n";
}

Measured memory_bytes: 4856
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <fstream>

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstdlib>
#include <tuple>
#include <queue>
#include <functional>
#include <stack>
#include <numeric>
#include <cassert>

using namespace std;

class agcB {
public:
    void solve(istream& in, ostream& out) {
        int N, M;
        in >> N >> M;
        vector<pair<int, int>> ab(M);
        vector<int> a(M), b(M);
        vector<vector<int>> g(N);
        for (int i = 0; i < M; ++i) {
            in >> a[i] >> b[i];
            --a[i]; --b[i];
            ab[i] = {a[i], b[i]};
            g[a[i]].push_back(b[i]);
            g[b[i]].push_back(a[i]);
        }
        
        for (int i = 0; i < N; ++i) {
            if (g[i].size() % 2 != 0) {
                out << "NO\n";
                return;
            }
        }
        out << "YES\n";
    }
};


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

	agcB solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    int x, y;
    cin >> x >> y;
    if(x == 12 || y == 12)
        cout << "No" << endl;
        else if(x==4||x==6||x==9||x==11){
            if(y==4||y==6||y==9||y==11){
                cout << "Yes" << endl;
            }else
                cout << "No" << endl;
        }else{
            if(y==1||y==3||y==5||y==7||y==8||y==10){
                cout << "Yes" << endl;
            }else
                cout << "No" << endl;
        }
        return 0;
}

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

int main(){
    int n;
    cin>>n;
    ll num[200010]={0};
    ll a[200010];
    rep(i,n){
        cin>>a[i];
        a[i]--;
        num[a[i]]++;
    }
    ll ans=0;
    rep(i, n){
        if(num[i]<=1) continue;
        ans+=num[i]*(num[i]-1)/2;
    }
    rep(i,n) cout<<ans-num[a[i]]+1<<endl;
}

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

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var S = Console.ReadLine();

            var sb = new StringBuilder();
            foreach (var c in S)
            {
                var code = (int)'A' + (((int)c - (int)'A' + N) % 26);
                sb.Append((char)code);
            }

            var answer = sb.ToString();
            Console.WriteLine(answer);
        }
    }
}


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

constexpr int MOD = 1e9 + 7;

int main() {
    int h, w, k;
    cin >> h >> w >> k;
    
    vector<vector<int>> r {{0}};
    for (int n = 1; n < w; n++) {
        vector<vector<int>> s;
        for (auto e : r) {
            auto f = e;
            f.push_back(n);
            s.push_back(f);
            if (f[n-1] == n-1) {
                swap(f[n-1], f[n]);
                s.push_back(f);
            }
        }
        r = s;
    }

    vector<vector<int>> dp(h, vector<int>(w));
    for (auto& e : r) {
        dp[0][e[0] == 0 ? 0 : 1]++;
    }

    for (int i = 0; i + 1 < h; i++) {
        for (auto& e : r) {
            for (int n = 0; n < w; n++) {
                dp[i+1][e[n]] += dp[i][n];
                dp[i+1][e[n]] %= MOD;
            }
        }
    }

    cout << dp[h-1][k-1] << endl;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  int diff = abs(A-B);
  if (diff%2==0){
    cout << (A+B)/2 << endl;
  }else{
    cout << "IMPOSSIBLE" << endl;
  }
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(){
 int n,h,w;
 cin >> n >> h >> w;
 cout << (n-h+1)*(n-w+1) << endl;
}



Measured memory_bytes: 256
import heapq
for _ in range(int(input())):
  N=int(input())
  ls=[[int(s) for s in input().split()] for _ in range(N)]
  #Li>=RiのラクダとLi<Riのラクダにわける
  lsL=[]
  lsR=[]
  constL=0
  constR=0
  for i in range(N):
    if ls[i][1]>=ls[i][2]:
      lsL.append((ls[i][0],ls[i][1]-ls[i][2]))
      constL+=ls[i][2]
    else:
      lsR.append((N-ls[i][0],ls[i][2]-ls[i][1]))
      constR+=ls[i][1]
  lsL=sorted(lsL, key=lambda x:-x[0])
  lsR=sorted(lsR, key=lambda x:-x[0])
  
  trainL=[]
  trainR=[]
  heapq.heapify(trainL)
  heapq.heapify(trainR)
  len_trainL=0
  len_trainR=0
  
  for j in range(1,N+1):
    #trainLにKi=jであるものを追加
    while lsL!=[] and lsL[-1][0]==j:
      len_trainL+=1
      heapq.heappush(trainL,lsL[-1][1])
      del lsL[-1]
    #trainLの長さがjを超えた場合、取り除いていく
    while len_trainL>j:
      a=heapq.heappop(trainL)
      len_trainL-=1
      
  for j in range(N+1):
    #trainRにKi=jであるものを追加
    while lsR!=[] and lsR[-1][0]==j:
      len_trainR+=1
      heapq.heappush(trainR,lsR[-1][1])
      del lsR[-1]
    #trainRの長さがjを超えた場合、取り除いていく
    while len_trainR>j:
      a=heapq.heappop(trainR)
      len_trainR-=1
      
  print(constL+constR+sum(trainL)+sum(trainR))

    
    

Measured memory_bytes: 73168
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    n,x = I2()
    a = intl()
    a.sort()
    i = 0
    s = 0
    if sum(a) == x:
        print(n)
        exit()
    if sum(a) < x:
        print(n-1)
        exit()
    while s <= x:
        s += a[i]
        i += 1
    print(i-1)

Measured memory_bytes: 3064
#include<stdio.h>
int main(){
  long int a,b,e,i,c,d,r,tmp,g,h;
  scanf("%ld %ld %ld %ld",&a,&b,&c,&d);
  g=c;
  h=d;
  if(c<d){
    tmp = c;
    c = d;
    d = tmp;
  }
  r = c % d;
  while(r!=0){
    c = d;
    d = r;
    r = c % d;
  }

  e=b-b/g-b/h+b/(g*h/d);
  i=a-1-(a-1)/g-(a-1)/h+(a-1)/(g*h/d);
  printf("%ld",e-i);
  return 0;
}



Measured memory_bytes: 128
n=input()
len_n=len(n)
i=1
ans=0
while(i<len_n):
    if i%2!=0:
        ans+=9*10**(i-1)
    i+=1
if len_n%2!=0:
    ans+=(int(n)-10**(len_n-1)+1)
print(ans)

Measured memory_bytes: 9052
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

int main(){
  long long int N = 0, ans = 0;
  
  std::cin >> N;

  std::vector<long long int> A(N);
  
  for(int i = 0; i < N; ++ i){
    std::cin >> A[i];
  }
  std::sort(A.begin(), A.end());
  std::reverse(A.begin(), A.end());
  
  ans = A[0];
  for(int i = 2; i < N; ++ i){
    ans += A[std::floor(static_cast<double>(i/2))];
  }
  
  std::cout << ans;
  
  return 0;
}

Measured memory_bytes: 4824
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
const int N = 2e5 + 10;
const ll inf = 1e15 + 42;
#define endl "\n"
const ll mod = 1000000007;
 
void testCase() {
    db r;
    cin >> r;
    db up = 22;
    db down = 7;
    up = 2*up*r;
    up = (up/down);
    cout << fixed << setprecision(15) << up << endl;
}
 
int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    testCase();
    return 0;
}

Measured memory_bytes: 3804
import sys
N=int(input())
A=list(map(int,input().split()))
x=0
for i,v in enumerate(A):
    if i%2==1:
        x-=v
    else:
        x+=v
ans=[]
tmp=x
for j in A[::-1]:
    ans.append(j*2-tmp)
    tmp=j*2-tmp
ans=ans[::-1]
for i in ans[:-1]:
    sys.stdout.write("{} ".format(i))
sys.stdout.write(str(ans[-1]))
print()


Measured memory_bytes: 14092
#include<iostream>
#include<math.h>
using namespace std;
typedef long long ll;
typedef long double ld;


int main(){
	ll n;
	cin >> n;
	ll temp1= n%10;
	ll temp2= ((n%100)-temp1)/10;
	ll temp3= (n - temp1 - temp2)/100;
	if((temp1==7)||(temp2==7)||(temp3==7)){
		cout << "Yes";
	}
	else{
		cout << "No";
	}
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define deb(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
typedef long long int ll;
typedef string str;
ll p=1000000007;
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 
ll gcd(ll a, ll b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);
}
void fast(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int main ()
{
	ll t,n,m,k,i,a,b,j,d;
	cin >> d;
	ll c[27],s[d+2][27],l[27]={0};
	for(i=0;i<26;i++)
	{
		cin >> c[i];
	}
	for(i=1;i<=d;i++)
	{
		for(j=0;j<26;j++)
		{
			cin >> s[i][j];
		}
	}
	ll ans[d+2];
	for(i=1;i<=d;i++)
	{
		ll max=-1000000000000000;
		vector <ll> v;
		for(j=0;j<26;j++)
		{
			a=s[i][j]-c[j]*(i-l[j]);
			if(a>max)
			{
				max=a;
				v.clear();
				v.pb(j);
			}
			else if(a==max)
			{
				v.pb(j);
			}
		}
		b=v[0];
		for(k=1;k<v.size();k++)
		{
			if(c[v[k]]<c[b])
			{
				b=c[v[k]];
			}
		}
		ans[i]=b+1;
		l[b]=i;
	}
	for(i=1;i<=d;i++)
	{
		cout << ans[i] << "\n";
	}
	return 0;
}

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

inline long long read(){
    long long s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * w;
}

int main(){
    double l = read();
    printf("%.12f\n", l/3*l/3*l/3);
    return 0;
}

Measured memory_bytes: 256