akhauriyash/Code-Regression huggingface dataset:
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
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;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll MOD = 1e9 + 7;
ll INF = 1e18;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    ll m = n * 2;
    bool h = false;
    ll res;
    rep3(i,1,sqrt(m)){
        if(m%i==0){
            if(abs(m/i-i)==1){
                h = true;
                res = i;
                break;
            }
        }
    }
    if(!h){
        cout<<"No"<<endl;
        return 0;
    }
    cout << "Yes" << endl;
    ll temp = 0;
    VV Res(res + 1, V(res));
    cout << res + 1 << endl;
    rep(i,res+1){
        rep(j,res){
            if(i-(j+1)>=0){
                Res[i][j] = Res[i - (j + 1)][i - 1];
            }else{
                temp++;
                Res[i][j] = temp;
            }
        }
    }
    rep(i,res+1){
        cout << res <<" ";
        rep(j,res){
            cout << Res[i][j] << " ";
        }
        cout << endl;
    }
    
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

#define MAX_N (1<<18) //260000
template<typename T>
struct segtree{
    int n;
    T dat[2*MAX_N-1];
    T cnt[2*MAX_N-1];

    void init(int n_){
        n = 1;
        while(n < n_) n *= 2;
        for(int i = 0; i < 2*n-1; i++) dat[i] = 0;
    }

    void update(int k, T a){
        k += n-1;
        dat[k] += a;
        cnt[k]++;
        while(k > 0){
            k = (k-1)/2;
            dat[k] = dat[k*2+1] + dat[k*2+2];
        }
    }

    //(a,b,0,0,seg.n)で呼ぶ
    T query(int a, int b, int k, int l, int r){
        if(r <= a || b <= l) return 0;
        if(a <= l && r <= b) return dat[k];
        else{
            T vl = query(a,b,k*2+1,l,(l+r)/2);
            T vr = query(a,b,k*2+2,(l+r)/2,r);
            return vl + vr;
        }
    }
};

segtree<ll> seg_sum, seg_cnt;

#define X 200000LL

int n, m;
ll b[X+1];

int main() {
    cin >> n >> m;
    seg_sum.init(X+1);
    seg_cnt.init(X+1);
    rep(i,n) {
        int a; cin >> a;
        seg_sum.update(a, a);
        seg_cnt.update(a, 1);
    }
    ll ans = 0;
    rep(i,m) {
        int ib; cin >> ib; b[ib]++;
    }
    rep(i,X+1) {
        if (i == 0) continue;
        if (b[i] == 0) continue;
        for (ll j = 0; j <= X; j += i) {
            ll sum = seg_sum.query(j, min(j+i,X+1), 0, 0, seg_sum.n);
            ll cnt = seg_cnt.query(j, min(j+i,X+1), 0, 0, seg_cnt.n);
            ans += b[i] * (sum - cnt * j);
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 15952
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = int(input())
    c = collections.Counter(prime_factorize(n))
    li = list(c.values())
    ans = 0
    for i in li:
        k = i
        for j in range(60):
            k -= j
            if k < 0:
                ans += j - 1
                break
    print(ans)

 
 
if __name__ == '__main__':
  main()

Measured memory_bytes: 9464
#[allow(unused)]
use proconio::marker::*;
use proconio::{fastout, input};
#[allow(unused)]
use std::cmp::{max, min, Reverse};
#[allow(unused)]
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        p: [Usize1; n],
        xy: [(Usize1, Usize1); m],
    }

    let mut uf = UnionFind::new(n);
    for &(x, y) in xy.iter() {
        uf.unite(x, y);
    }

    let ans: usize = (0..n).filter(|&i| uf.same(i, p[i])).map(|_| 1).sum();
    println!("{}", ans);
}

struct UnionFind {
    parents: Vec<usize>,
    rank: Vec<usize>,
}

impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut vec = vec![0; n];
        for i in 0..n {
            vec[i] = i;
        }
        UnionFind {
            parents: vec,
            rank: vec![0; n],
        }
    }

    fn find(&self, x: usize) -> usize {
        if x == self.parents[x] {
            x
        } else {
            self.find(self.parents[x])
        }
    }

    fn unite(&mut self, x: usize, y: usize) {
        let px = self.find(x);
        let py = self.find(y);
        if px == py {
            return;
        }

        if self.rank[px] < self.rank[py] {
            self.parents[px] = py;
        } else {
            self.parents[py] = px;
            if self.rank[px] == self.rank[py] {
                self.rank[px] += 1;
            }
        }
    }

    fn same(&self, x: usize, y: usize) -> bool {
        self.find(x) == self.find(y)
    }
}


Measured memory_bytes: 7588
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = vector<T>;
using vvi = vector<vector<int>>;

