akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>

using ll = long long;

int main() {
    int n, m;
    cin >> n >> m;
    vector<pii>v(m);
    rep(i, 0, m){
        cin >> v[i].first >> v[i].second;
        v[i].second *= -1;
    }
    sort(v.begin(), v.end());
    rep(i, 0, m){
        v[i].second *= -1;
    }
    int ans = 1;
    int end = v[0].second;
    rep(i, 0, m){
        if(v[i].first < end){
            end = min(end, v[i].second);
            continue;
        }
        ans++;
        end = v[i].second;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const int N = 1e5 + 1;
int n , m , par[N];
int findp(int x){
	if(x == par[x])return x;
	return par[x] = findp(par[x]);
}
int main(){	
	cin >> n >> m;
	for (int i = 0; i < n; ++i)par[i] = i;	
	for (int i = 0,u,v; i < m; ++i){
		scanf("%d%d",&u,&v),--u,--v;
		u = findp(u) , v = findp(v);
		if(u > v)swap(u , v);
		par[v] = u;
	}
	int cnt = 0;
	for (int i = 0; i < n; ++i){
		if(findp(i) == i)++cnt;
	}
	cout << cnt - 1 << endl;
	
	
	
	

	
	
		
}	

Measured memory_bytes: 4152
#include<iostream>
using namespace std;
int main(){
  int n;
  int i;
  int card[4][13]={{}};
  cin >> n;
  char a;
  int b;
  for(i=0;i<n;i++) {
    cin >> a >> b;
    switch(a){
    case 'S':
      card[0][b-1]=1;
      break;
    case 'H':
      card[1][b-1]=1;
      break;
    case 'C':
      card[2][b-1]=1;
      break;
    case 'D':
      card[3][b-1]=1;
      break;
    }
  }
  for(i=0;i<52;i++) {
    switch(i/13){
    case 0:
      if(card[0][i%13]==0) cout << "S " << i+1 << endl;
      break;
    case 1:
      if(card[1][i%13]==0) cout << "H " << i%13+1 << endl;
      break;
    case 2:
      if(card[2][i%13]==0) cout << "C " << i%13+1 << endl;
      break;
    case 3:
      if(card[3][i%13]==0) cout << "D " << i%13+1 << endl;
      break;
    }
  }
   
  return 0;
}



Measured memory_bytes: 3092
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		// TODO ABC_087_B
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
	    // Scannerクラスのインスタンスをクローズ
		sc.close();

		int ret = 0;
		int sumA = 0, sumB = 0, sumC = 0;
		int maiA = 0, maiB = 0, maiC = 0;

		for(maiA = 0; maiA <= A; maiA++) {
			if(maiA * 500 > X) {
				break;
			}
			sumA = maiA * 500;

			for(maiB = 0; maiB <= B; maiB++) {
				if(maiB * 100 + sumA > X) {
					break;
				}
				sumB = maiB * 100 + sumA;

				for(maiC = 0; maiC <= C; maiC++) {
					if(maiC * 50 + sumB > X) {
						break;
					}
					sumC = maiC * 50 + sumB;
					if(sumC == X) {
						ret++;
						break;
					}
				}
			}
		}

		// 出力
		System.out.println(ret);

	}
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(i, v) for(auto i =  v.begin(); i !=  v.end(); ++i)
#define RFOR(i, v) for(auto i = v.rbegin(); i != v.rend(); ++i)

template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T> ostream & operator<<(ostream & os, const vector<T> & v) {
	os << "[";
	FOR(it, v) {
		if(it != v.begin()) { os << ", "; }
		os << *it;
	}
	os << "]";
	return os;
}
template<typename F, typename S> ostream & operator<<(ostream & os, const pair<F, S> & p) {
	os << "<" << p.FI << ", " << p.SE << ">";
	return os;
}

// ---- ----

const int MOD = 1000000007;
LL n, a[2], s[100000];
LL sum[2][100001], last[2], lim[2][100000];

LL dp[2][100001];

int main() {
	cin >> n >> a[0] >> a[1];
	inc(i, n) { cin >> s[i]; }
	
	inc(k, 2) {
		int p = 0;
		inc(i, n) {
			while(s[i] - s[p] >= a[k] && p < i - 1) { p++; }
			lim[k][i] = p;
		}
	}
	
	/*
	dp[0][0] = 1;
	dp[1][0] = 1;
	incID(i, 1, n) {
		
		inc(k, 2) { inc(j, lim[k][i] + 1) { dp[k][i] += dp[1 - k][j]; } }
		inc(k, 2) { if(s[i] - s[i - 1] < a[k]) { inc(j, i) { dp[k][j] = 0; } } }
		
		inc(k, 2) { inc(j, i + 1) { cout << dp[k][j] << ", "; } cout << endl; } cout << endl;
	}
	*/
	
	///*
	last[0] = -1;
	last[1] = -1;
	sum[0][0] = 1;
	sum[1][0] = 1;
	
	incID(i, 1, n) {
		LL v[2];
		inc(k, 2) { v[k] = (last[1 - k] < lim[k][i] ? sum[1 - k][ lim[k][i] ] : 0); }
		inc(k, 2) {
			if(s[i] - s[i - 1] < a[k]) { last[k] = i - 1; } else { (v[k] += sum[k][i - 1]) %= MOD; }
		}
		inc(k, 2) { sum[k][i + 1] = sum[k][i] = v[k]; }
		
	}
	
	cout << (sum[0][n - 1] + sum[1][n - 1]) % MOD << endl;
	//*/
	
	return 0;
}


Measured memory_bytes: 4096
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
Yes=lambda b:print("Yes"if b else"No");YES=lambda b:print("YES"if b else"NO")

def main():
  k=aint()
  a,b=ints()
  ans=False
  for i in range(a,b+1):
    if i%k==0:
      ans=True
      break
  print("OK"if ans else"NG")

if __name__ == '__main__':
    main()

Measured memory_bytes: 61836
from collections import deque

N, M = map(int, input().split())
a = [-1 for _ in range(N)]
visited = [0 for _ in range(N)]
cond = [[[],[]] for _ in range(N)]#same,diff
count = 0
for _ in range(M):
    x, y, z = map(int, input().split())
    if z % 2 == 0:
        cond[x-1][0].append(y-1)
        cond[y-1][0].append(x-1)
    else:
        cond[x-1][1].append(y-1)
        cond[y-1][1].append(x-1)
for i in range(N):
    if (not cond[i][0] and not cond[i][1]) or visited[i]:
        continue
    else:
        count += 1
        check = deque([(i, 0)])
        while check:
            num, eo = check.popleft()
            visited[num] = 1
            a[num] = eo
            for next in cond[num][0]:
                if visited[next]:
                    continue
                check.append((next, eo))
            for next in cond[num][1]:
                if visited[next]:
                    continue
                check.append((next, (eo+1)%2))
ans = a.count(-1) + count
print(ans)

Measured memory_bytes: 105908
#include <bits/stdc++.h>
        using namespace std;
        #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

        signed main() {
  int a,b;
  cin>>a>>b;
  if(a+b==15){
          cout<<'+';

          return 0;
  }
  if(a*b==15){
          cout<<'*';
          return 0;
  }
  cout<<'x';

        }

        


Measured memory_bytes: 256
#include <iostream>

using namespace std;

string inp[8];
const int W = 8;
const int H = 8;
int sx, sy;
const int dx[] = {0, 0, 0, 1, 2, 3, 0, 0, 0, -1, -2, -3};
const int dy[] = {-1, -2, -3, 0, 0, 0, 1, 2, 3, 0, 0, 0};

void dfs(int x, int y) {
    inp[y][x] = '0';

    for (int i = 0; i < 12; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];

        if (nx < 0 || ny < 0 || nx >= W || ny >= H)
            continue;
        
        if (inp[ny][nx] == '1')
            dfs(nx, ny);
    }
}

int main()
{
    int n;

    cin >> n;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < H; j++)
            cin >> inp[j];
        cin >> sx >> sy;
        dfs(sx - 1, sy - 1);
        
        cout << "Data " << i << ":" << endl;
        for (int j = 0; j < H; j++)
            cout << inp[j] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 1208
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 S(): return input()
     
def main():
    N = I()
    cnt = 0
    for i in range(N+1):
        if i % 3 == 0:
            continue
        if i % 5 == 0:
            continue
        cnt += i
    print(cnt)

main()



Measured memory_bytes: 10944
#include "bits/stdc++.h"
 
using namespace std;
typedef int64_t ll;
typedef vector<int64_t> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<vd> vvd;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SIZE(a) int((a).size())

int main(){
  int n;
  cin>>n;
  vin x(n),y(n),h(n);int xx,yy,hh,cx,cy,H;
  REP(i,n){
    cin>>x[i]>>y[i]>>h[i];
    if(h[i]!=0){xx=x[i];yy=y[i];hh=h[i];}
  }

  REP(i,101){
    REP(j,101){
      bool ok=true;
      int HH=hh+abs(xx-i)+abs(yy-j);
      REP(k,n){
        if(h[k]!=max(HH-abs(x[k]-i)-abs(y[k]-j),0)){
          ok=false;break;
        }
      }
      if(ok){cx=i;cy=j;H=HH;}
    }
  }
  cout<<cx<<" "<<cy<<" "<<H<<endl;
}

Measured memory_bytes: 256
def bit(N,S):
    global ans
    for s in range(2**10):
        a=[i for i in range(10) if s>>i & 1]
        if len(a)==N and sum(a)==S:
            ans+=1
while True:
    N,S=map(int,input().split())
    if N==0 and S==0:
        break
    ans=0
    bit(N,S)
    print(ans)


Measured memory_bytes: 5596
#include<stdio.h>
#include<string.h>
int main()
{
	int n;
	scanf("%d", &n);
	int i;
	char s[55][102];
	int t[55];
	for (i = 0; i < n; i++)
		scanf("%s %d", s[i], &t[i]);
	char x[102];
	scanf("%s", x);
	int ans = 0;
	i = n - 1;
	while (strcmp(s[i], x) != 0)
	{
		ans += t[i];
		i--;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }

vector<int> as;
ll memo[3001][3001];
ll calcMaxi(int i, int j){
    if(i == j){ return as[i]; }
    if(memo[i][j]){ return memo[i][j]; }
    ll c1 = as[i], c2 = as[j];
    c1 -= calcMaxi(i + 1, j);
    c2 -= calcMaxi(i, j - 1);
    return memo[i][j] = max(c1, c2);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    as.resize(n); cin >> as;
    cout << calcMaxi(0, n - 1) << '\n';
}


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

int main(){
    int N; cin >> N;
    int lb = 0, ub = N;
    map<int,string> mp;
    cout << 0 << endl;
    string s; cin >> s;
    mp[0] = s;
    if(s == "Vacant"){
        cout << 0 << endl;
        return 0;
    }
    while(1){
        int m = (lb + ub) / 2;
        cout << m << endl;
        cin >> s;
        mp[m] = s;
        if(s == "Vacant"){
            cout << m << endl;
            return 0;
        }
        if((m - lb) % 2 == 0){
            if(mp[m] == mp[lb]) lb = m;
            else ub = m;
        }else{
            if(mp[m] == mp[lb]) ub = m;
            else lb = m;
        }
    }
    return 0;
}

Measured memory_bytes: 852
use std::io;
use std::cmp::{max, min};

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let n = v[0];
	let v:Vec<u64> = procon_read();
	let mut mini:u64 = v[0];
	let mut maxi:u64 = v[0];
	for i in 0..n {
		mini = min(v[i as usize], mini);
		maxi = max(v[i as usize], maxi);
	}
	println!("{}", maxi - mini);
}