int main(){
  int n,s=0;
  cin >> n;
  int a = n;
  while(a > 0){
    s += a%10;
    a/=10;
  }

  cout << (n%s == 0 ? "Yes" : "No") << endl;
  return 0;
}


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

signed main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n; cin >> n;
  string s; cin >> s;
  vector<int> cw(n + 1, 0), ce(n + 1, 0);
  for (int i = 0; i < n; i++) {
    cw[i + 1] = cw[i] + (s[i] == 'W');
  }
  for (int i = n - 1; i >= 0; i--) {
    ce[i] = ce[i + 1] + (s[i] == 'E');
  }
  int res = 1e9;
  for (int i = 0; i <= n; i++) {
    res = min(res, cw[i] + ce[i]);
  }
  cout << res << '\n';
  return 0;
}

Measured memory_bytes: 2964
#include <stdio.h>

int main(void){
    int n;
    scanf("%d",&n);

    int s[n];
    int i;
    for(i=0;i<n;i++){
        scanf("%d",&s[i]);
    }
    for(i=0;i<n;i++){
        if(s[i]%2 == 0){
            /*偶数のとき*/
            if(s[i]%3 != 0 && s[i]%5 !=0){
                printf("DENIED\n");
                return 0;
            }
        }
    }printf("APPROVED\n");
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;

int main(){
    int n;
    cin>>n;
    pair<int,int> p[n];
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        p[i]={a,i+1};
    }
    sort(p,p+n);
    for(int i=0;i<n;i++){
        if(i)cout<<" ";
        cout<<p[i].second;
    }
    cout<<endl;
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mod 1000000007
int getTheAnswer() {
    return 42;
}

using namespace std;
using ll=long long;

class ATakahashikunTheStrider {
public:
	void solve(std::istream& cin, std::ostream& cout) {
        int x;
        cin>>x;
        int hcf=__gcd(x,360);
        int lcm=(x*360)/hcf;
        cout<<lcm/x<<endl;
	}
};


int main() {
	ATakahashikunTheStrider solver;
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main() {
	int a,b,c;
	cin>>a>>b>>c;
	if (a==b)  
	{
	    if(a==c)
	    {
	        cout<<1;
	    }
	    else 
        {
            cout<<2;
            
        }
	}
	if(a!=b)
	{
	    if(a!=c)
	    {
	        if(b!=c)
	        {
	            cout<<3;
	        }
	        else
	         {
	             cout<<2;
	         }
	    }
	    else
	    {
	        cout<<2;
	    }
	}
	return 0;
}

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

public class Main {
    public static void main(String[] args) throws Exception {
        solve(System.in, System.out);
    }

    static void solve(InputStream is, PrintStream os) {
        Scanner scan = new Scanner(is);
        int M = scan.nextInt();
        int D = scan.nextInt();

        if(M < 4 || D < 22) {
            os.println(0);
            return;
        }

        int answer = 0;

        for(int i = 4; i <= M; i++) {
            if(i > 81)
                break;
            for(int j = 22; j <= D; j++) {
                int d10 = j / 10;
                int d1 = j % 10;
                if(d10 >= 2 && d1 >=2 && i == d10 * d1) {
                    answer++;
                }
            }
        }
        os.println(answer);
    }
}

Measured memory_bytes: 23124
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
#define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl

void vprn(vector<int> &v){ for(int i=0;i<v.size();i++) cout<<v[i]<<(i<v.size()-1?",\t":"\n"); }
void vvprn(vector<vector<int>> &vv){ for(auto v:vv) vprn(v); }

int cp(tuple<string,int,int> &a, tuple<string,int,int> &b){
	string as,bs; int ap,bp,ai,bi;
	tie(as,ap,ignore) = a;
	tie(bs,bp,ignore) = b;
	if(as!=bs) return as<bs;
	return ap>bp;
}

int main(){
	int n; cin>>n;
	vector<tuple<string,int,int>> sp;
	rp(i,n){
		string s; int p; cin>>s>>p;
		sp.push_back(make_tuple(s,p,i+1));
	}

	sort(sp.begin(),sp.end(),cp);
	// sort(sp.begin(),sp.end());

	for(auto e:sp){
		string s; int p,i;
		tie(s,p,i) = e;
		// cout<<s<<","<<p<<","<<i<<"\n";///
		cout<<i<<endl;
	}

}

Measured memory_bytes: 256
import os
import sys
from io import BytesIO, IOBase


def solution():
    pass


def main():
    s = input()
    write("ABC" if s == "ARC" else "ARC")


# fast-io region

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input():
    return sys.stdin.readline().rstrip("\r\n")


def write(*args, end='\n'):
    for x in args[:-1]:
        sys.stdout.write(str(x) + ' ')
    sys.stdout.write(str(args[-1]))
    sys.stdout.write(end)


def r_array():
    return [int(x) for x in input().split()]


def r_int():
    return int(input())


if __name__ == "__main__":
    main()


Measured memory_bytes: 62840
#include <bits/stdc++.h>
 
using namespace std;
int A[200000];
int main(){
	int n, k;
	cin >> n >> k;
	int sum = 0;
	for(int i = 0; i < n; i++){
		cin >> A[i];
		A[i]++;
	}
	for(int i = 0; i < k; i++){
		sum += A[i];
	}
	int ans = sum;
	for(int i = 0; i < n - k; i++){
		sum += A[i + k] - A[i];
		ans = max(ans, sum);
	}
	cout << fixed << setprecision(10) << (long double) ans / 2;
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n,k;
    cin >> n >> k;
    VLL a(n);
    REP(i,0,n) cin >> a[i];
    sort(all(a));
    reverse(all(a));
    LL ans = 0;
    REP(i,k,n) ans += a[i];
    cout << ans << endl;
}

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

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
main()
{  stack<char>q;
    string s;
    cin>>s;
    int sz=s.size();
    int cnt=0;
    for(int i=0;i<sz;i++)
    {
        if(q.empty())
        {
            q.push(s[i]);
            continue;
        }
        char c=q.top();
        if(c!=s[i])
        {
            q.pop();
            cnt=cnt+2;
        }
        else
        {
            q.push(s[i]);
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
    char s[2][3];
    cin >> s[0] >> s[1];
    if(s[0][0]==s[1][2]&&s[0][1]==s[1][1]&&s[0][2]==s[1][0]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	m := getNextInt(scanner)
	k := getNextInt(scanner)

	cm := Com{}
	cm.init(n * m)
	var ans int64
	for i := 1; i < n; i++ {
		ans += int64(i) * int64(n-i) * int64(m) * int64(m)
		ans %= cm.mod
	}
	for i := 1; i < m; i++ {
		ans += int64(i) * int64(m-i) * int64(n) * int64(n)
		ans %= cm.mod
	}

	ans *= cm.calc(n*m-2, k-2)
	ans %= cm.mod

	fmt.Fprintln(writer, ans)
	writer.Flush()
}

// Com ...
type Com struct {
	facs, invs []int64
	mod        int64
}

func (cm *Com) init(n int) {
	cm.facs = make([]int64, n+1)
	cm.invs = make([]int64, n+1)

	cm.facs[0] = 1
	cm.mod = int64(1e9 + 7)
	for i := 1; i <= n; i++ {
		cm.facs[i] = (cm.facs[i-1] * int64(i)) % cm.mod
	}
	cm.invs[n] = cm.inv(cm.facs[n])
	for i := n - 1; i >= 0; i-- {
		cm.invs[i] = cm.invs[i+1] * int64(i+1) % cm.mod
	}
}

func (cm *Com) inv(n int64) int64 {
	var ii [32]int64
	ii[0] = n
	for i := 1; i < 31; i++ {
		ii[i] = (ii[i-1] * ii[i-1]) % cm.mod
	}
	var ans int64
	ans = 1
	m := cm.mod - 2
	for i := 30; i >= 0; i-- {
		for m >= 1<<uint(i) {
			ans = (ans * ii[i]) % cm.mod
			m -= 1 << uint(i)
		}
	}

	return ans
}

func (cm *Com) calc(n, k int) int64 {
	ans := cm.facs[n] * cm.invs[k]
	ans %= cm.mod
	ans = ans * cm.invs[n-k]
	ans %= cm.mod
	return ans
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n); i++)
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
using namespace std;
using ll = long long;

int main() {
  int n;
  cin >> n ;
  int x = n % 10;
  if(x == 3) cout << "bon" << endl;
  else if(x == 0 || x == 1 || x == 6 || x == 8) cout << "pon" << endl;
  else cout << "hon" <<endl;
  return 0;
}

Measured memory_bytes: 3632
#define  _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#pragma comment (linker, "/STACK:526000000")

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = time(NULL);
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}

#define int ll
void solve() {
	while (true) {
		int t, d, l;
		cin >> t >> d >> l;
		if (t == 0) return;
		int now = 0;
		int ans = 0;
		REP(i, t) {
			int geko;
			cin >> geko;
			now--;
			if (now > 0) {
				ans++;
			}
			if (geko >= l) {
				now = d+1;
			}
		}
		cout << ans << endl;
	}
}
#undef int
int main() {
	init();
	solve();
}


Measured memory_bytes: 3144
#include <cstdio>

int main(){
	
	int n, m;
	scanf("%d %d", &n, &m);
	int ans = 0;
	int ch;
	for(int i =0; i < m; i++){
		scanf("%d", &ch);
		ans += ch;
	}
	if(n > ans)
		printf("No");
	else
		printf("Yes");
	
	
	
	
	
	
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
int main() {
  map<string, int> ans;

  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    ans[temp]++;
  }

  string str[] = {"AC", "WA", "TLE", "RE"};

  for (int i = 0; i < 4; i++) {
    cout << str[i] << " x " << ans[str[i]] << endl;
  }
}

Measured memory_bytes: 3604
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_solve
{
    class Program
    {
        public const ulong mod = 1000000007;

        static void Main(string[] args)
        {
            var abc = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ans = 0;

            int max = abc.Max();
            int sum = abc.Sum();

            if (max % 2 == 0)
            {
                if (sum % 2 == 0) ans = (3 * max - sum) / 2;
                else ans = (3 * (max + 1) - sum) / 2;
            }
            else
            {
                if (sum % 2 == 0) ans = (3 * (max + 1) - sum) / 2;
                else ans = (3 * max - sum) / 2;
            }
            Console.WriteLine(ans);



            
        }

        static public long Input()
        {
            return long.Parse(Console.ReadLine());
        }

        static public string[] Input2()
        {
            return Console.ReadLine().Split();
        }
        
        static public long[] Input3()
        {
            string[] data = Console.ReadLine().Split();
            long[] res = new long[data.LongLength];
            for(long i = 0; i < data.LongLength; i++)
            {
                res[i] = long.Parse(data[i]);
            }
            return res;
        }
        public static long Choose(long n, long a)
        {
            long x = 1;
            long y = 1;
            for (long i = 0; i < a; i++)
            {
                x *= n - i;
                y *= i + 1;
            }
            return x / y;
        }

        public static long Gcd(long a, long b)
        {
            long x = Math.Max(a, b);
            long y = Math.Min(a, b);
            if (x % y == 0) return y;
            else return Gcd(y, x % y);
        }
    }
}


Measured memory_bytes: 13396
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC162A
{
    class Program
    {
        static void Main(string[] args)
        {
            string N = Console.ReadLine();
            int hantei = -1;
            for (int i= 0;i< 3; i++)
            {
                if (N.Substring(i,1) == "7")
                {
                    hantei = 0;
                }
            }
            if (hantei == 0)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 25880
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[4];
    cin>>a[1]>>a[2]>>a[3];
    sort(a+1,a+4);
    int ans=0;
    for(int i=2;i<=3;i++){
        ans+=a[i]-a[i-1];
    }
    cout<<ans;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let v: Vec<char> = get!(String).chars().collect();
    let mut ans:usize = 0;
    let mut count:usize = 0;
    for i in v.iter() {
        if *i == 'W' {
            ans += count;
        } else {
            count += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	//static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
	
	
	
	public static void main(String[] args) {
		//int N=sc.nextInt();for(int i=0;i<N;i++) {}
		//M 77 || //A 65 || //R 82 || //C 67 || //H 72 || 
		int A=sc.nextInt();
		int P=sc.nextInt()	;
		
		
		P+=A*3;
		p(P/2);
		
	
		
		
	}



	
	
	
	

	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	
}
	


Measured memory_bytes: 21844
// template {{{
#![allow(clippy::many_single_char_names)]

#[allow(dead_code)]
mod ngtio {
    use ::std::collections::VecDeque;

    pub struct Buffer {
        buf: VecDeque<String>,
    }

    impl Buffer {
        pub fn new() -> Self {
            Self {
                buf: VecDeque::new(),
            }
        }

        fn load(&mut self) {
            while self.buf.is_empty() {
                let mut s = String::new();
                let length = ::std::io::stdin().read_line(&mut s).unwrap();
                if length == 0 {
                    break;
                }
                self.buf.extend(s.split_whitespace().map(|s| s.to_owned()));
            }
        }

        pub fn string(&mut self) -> String {
            self.load();
            self.buf
                .pop_front()
                .unwrap_or_else(|| panic!("入力が終了したのですが。"))
        }

        pub fn string_char_vec(&mut self) -> Vec<char> {
            let s = self.string();
            s.chars().collect::<Vec<_>>()
        }

        pub fn string_char_vec_trusted_len(&mut self, len: usize) -> Vec<char> {
            let s = self.string();
            let s = s.chars().collect::<Vec<_>>();
            assert_eq!(s.len(), len, "あら、思ったのと長さ違いますね……");
            s
        }

        pub fn char(&mut self) -> char {
            let string = self.string();
            let mut chars = string.chars();
            let res = chars.next().unwrap();
            assert!(
                chars.next().is_none(),
                "char で受け取りたいのも山々なのですが、さては 2 文字以上ありますね？"
            );
            res
        }

        pub fn read<T: ::std::str::FromStr>(&mut self) -> T
        where
            <T as ::std::str::FromStr>::Err: ::std::fmt::Debug,
        {
            self.string()
                .parse::<T>()
                .expect("Failed to parse the input.")
        }

        pub fn read_vec<T: ::std::str::FromStr>(&mut self, len: usize) -> Vec<T>
        where
            <T as ::std::str::FromStr>::Err: ::std::fmt::Debug,
        {
            (0..len).map(|_| self.read::<T>()).collect()
        }
    }

    macro_rules! define_primitive_reader {
        ($($ty:tt,)*) => {
            impl Buffer {
                $(
#[inline]
                    pub fn $ty(&mut self) -> $ty {
                        self.read::<$ty>()
                    }
                )*
            }
        }
    }

    define_primitive_reader! {
        u8, u16, u32, u64, usize,
        i8, i16, i32, i64, isize,
    }

    impl Default for Buffer {
        fn default() -> Self {
            Self::new()
        }
    }
}

#[allow(unused_imports)]
use std::{collections, iter, mem, ops};
// }}}

fn main() {
    let mut buf = ngtio::Buffer::new();
    let n = buf.u64();
    let ans = (1..=n).map(|a| (n - 1) / a).sum::<u64>();
    println!("{}", ans);
}


Measured memory_bytes: 2120
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int N;
  cin >> N;
  long int power = 1;
  int a = 1000000007;
 
  for(int i = 1; i <= N; i++){
    power = power * i % a;
    //解説
    //1*1%(10^9+7)==1
    //1*2%(10^9+7)==2
    //2*3%(10^9+7)==6
    //6*4%(10^9+7)==24
    //24*5%(10^9+7)==120
    //という仕組み
  }
  cout << power << endl;
}

Measured memory_bytes: 256
void main()
{
    long n = readln.chomp.to!long;
    long[] a = readln.split.to!(long[]);

    long num = 1;
    long cnt;
    foreach (x; a)
    {
        if (x == num) ++num;
        else ++cnt;
    }

    writeln(cnt != n ? cnt : -1);
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 11664
from collections import Counter
n = int(input())

a = list(map(int, input().split()))
c = Counter(a)
f = [0,0]
for k in c.keys():
    if c[k] >= 2:
        f.append(k)
    if c[k] >= 4:
        f.append(k)

f.sort()

[a, b] = f[-2:]

print(a*b)

Measured memory_bytes: 22248
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;


#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((int)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<int>>

using namespace std;


int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,K;
    cin >> N >> K;
    string S;
    cin >> S;
    vector<ll> daiji;
    for(int i = 0; i < N;i++){
        char c = S[i];
        ll count = 0;
        while(S[i] == c){
            count++;
            i++;
        }
        i--;
        daiji.push_back(count);
    }
    if(daiji.size() <= 2*K+1 && S[0] == '1'){
        cout << N << endl;
        return 0;
    }else if(daiji.size() <= 2*K && S[0] == '0'){
        cout << N << endl;
        return 0;
    }
    ll max = 0;
    if(S[0] == '1'){
        if(S[S.size()-1] == '0'){
             for(int i = 0; i < daiji.size()-(2*K-1);i++){
                if(i%2 == 0){
                    ll tmp=0;
                    for(int j = i; j < i+2*K+1;j++){
                        tmp += daiji[j];
                    }
                    if(max < tmp) max = tmp;
                }
            }

        }else{
            for(int i = 0; i < daiji.size()-(2*K);i++){
                if(i%2 == 0){
                    ll tmp=0;
                    for(int j = i; j < i+2*K+1;j++){
                        tmp += daiji[j];
                    }
                    if(max < tmp) max = tmp;
                }
            }
        }

    }else{
        if(S[S.size()-1] == '0'){
            ll tmp = 0;
            for(int i = daiji.size()-2*K; i < daiji.size();i++){
                tmp += daiji[i];
            }
             if(max < tmp) max = tmp;
        }
        for(int i = 0; i < daiji.size()-(2*K);i++){
            if(i%2 == 0){
                ll tmp=0;
                for(int j = i; j < i+2*K;j++){
                    tmp += daiji[j];
                }
                if(max < tmp) max = tmp;
            }else{
                ll tmp=0;
                for(int j = i; j < i+2*K+1;j++){
                    tmp += daiji[j];
                }
                if(max < tmp) max = tmp;
                
            }
        }
    }
    cout << max << endl;
    

    

    return 0;
}

Measured memory_bytes: 1528
from collections import deque
n = int(input())

al = []
for i in range(n):
    an = int(input())
    a = [list(map(int, input().split())) for _ in range(an)]
    al.append(a)

def is_ok(state):
    true_numbers = [i for i in range(n) if state & (1 << i)]

    visited = [False] * n
    que = deque(true_numbers)
    while que:
        target = que.popleft()
        if not visited[target]:
            visited[target] = True

            for av in al[target]:
                tf = bool(state & (1 << (av[0] - 1)))
                if tf != av[1]:
                    return False
                if tf:
                    que.append(av[0] - 1)

    # for number in true_numbers:
    #     for av in al[number]:
    #         if state & (1 << (av[0] - 1)) != av[1]:
    #             return 0
    return len(true_numbers)

print(max(is_ok(state) for state in range(2**n)))

# for state in range(2**n):
#     # print(f"%0{n}d" % int(bin(state)[2:]))
#     print(is_ok(state))
#
# # pass
# # state = int('010', 2)
# # print(is_ok(state))


Measured memory_bytes: 3316
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>

using namespace std;

int main() {
	int n,m,l;
	cin >> n >> m >> l;
	
	vector< vector<long> > a (n, vector<long>(m));
	vector< vector<long> > b (m, vector<long>(l));
	vector< vector<long> > c (n, vector<long>(l,0));
	
	// read matrix a
	for(int i=0;i<n;i++) 
		for(int j=0;j<m;j++) 
			cin >> a[i][j];

	// read matrix b
	for(int i=0;i<m;i++) 
		for(int j=0;j<l;j++) 
			cin >> b[i][j];

	// calc product
	for(int i=0;i<n;i++) 
		for(int j=0;j<l;j++) 
			for(int k=0;k<m;k++)
				c[i][j] += a[i][k]*b[k][j];
		
	
	for(int i=0;i<n;i++) {
		for(int j=0;j<l;j++) {
			if (j<l-1)
				cout << c[i][j] << " ";
			else
				cout << c[i][j]; // ridiculous logic to suite testcase expects 
		}
		cout << endl;
	}
	return 0;
}




Measured memory_bytes: 3180
#include <bits/stdc++.h>
 
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

int n;

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

    string s;
    cin >> s;
    int n = 0;
    for (char c : s) {
        n += c - '0';
        n %= 9;
    }
    if (n) cout << "No\n";
    else cout << "Yes\n";

    return 0;
}

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

int main() {
  long long N,count=1;
  cin>>N;
  vector<int> data(N),jump(N);
  rep(i,N){cin>>data[i];}
  jump[0]=data[0];
  for(int i=1;i<=N+1;i++){jump[i]=data[jump[i-1]-1]; if(jump[i-1]==2){break;} count++;}
  
  if(count>=N){cout<<-1<<endl;}
  else {cout<<count<<endl;}
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;


long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }

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

    vector<int> a(n);
    rep(i,n) cin >> a[i];

    ll ans = a[0];
    rep(i,n){
        ans = GCD(ans, a[i]);
    }

    dunk(ans);

}    

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  ll n;
  cin >> n;

  string s = to_string(n);

  int keta = s.size();

  ll ans = s[0] - '0';
  bool ok = true;
  for (int i = 1; i < keta; i++) {
    ans += 9;
    if (s[i] != '9') {
      ok = false;
    }
  }

  if (!ok) {
    ans--;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
def solve(A,B):
  if A==B:
    return 0,A[:]
  a1 = 0
  for p1 in range(len(A)):
    if A[p1]>0:
      A[p1] -= 1
      a2 = 9999
      for p2 in range(len(B)):
        if B[p2]>0:
          B[p2] -= 1
          a,b = solve(A,B)
          a += 1
          if a<a2:
            a2 = a
            b2 = b
          B[p2] += 1
      if a2>a1:
        a1 = a2
        b1 = b2
      A[p1] += 1
  return a1,b2

#print solve([1,3], [2,2]) # (2, [1, 2])
#print solve([8,0,4], [3,1,8]) # (9, [3,0,0])
#print solve([3,3,1,1], [1,1,3,3]) # (7, [1, 0, 0, 0])
#print solve([4,3,1,1], [2,1,3,3]) # (8, [1, 0, 0, 0])
#print solve([2,2,3,1], [2,2,1,3]) # (7, [1, 0, 0, 0])
#print solve([2,2,2,0], [1,1,1,3]) # (5, [1, 0, 0, 0])
#print solve([1,1,1,0], [0,0,0,3]) # (3, [0, 0, 0, 0])
#print solve([1,2,1,0], [0,1,0,3]) # (4, [0, 0, 0, 0])
#print solve([1,2,2,0], [0,1,1,3]) # (5, [0, 0, 0, 0])
#print solve([3,3,3,0], [2,2,2,3]) # (7, [2, 0, 0, 0])

N = input()
A,B = [0]*N, [0]*N
for i in range(N):
  A[i], B[i] = map(int, raw_input().split())
t = 9999999999
for i in range(N):
  if A[i]>B[i]:
    t = min(t, B[i])
if t==9999999999:
  print 0
else:
  print sum(B)-t


Measured memory_bytes: 4608
import java.util.*;
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		String line = br.readLine();
		String[] str = line.split(" ");
		int[] a = new int[n];
		int max = 0;
		for (int i=0; i<n; i++) {
			a[i] = Integer.parseInt(str[i]);
			max = Math.max(max,a[i]);
		}

		int ans = a[0];
		for (int i=1; i<n; i++) {
			int gcd = gcd(ans,a[i]);
			ans = ans*a[i]/gcd;
		}

		System.out.println(ans);

		br.close();
	}

	static int gcd(int x,int y) {
		if (y == 0)
			return x;
		else
			return gcd(y,x%y);
	}
}

Measured memory_bytes: 17096
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <iostream> 
#include <iomanip>  
#include <string>
#include <sstream>  
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <cstring>
#include <cmath>
#include <cassert>


#define INF              (int)1000000007
#define EPS              1e-9
#define pb               push_back
#define mp               make_pair
#define all(c)           c.begin(), c.end()
#define forall(i,a,b)    for(int i=a;i<(b);++i)
#define trav(a,x)        for(auto & a: x)
#define in(a,b)          ((b).find(a) != (b).end())
#define sz(c)            (int)(c).size()
#define input(a)         for(auto & x : a) cin >> x;

using namespace std;

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

#ifdef DEBUG
#define trace(...)       __f(#__VA_ARGS__, __VA_ARGS__)
#define debug(args...)   {dbg,args; clog<<endl;}
#define print_( a )      for( auto & x : a ) clog << x << ' '; clog << '\n';
#define printPair_( a )  for( auto & x : a ) clog << '(' << x.first << ',' << x.second << ')' << ' '; clog << '\n';
#else
#define trace(...)       
#define debug(args...)            
#define print_( a )               
#define printPair_( a )           
#endif

struct debugger {
  template<typename T> debugger& operator , (const T& x) {    
    clog << x << " ";    return *this;    
  }
}dbg;

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " | ";
    __f(comma + 1, args...);
}

auto ____ =[]() { std::ios::sync_with_stdio(0); cin.tie(0); return nullptr; }();

int main( int argc, char * argv[] ){
  int n; cin >> n; 
  vi v(n); input(v);
  sort(all(v));
  ll ans = 0;
  forall(i,0,n){
    forall(j,i+1,n){
      int low = upper_bound(all(v), v[j]-v[i]) - v.begin();
      int hi = lower_bound(all(v), v[j]+v[i]) - v.begin();
      ans += hi-low;
      if( i >= low and i < hi ) ans --;
      if( j >= low and j < hi ) ans --;
    }
  }
  cout << ans/3 << endl;
  return 0;
}


Measured memory_bytes: 256
import itertools

s = str(input())
a = list(itertools.permutations(['dream', 'dreamer', 'erase', 'eraser']))

for i in a:
    t = s.replace(i[0], '')
    t = t.replace(i[1], '')
    t = t.replace(i[2], '')
    t = t.replace(i[3], '')
    if not t:
        print('YES')
        exit()

print('NO')


Measured memory_bytes: 49392
#include <bits/stdc++.h>
#define ll long long
const int MOD = 1e9 + 7;
using namespace std;
int main() {
    int N;
    cin >> N;
    vector <int> adj[N];
    int a,b;
    vector< pair<int,int> > vp;
    for (int i = 0; i < N-1; ++i) {
        cin >> a >> b;
        a--,b--;
        adj[a].emplace_back(b);
        adj[b].emplace_back(a);
        vp.emplace_back(a,b);
    }
    queue <int> q;
    map <pair<int,int>, int> I;
    q.emplace(0);
    int k = 1;
    vector <int> col(N,0);
    vector <bool> vis(N,false);
    vis[0] = true;
    while(!q.empty()) {
        int f = q.front();
        k = max(k,(int)adj[f].size());
        q.pop();
        int cur = 1;
        for(int u : adj[f]) {
            if (vis[u] == true)
                continue;
            if (col[f] == cur)
                cur++;
            col[u] = I[make_pair(u,f)] = I[make_pair(f,u)] = cur++;
            q.emplace(u);
            vis[u] = true;
        }
    }
    cout << k << "\n";
    for(auto p : vp)
        cout << I[p] << endl;
    return 0;
}

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


int n, ct;
int x[105], y[105], h[105];

int max(int x, int y) {
	if (x > y)return x;
	else return y;
}
bool isct(int a, int b) {
	int h0 = abs(a-x[ct])+abs(b-y[ct])+ h[ct];
	for (int i = 1; i <= n; ++i)
		if (max(0, h0-(abs(a - x[i]) + abs(b - y[i]))) != h[i]) 
			return false;
	return true;
}

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> x[i] >> y[i] >> h[i];
	for (int i = 1; i <= n; i++)
		if (h[i] != 0) ct = i;
	for (int i = 0; i <= 100; ++i)
		for (int j = 0; j <= 100; ++j) {
			if (isct(i, j)) {
				cout << i << " " << j << " " << abs(i - x[ct]) + abs(j - y[ct]) + h[ct] << endl;
				return 0;
			}
		}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
// typedef long double ldouble;

using Graph = vector<vector<int>>;

// int ctoi(const char c){
//   if('0' <= c && c <= '9') return (c-'0');
//   return -1;
// }

// int gcd(int a, int b){
//   int ma = max(a,b);
//   int mi = min(a,b);
//   if(mi == 0) return ma;

//   return gcd(mi, ma%mi);
// }

// llong POW(llong a, llong b){
//   if(b == 0) return 1;
//   else{
//     if(b%2 == 0) return POW(a * a % MOD, b / 2) % MOD;
//     else return a * POW(a * a % MOD, b / 2) % MOD;
//   }
// }

int main(){
  int N;
  double M;
  cin >> N >> M;
  vector<double> A(N);
  double sum = 0;
  int cnt = 0;
  for(int i=0; i<N; ++i){
    cin >> A[i];
    sum += A[i];
  }
  for(int i=0; i<N; ++i){
    if(A[i] >= sum/4/M) ++cnt;
  }
  if(cnt < (int) M) cout << "No" << endl;
  else cout << "Yes" << endl;
}

Measured memory_bytes: 3728
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    int n;
    cin>>n;
    ll a[n],b[n];
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    ll ans=0;
    for(int d=32;d>=0;--d){
        rep(i,n)a[i]%=(1ll<<(d+1));
        rep(i,n)b[i]%=(1ll<<(d+1));
        sort(a,a+n);
        sort(b,b+n);
        ll cnt=0;
        ll cur=1LL<<d;
        rep(i,n){
            if(a[i]>=cur){
                cnt+=lower_bound(b, b+n, 2*cur-a[i])-b+n-(lower_bound(b, b+n, 3*cur-a[i])-b);
            }
            else cnt+=lower_bound(b, b+n,2*cur-a[i])-lower_bound(b, b+n,cur-a[i]);
        }
        ans+=(cnt%2)*(1LL<<d);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<string>> vec(H, vector<string>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cin >> vec.at(i).at(j);
    }
  }
  vector<char> vec_alpha(26);
  vec_alpha = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
  
  for(int k=0; k<H; k++){
    for(int l=0; l<W; l++){
      if(vec.at(k).at(l) == "snuke"){
        cout << vec_alpha.at(l) << k+1 << endl;
      }
    }
  }
  
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){


int a,b,c;

cin>>a>>b>>c;

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

return 0;
}

Measured memory_bytes: 3100
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    ll h[n];
    for(int i = 0;i < n;i++)
    {
        cin >> h[i];
    }
    ll dp[n] = {0,fabs(h[1] - h[0])};
    for(int i = 2;i < n;i++)
    {
        dp[i] = min(dp[i - 1] + fabs(h[i] - h[i - 1]),dp[i - 2] + fabs(h[i] - h[i - 2]));
    }
    cout << dp[n - 1] << "\n";

    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

void counting_sort(vector<int>& A){
    int max_a = *max_element(A.begin(), A.end());
    vector<int> C(max_a + 1, 0);
    for (const auto& a : A) C[a]++;
    for (int i = 1; i < C.size(); i++) C[i] += C[i-1];
    vector<int> B(A.size());
    for (int i = A.size() - 1; i >= 0; i--) B[(C[A[i]]--)-1] = A[i];
    for (int i = 0; i < A.size(); i++) A[i] = B[i];
}

int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    for (auto& a : A) cin >> a;
    counting_sort(A);
    for (int i = 0; i < n; i++) {
        cout << A[i] << (i < n - 1 ? " " : "\n");
    }
    return 0;
}

Measured memory_bytes: 18396
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(){
  int i,j,n,k,r,s,p,ans=0;
  char t[100010]={};
  scanf("%d %d %d %d %d %s",&n,&k,&r,&s,&p,t);
  for(i=0; i<k; i++){
    if(t[i]=='r')ans+=p;
    if(t[i]=='s')ans+=r;
    if(t[i]=='p')ans+=s;
  }
  for(i=k; i<n; i++){
    if(t[i]!=t[i-k]){
      if(t[i]=='r')ans+=p;
      if(t[i]=='s')ans+=r;
      if(t[i]=='p')ans+=s;
    }
    else t[i]='m';
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 1832