Measured memory_bytes: 4352
<?php
fscanf(STDIN, '%d %d', $n, $x);

$m = [];
for ($i = 0; $i < $n; $i++) {
    $m[] = trim(fgets(STDIN));
}

$min = 1001;
$mini = 0;
for ($i = 0; $i < $n; $i++) {
    if ($m[$i] < $min) {
        $min = $m[$i];
        $mini = $i;
    }
}

$c = 0;
if ($x >= $min) {
    $x -= $min;
    $c++;
}

for ($i = 0; $i < $n; $i++) {
    if ($i !== $mini) {
        $x -= $m[$i];
        $c++;
    }
}

$c += intval($x / $min);

echo $c . PHP_EOL;

Measured memory_bytes: 4728
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <bitset>
#include <set>
#include <chrono>
#include <string>
#include <assert.h>

using namespace std;

#define endl '\n'

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

    int n, m;
    cin >> n >> m;

    vector<vector<int>> adj(n);

    for (int i = 0; i < m; ++i) {
        int s, t; cin >> s >> t;
        s--; t--;
        adj[s].push_back(t);
    }

    vector<double> go(n);

    for (int i = n - 2; i >= 0; --i) {
        double sum = 0;

        for (auto u : adj[i]) {
            sum += go[u];
        }

        go[i] = sum / adj[i].size() + 1;
    }

    auto calc = [&]() {
        vector<double> rr(n);

        for (int i = n - 2; i >= 0; --i) {
            double sum = 0;

            for (auto u : adj[i]) {
                sum += rr[u];
            }

            rr[i] = sum / adj[i].size() + 1;
        }

        return rr[0];
    };

    double ans = go[0];

    for (int i = 0; i + 1 < n; ++i) {
        if (adj[i].size() == 1)
            continue;

        int p = 0;

        for (int j = 1; j < adj[i].size(); ++j) {
            if (go[adj[i][j]] > go[adj[i][p]])
                p = j;
        }

        swap(adj[i][p], adj[i].back());
        auto u = adj[i].back();
        adj[i].pop_back();

        ans = min(ans, calc());

        adj[i].push_back(u);
    }

    cout.precision(10);
    cout << fixed << ans << endl;


    return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<iomanip>
#include<algorithm>
#include<cstdio>
using namespace std;
 
char a[100001];
int ans[100001];
int n,m;
int main()
{
	cin>>n>>m;
	cin>>a;
	int r=strlen(a)-1;
	int i=0;
	while(r>=0)
	{
		int temp=r-m;
		if(temp<=0)
		{
			ans[i]=r;
			break;
		}
		while(a[temp]=='1')
		{
			temp++;
		}
		if(temp==r )
		{
			cout<<"-1"<<endl;
			return 0;
		}
		ans[i++]=r-temp;
		r=temp;
	}
	for(int j=i;j>=0;j--)
	{
		if(j==i)
		{
			cout<<ans[j];
		}
		else
		{
			cout<<" "<<ans[j];
		}
	}
	return 0;
}

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

int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int dx=c-a;
    int dy=d-b;
    cout << c-dy << ' ' << d+dx << ' ' << a-dy << ' ' << b+dx << endl;
}

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

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

  int min0 = INT32_MAX;
  int max0 = 0;
  rep(i, N) { 
      int a;
      cin >> a;
      min0 = min(min0, a);
      max0 = max(max0, a);
  }
  cout << (max0 - min0) << endl;
  return 0;
}


Measured memory_bytes: 256
use whiteread::parse_line;

fn main() {
    let (n, _l): (usize, usize) = parse_line().unwrap();
    let mut v: Vec<String> = Vec::new();

    for _ in 0..n {
        v.push(parse_line().unwrap());
    }
    v.sort();
    println!("{}", v.iter().fold(String::new(), |x, y| x + y));
}


Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

const int N=2e5+5;

int a[N];
int ans;
int v[N];

int get(int n){
	if(n>=0)return v[n];
	return 0;
}
void put(int n){
	if(n<N)v[n]++;
}

void solve(){
	int n;
	cin>>n;
	rep(i,1,n+1){
		cin>>a[i];
		ans+=get(i-a[i]);
		put(i+a[i]);
	}
	cout<<ans;
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#ifdef SEIVE
		seive();
	#endif
	#ifdef NCR
		init();
	#endif
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}


Measured memory_bytes: 6764
#include <stdio.h>
 
int main(void)
{
    int n;
    int h, m;
    int i, j;
    int bus[24][60] = {0};
    int c;
 
    for (i = 0; i < 2; i++){ 
        scanf("%d", &n);
        for (j = 0; j < n; j++){
            scanf("%d %d", &h, &m);
            bus[h][m] = 1;
        }
    }
 
    c = 0;
    for (h = 0; h < 24; h++){
        for (m = 0; m < 60; m++){
            if (bus[h][m]){
                if (c == 1){
                    printf(" ");
                }
                c = 1;
                printf("%d:%02d", h, m);
            }
        }
    }
    printf("\n");
 
    return (0);
}

Measured memory_bytes: 624
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
//use permutohedron::LexicalPermutation as _;
use proconio::input;
//use proconio::marker::Chars;
//use proconio::marker::Usize1;
//use std::collections::HashSet;
//use std::collections::HashMap;
//use std::collections::BTreeMap;
//use std::cmp::*;
//use std::num;

fn main() {
    input! {
        mut n:i32,m:i32,
        a:[i32;n]

    }
    let mut out = 0;
    let mut sum = 0;
    for v in &a {
        sum += v;
    }
    for v in &a {
        if 4 * m * v < sum {
            out += 1;
        }
    }
    if n < m + out {
        println!("No");
    } else {
        println!("Yes");
    }
}


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

int main(){
  int h,w;
  cin >> h >> w;
  
  rep(i,h)rep(j,w){{
    string c;
    cin >> c;
    if (c == "snuke") {
      char g = 'Z' - 25 + j;
      cout << g << i+1 << endl;
      break;
    }
  }}
  
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - Digits
            var line = ReadLine();
            int N = line[0];
            int K = line[1];

            var s = ConvertToNSystem(N, K);
            Console.WriteLine(s.Length);
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var arr = line.Split(' ');

            return arr.Select(x => int.Parse(x)).ToList();
        }

        static string ConvertToNSystem(long source, long n)
        {
            //[summary]10進数の数字(source)をn進数に変換
            //変換方法については、以下リンクの最下部を参照
            //http://manabi.matiralab.com/binary/

            var mods = new List<long>();
            long num = source;

            //元の数字が"n"で割れなくなるまで繰り返し
            while (num != 0 && num != 1)
            {
                mods.Add(num % n);
                num /= n;
            }

            //最後の商も入れる
            mods.Add(num);

            //記憶した数字の順番を入れ替える
            mods.Reverse();

            //連結した文字列の最初がゼロになることもあるので、削除
            mods = mods.SkipWhile(x => x == 0).ToList();

            //Listの値を結合
            return string.Join("", mods);
        }
    }
}

Measured memory_bytes: 13396
N , Y = map(int, input().split())
ans = []
for i in range(N+1):
    for j in range(N+1):
        k = N - i - j
        if k >= 0:
            num = i*10000 + j*5000 + k*1000
            if num == Y:
                ans = [i, j, k]

if len(ans) == 0:
    ans = [-1, -1, -1]
    
print(" ".join(map(str,ans)))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
int main(int argc, char *argv[])
{
  int N;
  scanf("%d",&N);
  int sum = 0;
  int min = 101;
  for (int i = 0; i < N; i++) {
    int tmp;
    scanf("%d",&tmp);
    if(tmp<min&&tmp%10!=0){
      min = tmp;
    }
    sum += tmp;
  }
  if(sum%10==0){
    if(min==101){
      printf("0\n");
    }
    else{
      printf("%d\n",sum-min);
    }
  }else{
    printf("%d\n",sum);
  }
  return 0;
}


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

const int maxn = 100010;
int dp[maxn][3], n, a[maxn][3];
/**
dp[i][j]±íÊ¾µÚiÌìÑ¡j»ñµÃµÄ×î´óÓäÔÃÖµ
ÄÇÃ´µÚiÌìµÄÖµ¿ÉÒÔÓÉµÚi-1Ìì×ªÒÆ¶øÀ´ 
*/
int main() {
	//freopen("demo.in", "r", stdin);
	//freopen("demo.out", "w", stdout);
	
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d%d%d", a[i], a[i]+1, a[i]+2);
	}
	memset(dp, 0, sizeof(dp));
	dp[0][0] = a[0][0], dp[0][1] = a[0][1], dp[0][2] = a[0][2];
	
	for (int i = 1; i < n; i++)
		for (int j = 0; j < 3; j++)
			for (int k = 0; k < 3; k++)
				if (j != k)
				{
					dp[i][j] = max(dp[i][j], dp[i-1][k] + a[i][j]);
				}
	int ans = 0;
	for (int i = 0; i < 3; i++)
		if (ans < dp[n-1][i])
			ans = dp[n-1][i];
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 2560
//Finite Disappointment and Infinite Hope
#include <bits/stdc++.h>
using namespace std;
#define help ios_base:: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.first<<","<<v.second<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    for(auto &x:c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long ll;
const ll N=2e5+5,MOD=1e9+7;
int main(){
help
    ll h,a;cin>>h>>a;
    cout<<(h+a-1)/a;
}


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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> S(H);
  int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
  for (string& s : S) cin >> s;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (S[i][j] == '.') continue;
      int ok = 0;
      for (int k = 0; k < 4; k++) {
        int i2 = i + dx[k], j2 = j + dy[k];
        if (i2 < 0 || H <= i2 || j2 < 0 || W <= j2) continue;
        if (S[i2][j2] == '#') ok = 1;
      }
      if (ok == 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}

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

#define REP(i,a,b) for(int i=a,i##_end_=b;i<=i##_end_;++i)
#define DREP(i,a,b) for(int i=a,i##_end_=b;i>=i##_end_;--i)
#define MREP(i,x) for(int i=beg[x],v;v=to[i],i;i=las[i])
#define debug(x) cout<<#x<<"="<<x<<endl
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define y1 asdasd
typedef long long ll;

using namespace std;

void File(){
	freopen("speech.in","r",stdin);
	freopen("speech.out","w",stdout);
}

template<typename T>void read(T &_){
	T __=0,mul=1; char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')mul=-1;
		ch=getchar();
	}
	while(isdigit(ch))__=(__<<1)+(__<<3)+(ch^'0'),ch=getchar();
	_=__*mul;
}

const int maxn=2000+10;
int n,m,a[maxn][maxn],b[maxn][maxn],ans;
char s[maxn];
stack<int>stk;

int main(){
	//File();
	read(n); read(m);
	if(n==1 || m==1)return printf("%d\n",n*m),0;
	REP(i,1,n){
		scanf("%s",s+1);
		REP(j,1,m)a[i][j]=(s[j]=='#');
	}
	REP(i,1,n-1)REP(j,1,m-1){
		int c[2]={0};
		++c[a[i][j]];
		++c[a[i+1][j]];
		++c[a[i][j+1]];
		++c[a[i+1][j+1]];
		b[i][j]=!(c[1]%2);
		if(b[i][j])b[i][j]+=b[i-1][j];
	}
	/*REP(i,1,n-1){
		REP(j,1,n-1)
			cout<<b[i][j]<<" ";
		cout<<endl;
	}*/
	REP(i,1,n-1){
		int las;
		REP(j,1,m-1){
			las=j;
			while(!stk.empty() && b[i][stk.top()]>=b[i][j]){
				las=stk.top(); stk.pop();
				if(b[i][las])ans=max(ans,(j-las+1)*(b[i][las]+1));
			}
			b[i][las]=b[i][j];
			stk.push(las);
		}
		while(!stk.empty()){
			las=stk.top(); stk.pop();
			if(b[i][las])ans=max(ans,(m-las+1)*(b[i][las]+1));
		}
	}
	printf("%d\n",max(ans,max(n,m)));
	return 0;
}

Measured memory_bytes: 31744
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, a[N], b[N], ans;
map<int, int> rd, fa;
inline int Ask(int x) {
    return fa.count(x) ? fa[x] = Ask(fa[x]) : x;
}
inline void Merge(int x, int y) {
    x = Ask(x); y = Ask(y);
    if (x == y) return;
    fa[x] = y;
}
int main() {
    scanf("%d", &n);
    int a_xor = 0;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", a + i);
        a_xor ^= a[i];
    }
    for (int i = 1; i <= n; ++i) {
        scanf("%d", b + i);
        if (a[i] != b[i]) {
            ++rd[a[i]];
            --rd[b[i]];
            Merge(a[i], b[i]);
            ++ans;
        }
    }
    if (!ans) return puts("0"), 0;
    int non_zero_cnt = 0, rt = Ask(a_xor), con_num = 0;
    for (map<int, int>::iterator it = rd.begin(); it != rd.end(); ++it) {
        if (Ask(it->first) == rt) non_zero_cnt += bool(it->second);
        else if (it->second) return puts("-1"), 0;
        con_num += !fa.count(it->first);
    }
    if (!rd.count(a_xor)) {
        printf("%d\n", ans + con_num);
    } else {
        if ((rd[a_xor] == 0 && non_zero_cnt == 0) || (rd[a_xor] == -1 && non_zero_cnt == 2)) {
            printf("%d\n", ans + con_num - 1);
        } else {
            puts("-1");
        }
    }
    return 0;
}

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

using namespace std;

#define MOD 1000000007
#define ll long long int
#define ld long double
#define pb push_back
#define mkp make_pair
#define pii pair<int, int> 
#define pll pair<long long int, long long int>
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define fi first
#define sc second
#define deb 0

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

	int a, b, c, i, j;
	a = b = c = 0;
	int n, k;
	cin >> n;
	while (n--) {
		cin >> k;
		if (k&1) a++;
		else {
			if (k%4 == 0) c++;
			else b++;
		}
	}

	if (a <= c) {
		cout << "Yes" << endl;
	} else if (a == c+1 && b == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=66666;i++){
		if(floor(i*1.08)==n){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<":("<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
typedef int64_t ll;

int main() {
    int64_t N, ans = 0;
    cin >> N;
    ans += N / 500 * 1000;
    N %= 500;
    ans += N / 5 * 5;
    cout << ans << endl;

}


Measured memory_bytes: 256
def btn(n, l)
  a = [".", ",", "!", "?", " "] + [*"a".."z"]
  return case n
  when "1"
    a[0 + l % 5]
  when "2"
    a[5 + l % 3]
  when "3"
    a[8 + l % 3]
  when "4"
    a[11 + l % 3]
  when "5"
    a[14 + l % 3]
  when "6"
    a[17 + l % 3]
  when "7"
    a[20 + l % 4]
  when "8"
    a[24 + l % 3]
  when "9"
    a[27 + l % 4]
  end
end

gets.to_i.times do
  arr, ans = gets.chomp.split(/0+/), ""
  
  arr.each do |str|
    ans += btn(str[0], str.length - 1) if str[0]
  end
  
  puts ans
end

Measured memory_bytes: 9148
// what if n / 2 is even?
#include<bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define f first
#define s second 
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define int long long
#define forn(i, x, y) for(int i = x; i <= y; i++)
#define forev(i, y, x) for(int i = y; i >= x; i--)

using namespace std;

const int maxn = (int)3e5 + 100;
const int mod = (int)1e9 + 7;
const int P = (int)1e6 + 7;
const int inf = (int)1e9 + 7;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef long double ld;

using namespace std;

int n, a[maxn], s[2][maxn], cnt[2][maxn], sum[2];
int get(int x, int type){
	return n / 2 - cnt[type][x];
}
main () {
	cin >> n;
	forn(i, 1, n){
		cin >> a[i];
		cnt[i % 2][a[i]]++;
		sum[i % 2] += a[i];
	}
	vpii v1, v2;
	forn(i, 1, maxn - 1)
		v1.pb(mp(cnt[0][i], i));
	forn(i, 1, maxn - 1)
		v2.pb(mp(cnt[1][i], i));
	sort(all(v1)); sort(all(v2));
	reverse(all(v1)); reverse(all(v2));
	v1.resize(min(sz(v1), 100ll)), v2.resize(min(sz(v2), 100ll));
	int ans = inf * inf;
	for(auto i : v1){
		for(auto j : v2){
			int x = i.s, y = j.s;
			if(x == y) continue;
			ans = min(ans, get(x, 0) + get(y, 1));
		}
	}
	cout << ans;
}

Measured memory_bytes: 25320
#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n, m; cin>>n>>m;
    int arr[n], ans=0;  vector<int> adjlist[n];
    for(int i=0; i<n; i++){
        cin>>arr[i];
    }
    for(int i=0; i<m; i++){
        int a, b; cin>>a>>b;
        adjlist[a-1].push_back(b-1);
        adjlist[b-1].push_back(a-1);
    }

    for(int i=0; i<n; i++){
            bool inter=true;
            //cout<<adjlist[i].size()<<endl;
        for(int j=0; j<adjlist[i].size(); j++){
            if(arr[i]<=arr[adjlist[i][j]]) {
                inter=false; break;
            }
        }
        if(inter) ans++;
    }

    cout<<ans;
    return 0;

}


Measured memory_bytes: 9104
// Find the minimum spanning tree by the Kruskal algorithm
// -------------------------------------------------------
// Kruskal(G):
//     A = ∅
//     foreach v ∈ G.V:
//        MAKE-SET(v)
//     foreach (u, v) in G.E ordered by weight(u, v), increasing:
//         if FIND-SET(u) ≠ FIND-SET(v):
//             A = A ∪ {(u, v)}
//             UNION(u, v)
//     return A
//
// Ref: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm

package main

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

var scanner = bufio.NewScanner(os.Stdin)
var (
	matrix [][]int
)

type Edge struct {
	a, b, cost, added int
}
type ByCost []Edge

var edges ByCost

func (a ByCost) Len() int           { return len(a) }
func (a ByCost) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByCost) Less(i, j int) bool { return a[i].cost < a[j].cost }

func main() {
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		n, _ := strconv.Atoi(buf[0])
		m, _ := strconv.Atoi(buf[1])
		if n == 0 && m == 0 {
			break
		}
		matrix = make([][]int, n)
		for i := range matrix {
			matrix[i] = make([]int, n)
		}
		for i := 0; i < m; i++ {
			scanner.Scan()
			buf_ := strings.Split(scanner.Text(), " ")
			a, _ := strconv.Atoi(buf_[0])
			b, _ := strconv.Atoi(buf_[1])
			cost, _ := strconv.Atoi(buf_[2])
			matrix[a][b] = cost
			matrix[b][a] = cost
		}
		sum := Kruskal(n)
		fmt.Println(sum)
		if len(edges) > 0 {
			edges = []Edge{}
		}
	}
}

func Kruskal_func(size, edge_num int) int {
	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if matrix[i][j] > 0 {
				tmp := Edge{i, j, matrix[i][j], 0}
				edges = append(edges, tmp)
			}
		}
	}
	sort.Sort(ByCost(edges))
	UF_Init(edge_num)
	for i := 0; i < edge_num; i++ {
		a := edges[i].a
		b := edges[i].b
		if UF_Find(a) != UF_Find(b) {
			edges[i].added = 1
			UF_Union(UF_Find(a), UF_Find(b))
		}
	}
	sum := 0
	for i := 0; i < edge_num; i++ {
		if edges[i].added != 0 {
			// log.Printf("edge(%d,%d) is added\n", edges[i].a, edges[i].b)
			sum += edges[i].cost
		}
	}
	return sum
}

func Kruskal(size int) int {
	edge_num := 0
	for i := 0; i < size; i++ {
		for j := 0; j < size; j++ {
			if matrix[i][j] > 0 {
				edge_num++
			}
		}
	}
	return Kruskal_func(size, edge_num)
}

/*** Union-Find functions ***/
var UF_Parent []int
var UF_Rank []int

func UF_Init(n int) {
	UF_Parent = make([]int, n)
	UF_Rank = make([]int, n)
	for i := 0; i < n; i++ {
		UF_Parent[i] = i
		UF_Rank[i] = 0
	}
}
func UF_Union(a, b int) {
	if UF_Rank[a] < UF_Rank[b] {
		UF_Parent[a] = b
	} else {
		UF_Parent[b] = a
	}
	if UF_Rank[a] == UF_Rank[b] {
		UF_Rank[a]++
	}
}
func UF_Find(a int) int {
	if UF_Parent[a] == a {
		return a
	}
	return UF_Find(UF_Parent[a])
}
/*** Union-Find functions ***/


Measured memory_bytes: 1388
/*  -*- coding: utf-8 -*-
 *
 * a.cc: A: Rotation
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int W = 3;

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  string s0, s1;
  cin >> s0 >> s1;

  bool ok = true;
  for (int x = 0; ok && x < W; x++)
    ok = (s0[x] == s1[W - 1 - x]);

  if (ok) puts("YES");
  else puts("NO");
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>

using namespace std;

int main(void){
    int N,K;
    
    cin >> N >> K;
    
    vector<int> vec(N);
    
    for(int i=0;i<K;i++){
        int d;
        cin >> d;
        for(int j=0;j<d;j++){
            int A;
            cin >> A;
            if(vec.at(A-1)==0){
                vec.at(A-1)=1;
            }
        }
    }
    
    int ans=0;
    
    for(int i=0;i<N;i++){
        if(vec.at(i)==0){
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long
using P = pair<int,int>;

signed main(){

  int n, d, a; cin >> n >> d >> a;
  vector<int> x(n), h(n);
  vector<P> v(n);
  for(int i = 0; i < n; i++){
    cin >> x[i] >> h[i];
    v[i] = {x[i], h[i]};
  }
  sort(v.begin(),v.end(),[&](P x, P y){
    return x.first < y.first;
  });

  int ans = 0, dis = 0;
  queue<pair<int, int>> q;
  for(int i = 0; i < n; i++){
    while(!q.empty() && q.front().first < v[i].first){
      auto p = q.front(); q.pop();
      dis -= p.second;
    }
    v[i].second -= dis;
    if(v[i].second <= 0) continue;
    int t = (v[i].second + a-1) / a;
    q.push({v[i].first + d * 2, a * t});
    dis += a * t;
    ans += t;
  }
  cout << ans << endl;


  return 0;
}


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

class Dice{
	private:
		int temp;

	public:
		array<int,7> d;

		void set_eyes(int v1, int v2, int v3,
				int v4, int v5, int v6){
			d[1] = v1; d[2] = v2; d[3] = v3;
			d[4] = v4; d[5] = v5; d[6] = v6;
		}

		void rotate(char direction){
			switch(direction){
				case 'N':
					temp=d[1];
					d[1]=d[2]; d[2]=d[6]; d[6]=d[5]; d[5]=temp;	
					break;
				case 'E':
					temp=d[1];
					d[1]=d[4]; d[4]=d[6]; d[6]=d[3]; d[3]=temp;
					break;
				case 'S':
					temp=d[1];
					d[1]=d[5]; d[5]=d[6]; d[6]=d[2]; d[2]=temp;
					break;
				case 'W':
					temp=d[1];
					d[1]=d[3]; d[3]=d[6]; d[6]=d[4]; d[4]=temp;
					break;
			}
		}

		int return_top(){
			return d[1];
		}

		int return_front(){
			return d[2];
		}

		int return_right(){
			return d[3];
		}
};


int main(){
	int v1,v2,v3,v4,v5,v6={};
	int n;
	int t, f = {}; //top and front
	string directions;
	
	cin >>v1>>v2>>v3>>v4>>v5>>v6;
	cin >> n;

	Dice Dice1;

	for(int i=0;i<n;i++){
		Dice1.set_eyes(v1,v2,v3,v4,v5,v6);
		cin >> t >> f;

		while(Dice1.return_top() != t || Dice1.return_front() != f){
				for(int s=0; s<5; s++){
					if(Dice1.return_top() == t && Dice1.return_front() == f)
						break;
					Dice1.rotate('N');
				}
				for(int s=0; s<5; s++){
					if(Dice1.return_top() == t && Dice1.return_front() == f)
						break;
					Dice1.rotate('E');
				}
				for(int s=0; s<5; s++){
					if(Dice1.return_top() == t && Dice1.return_front() == f)
						break;
					Dice1.rotate('S');
				}
				for(int s=0; s<5; s++){
					if(Dice1.return_top() == t && Dice1.return_front() == f)
						break;
					Dice1.rotate('W');
				}
		}
		cout << Dice1.return_right() << endl;

	}

	return 0;
}

Measured memory_bytes: 3100
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;

#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll h, n;
    cin>>h>>n;
    ll sum = 0, a[n], i;
    for(i=0; i<n; i++) {
    	cin>>a[i];
    	sum += a[i];
    }
    if(sum >= h) {
    	cout<<"Yes\n";
    }else {
    	cout<<"No\n";
    }
}

Measured memory_bytes: 1024
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>
#include <iostream>

using namespace std;

int main(){
    string str;
    cin >> str;
    int n = str.length();
    printf("%s", str.c_str());
    if(str[n-1] == 's'){
        printf("es");        
    } else {
        printf("s");
    }
    
    return 0;
}


Measured memory_bytes: 3260
#include <stdio.h>

int depth(int);




struct Node{
  int parent,leftchild,rightbro;//左子右兄弟表現
};

struct Node node[100001];


int main(){

  int i,j,mom,k,n,child,x,bro;

  scanf("%d",&n);//number of node

  for(i = 0 ; i < n ; i++){
    node[i].parent = -1;
    node[i].leftchild = -1;
    node[i].rightbro = -1;
  }


  for(i = 0 ; i < n ; i++){//各nodeの入力
    scanf("%d %d",&mom,&k);
   
    for(j = 0 ; j < k ; j++){
      scanf("%d",&child);
      
      if(j == 0){
	node[mom].leftchild =child;
	node[child].parent = mom;
	x = child;
 }
      else{
	node[x].rightbro = child;
	node[child].parent = mom;
    	x = child;
      }
    }
  }
  for(i = 0 ; i < n ; i++){
      printf("node %d: parent = %d, depth = %d, ",i , node[i].parent,depth(i));
      if(node[i].leftchild == -1 && node[i].parent!= -1)printf("leaf, ");
      else if(node[i].parent == -1)printf("root, ");
      else if(node[i].leftchild != -1)printf("internal node, ");

      printf("[");

      if(node[i].leftchild != -1){

	printf("%d",node[i].leftchild);

	bro = node[i].leftchild;

	while(1){
	  if(node[bro].rightbro == -1)break;
	  printf(", %d",node[bro].rightbro);
	  bro = node[bro].rightbro;
	}
      }

      printf("]\n");
    }

  return 0;
}
int depth(int k){
  int dep = 0;
  for(dep = 0 ; node[k].parent != -1 ; dep++){
    k = node[k].parent;
  }
  return dep;
}



Measured memory_bytes: 2896
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>

using namespace std;

int main()
{   
    string N;
    cin >> N;
    if(N[0] == N[2]){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int (i)=0 ;(i)<(n);(i)++)
#define REPR(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(x) x.begin(),x.end()
#define REVERSE(x) reverse(x.begin(),x.end())
#define SORT(x,n) sort(x,x)
#define P pair<int,int>
typedef long long LL;
const int INF=1000000007;
using namespace std;
int gcd(int a,int b){
  if(a%b==0){return b;}
  else{return gcd(b,a%b);}
}
int main(){
int N,D;
cin>>N>>D;
int ans;
int wide=1+2*D;
for(int i=0;i*wide<N;i++){
    ans=i+1;
}
cout<<ans;
}

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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
mint ex(mint x, ll t) { return x.pow(t);}

ll powmod(ll x, ll y){
  ll res = 1;
  for (ll i=0; i<y; i++){
    res = res * x % mod;
  }
  return res;
}

int main() {
  ll n;
  cin >> n;
  mint ans = ex(10, n);
  ans -= ex(9, n) * 2;
  ans += ex(8, n);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3692
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
//#pragma GCC optimize("Ofast")  //デバッグ時にoptimized-outされて邪魔だった
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

ll solve(vll& A, vll& F, ll limit) {
  ll shugyo = 0;
  for(int i=0; i<A.size(); ++i) {
    if(limit < A[i] * F[i]) {
      //必要なA
      shugyo += A[i] - limit / F[i];
    }
  }
  
  return shugyo;
}

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  invar(int, N);
  invar(ll, K);
  
  vll A(N); vll F(N);
  rep(i, N) {
    cin >> A[i];
  }
  rep(i, N) {
    cin >> F[i];
  }
  
  sort(all(F)); //昇順
  sort(all(A)); //降順
  reverse(all(A));
  
  ll lb = -1;
  ll ub = 10000000000000;
  while(ub - lb > 1LL) {
    ll md = (ub - lb) / 2+ lb;
    if(solve(A, F, md) <= K) {
      //lower
      ub = md;
    } else {
      //upper
      lb = md;
    }
  }
  
  fin(ub);
}


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


int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    map<int,char> m;
    for(int i=0;i<n;i++){
        m.insert(make_pair(i,s[i]));
    }
    long long int cntt=0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(s[i]!=s[j]){
                int z=2*j-i;
                if(z>j && z>i && z<n){
                   if(m[z]!=s[i] && m[z]!=s[j]){
                       cntt++;
                   }
                }
            }
        }
    }
    long long int cnt1=0,cnt2=0,cnt3=0;
    
    for(int i=0;i<n;i++){
        if(s[i]=='R')cnt1++;
        if(s[i]=='G')cnt2++;
        if(s[i]=='B')cnt3++;
        
    }
    long long int f=cnt1*cnt2*cnt3;
    
    cout<<f-cntt<<endl;
    return 0;
}


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


#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T, class T2> void amax(T& a,T2 b){ if(a < b) a = b;}


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, a;
	cin >>n;
	map<int, int> mp;
	rep(i, n){ cin >>a; mp[a]++;}
	ll ans = 0;
	for(auto x: mp) ans += x.second&1;
	cout <<ans <<"\n";
	return 0;
}


Measured memory_bytes: 4992
#include <iostream> 
using namespace std ;
int main () {
	int a , b ;
	cin >> a >> b;
	if (a<b) {
		cout << "a < b" << endl;
	} else if (a>b) {
		cout << "a > b" << endl;
	} else {
		cout << "a == b" << endl;
	}
	return 0;
}


Measured memory_bytes: 3108
using System;

class AddSub
{

	static public void Main(string[] args)
	{
		string[] vals = Console.ReadLine().Split(' ');
		int A, B;

		A = int.Parse(vals[0]);
		B = int.Parse(vals[2]);
		if(vals[1] == "+")
		{
			Console.WriteLine(A+B);
		}
		else
		{
			Console.WriteLine(A-B);
		}
	}
}


Measured memory_bytes: 2776