akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include <cassert>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;

int main() {
    int N;
    cin >> N;
    map<int, int> m;
    rep(i, N) {
        int tmp;
        cin >> tmp;
        m[tmp]++;
    }
    const uint64_t mod = 1000000000 + 7;
    if(N % 2 == 0) {
        for(auto itr: m) {
            //cout << itr.first << " " << itr.second << endl;
            if(itr.first == 0 || itr.first % 2 == 0 || itr.second != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        N /= 2;
    } else {
        if(m[0] != 1) {
            cout << 0 << endl;
            return 0;
        }
        m.erase(0);

        for(auto itr: m) {
            //cout << itr.first << " " << itr.second << endl;
            if(itr.first % 2 == 1 || itr.second != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        N -= 1;
        N /= 2;
    }
    uint64_t ret = 1;
    for(int i=0; i<N; ++i) {
        ret *= 2;
        ret %= mod;
    }
    cout << ret << endl;
    return 0;
}



Measured memory_bytes: 6108
#include <random>

#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld eps = 1e-12;
constexpr int inf = numeric_limits<int>::max() / 2;
constexpr ll mod = 1e9 + 7;
mt19937_64 rnd{random_device()()};

template <typename T>
void printv(const vector<T> &v) {
  int sz = v.size();
  for (int i = 0; i < sz; i++) {
    cout << v[i] << " \n"[i == sz - 1];
  }
}

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

  int n, k;
  cin >> n >> k;
  vector<long double> a(n), sum(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      sum[i] = log(a[i]);
    else
      sum[i] = sum[i - 1] + log(a[i]);
  }
  long double before = sum[k - 1];
  for (int i = k; i < n; i++) {
    long double tmp = sum[i] - sum[i - k];
    cout << (before + eps < tmp ? "Yes" : "No") << endl;
    before = tmp;
  }
}


Measured memory_bytes: 9532
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr int INF = 1e9;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] % 2 != 0) continue;
    while (a[i] % 2 == 0) {
      res++;
      a[i] /= 2;
    }
  }
  cout << res << endl;
  return 0;
} 

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <set>

using namespace std;

template <typename T>
bool contains(const set<T> &xs, const T &v) {
    return xs.find(v) != xs.end();
}

int main(int argc, char const *argv[]) {
    int X, N;
    cin >> X >> N;
    if (N == 0) {
        cout << X << endl;
        return 0;
    }
    set<int> p;
    for (int i = 0; i < N; ++i) {
        int x;
        cin >> x;
        p.insert(x);
    }
    for (int i = 0; i < 100; ++i) {
        if (!contains(p, X - i)) {
            cout << (X - i) << endl;
            return 0;
        }
        if (!contains(p, X + i)) {
            cout << (X + i) << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3180
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main(){
	int a;
	cin >> a;
	if (a < 1200){
		cout << "ABC" << endl;
	}
	else{
		cout << "ARC" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
// 2020 03/24 B - String Palindrome 回文

#include <iostream>
#include <string>
using namespace std;

bool isPalindrome(string s) {
    string t = s;
    reverse(t.begin(), t.end());
    return s == t;
}

int main(){
    string s;
    cin >> s;
    bool ans = true;
    if (!isPalindrome(s)) ans = false;
    if (!isPalindrome(s.substr(0, s.size()/2))) ans = false;
    // substr 部分文字列を取得
    // 切り捨て

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 632
#include "bits/stdc++.h"
using namespace std;

// Inserted snippets: euclid, io, modint, root
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
ll euclid(ll a, ll b, ll &x, ll &y) {
	if (b) { ll d = euclid(b, a % b, y, x);
		return y -= a/b * x, d; }
	return x = 1, y = 0, a;
}
template<ll MOD = 1'000'000'007>
struct Mod {
	ll val;
	Mod() : val(0) {}
	Mod(ll xx) {
		if (0 <= xx && xx < MOD) val = xx;
		else val = (xx % MOD + MOD) % MOD;
	}
	Mod operator+=(Mod b) { if ((val += b.val) >= MOD) val -= MOD; return *this; }
	Mod operator-=(Mod b) { if ((val += MOD - b.val) >= MOD) val -= MOD; return *this; }
	Mod operator*=(Mod b) { (val *= b.val) %= MOD; return *this; }
	Mod operator/=(Mod b) { (val *= b.inv().val) %= MOD; return *this; }
	Mod operator+(Mod b) const { Mod<MOD> tmp(*this); return tmp += b; }
	Mod operator-(Mod b) const { Mod<MOD> tmp(*this); return tmp -= b; }
	Mod operator*(Mod b) const { Mod<MOD> tmp(*this); return tmp *= b; }
	Mod operator/(Mod b) const { Mod<MOD> tmp(*this); return tmp /= b; }
	Mod& operator++() { *this += 1; return *this; }
	Mod& operator--() { *this -= 1; return *this; }
	Mod operator++(int) { Mod<MOD> tmp(*this); operator++(); return tmp; }
	Mod operator--(int) { Mod<MOD> tmp(*this); operator--(); return tmp; }
	Mod inv() const {
		ll v, y, g = euclid(val, MOD, v, y);
		assert(g == 1); return Mod((v + MOD) % MOD);
	}
	Mod operator^(ll p) const {
		ll r = 1, b = val;
		for (; p; p >>= 1, b = b * b % MOD) if (p & 1) r = r * b % MOD;
		return Mod(r);
	}
	friend istream& operator>>(istream &is, Mod& mod) {
		ll tmp; is >> tmp;
		mod = Mod<MOD>(tmp);
		return is;
	}
	friend ostream& operator<<(ostream &os, const Mod& mod) {
		return os << mod.val;
	}
};
// End snippets

typedef Mod<> modint;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	int n, c; read(n, c);
	vector<int> a(n), b(n);
	rep(i, 0, n) read(a[i]);
	rep(i, 0, n) read(b[i]);

	vector<vector<modint>> powsum(401, vector<modint>(401, 0));
	rep(i, 0, 401) {
		rep(j, 1, 401) {
			powsum[i][j] = powsum[i][j - 1] + (modint(j) ^ i);
		}
	}

	vector<modint> val(c + 1);
	val[0] = 1;
	rep(i, 0, n) {
		vector<modint> cv(c + 1);
		rep(j, 0, c + 1) rep(k, 0, c + 1) if (j + k <= c)
			cv[j + k] += val[j] * (powsum[k][b[i]] - powsum[k][a[i] - 1]);
		val = cv;
	}
	write(val[c]);
}


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

using namespace std;

long long int s(long long int n){
    return n*(n+1)/2;
}

int main(int argc, char** argv){
    string S;
    cin >> S;
    int N = S.length();
    if (S[N-1] == '<') {
        S = S + '>';
        N++;
    }
    if (S[0] == '>') {
        S = '<' + S;
        N++;
    }
    bool flag = true;
    long long int succ = 0;
    vector<long long int> v(0);
    for (int i=0; i<N; i++){
        if (S[i] == '<'){
            if (flag){
                succ++;
            } else {
                v.push_back(succ);
                succ = 1;
                flag = !flag;
            }
        } else {
            if (!flag){
                succ++;
            } else {
                v.push_back(succ);
                succ = 1;
                flag = !flag;
            }
        }
    }
    v.push_back(succ);

    //for (auto itr = v.begin(); itr != v.end(); itr++)
    //    cerr << *itr << "\n";

    long long int ans = 0;
    for (size_t i=0; i<v.size(); i++){
        ans += s(v[i]-1);
        if (i%2 == 0) ans += max(v[i], v[i+1]);
    }

    cout << ans << "\n";

    return 0;
}


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

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 1000000007;
//const int MOD = 998244353;
//const long long int MOD = 998244353;

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

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

	cin >> N;
	vector<pair<string,pair<int,int>>>s(N);
	for (int i = 0; i < N; i++) {
		cin >> s[i].first >> s[i].second.first;
		s[i].second.first *= -1;
		s[i].second.second = i + 1;
	}
	sort(s.begin(), s.end());
	for (auto i : s)cout << i.second.second << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

#define MAX 100
#define W   10

char str[MAX][W+1];

int main(void) {
  int N, length, flag = 0;
  scanf("%d", &N);

  for(int i=0; i<N; ++i) {
    scanf("%s", str[i]);
    for(int j=0; j<i; ++j) {
      if(strcmp(str[i], str[j]) == 0)
        flag = 1;
    }
    if(i != 0) {
      length = strlen(str[i-1]);
      if(str[i][0] != str[i-1][length-1])
        flag = 1;
    }
  }

  if(flag) printf("No\n");
  else printf("Yes\n");

  return 0;
}


Measured memory_bytes: 128
using System;

namespace abc155B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] a = new int[N];
            string[] str = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
            {
                a[i] = int.Parse(str[i]);
            }
            int[] b = new int[N];
            for(int i = 0; i < N; i++)
            {
                if (a[i] % 2 == 0)
                    b[i] = a[i];
            }
            int B = 0;
            for(int i = 0; i < b.Length; i++)
            {
                if (b[i] % 3 != 0 && b[i] % 5 != 0)
                    B += 1;
               
            }
            if (B != 0)
                Console.WriteLine("DENIED");
            else
                Console.WriteLine("APPROVED");
        }
    }
}


Measured memory_bytes: 13140
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10**9


[X]  = list(map(int,input().split()))
# print(X)

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 2):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

for i in range(X,INF):
    if is_prime(i):
        print(i)
        exit(0)
print(-1)

Measured memory_bytes: 3188
#include <iostream>
#include <cstring>
using namespace std;
long long x[100001];
int main() {
    int N, K;
    cin >> N >> K;
    for (int i = 1; i <= N; i++) {
        cin >> x[i];
    }
    if (x[1] >= 0) {
        cout << x[K] << endl;
    }
    else if (x[N] <= 0) {
        cout << -x[N - K + 1] << endl;
    }
    else {
        int start = 1;
        for (; x[start] <= 0LL; start++){
        }
        long long ans = 1LL << 62;
        int tmp;
        if (N - start + 2 >= K){
            tmp = 1;
        }
        else {
            tmp = K - (N - start + 1);
        }
        for (int i = start - tmp; i > 0 && start - i <= K; i--) {
            long long t = -x[i];
            int k = K - (start - i);
            if (k == 0) {
                if (t < ans) {
                    ans = t;
                }
            }
            else {
                t <<= 1;
                t += x[start + k - 1];
                if (t < ans) {
                    ans = t;
                }
            }
        }
        if (start >= K) {
            tmp = 0;
        }
        else {
            tmp = K - start;
        }
        for (int i = start + tmp; i <= N && i - start + 1 <= K; i++) {
            long long t = x[i];
            int k = K - (i - start + 1);
            if (k == 0) {
                if (t < ans) {
                    ans = t;
                }
            }
            else {
                t <<= 1;
                t += -x[start - k];
                if (t < ans){
                    ans = t;
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}


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

class Main{
    public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    }
}

Measured memory_bytes: 50148
#include<bits/stdc++.h>
#define fastio 	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long int
using namespace std;
int mod = 1e9 + 7;

int32_t main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio;


	int n, x, t;
	cin >> n >> x >> t;
	int count = t, orig = x;
	while (x < n) {
		count += t;
		x += orig;
	}
	cout << count;
	return 0;
}

Measured memory_bytes: 3548
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map { it.toInt() - 1 }
    val b = readLine()!!.split(' ').map { it.toInt() }
    val c = readLine()!!.split(' ').map { it.toInt() }

    var ans = b[a[0]]

    for (i in 1 until n) {
        ans += if (a[i - 1] + 1 == a[i]) {
            b[a[i]] + c[a[i - 1]]
        } else {
            b[a[i]]
        }
    }

    println(ans)
}


Measured memory_bytes: 38416
// AOJ 2100 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2100)
#include<cstdio>
#include<algorithm>
#define rep(i,a) for(int i=0;i<(a);++i)

int t;

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

	rep( tc, t )
	{
		int n;
		scanf( "%d", &n );

		int prv = -1, u = 0, d = 0;
		rep( i, n )
		{
			int h;
			scanf( "%d", &h );

			if( i )
			{
				u = std::max( u, h-prv );
				d = std::min( d, h-prv );
			}

			prv = h;
		}

		printf( "%d %d\n", u, -d );
	}

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rf(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);
//#define rf(x) (x)=0;while(*p<48)im=*p=='-';while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);if(im)(x)=-(x);
#define pb push_back
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((V).end())
#define befv(V) ((V)[(sz(V)-2)])
#define sorv(V) sort(allv(V))
#define revv(V) reverse(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define clv(V) (V).clear()
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define cb(x) (x)=(!(x))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
#define INFST (0x7f7f7f7f)
#define INFLLST (0x7f7f7f7f7f7f7f7fll)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
typedef complex<ld> base;
const ld EPS = (ld)1e-7;
const ld PI = acos(0) * 2;
bool isZero(const ld& x) { return abs(x) <= EPS; }
int sign(const ld& x) { return isZero(x) ? 0 : (0 < x ? 1 : -1); }
ll gcd(ll a, ll b) { for(;b;a%=b,swap(a,b)){} return abs(a); }
pll operator + (const pll& a, const pll& b) { return pll(a.first+b.first, a.second+b.second); }
pll operator - (const pll& a, const pll& b) { return pll(a.first-b.first, a.second-b.second); }
pll operator * (const pll& a, const ll& b) { return pll(a.first*b, a.second*b); }
ll operator * (const pll& a, const pll& b) { return a.first*b.second - b.first*a.second; }
ll ccw(const pll& a, const pll& b, const pll& c) { return a*b + b*c + c*a; }
void fg(vector<int> G[], int a, int b) { G[a].pb(b); G[b].pb(a); }
void fg(vector<pii> G[], int a, int b, int c) { G[a].pb({b, c}); G[b].pb({a, c}); }

const int MAXN = 1000005;


int A[MAXN], O[MAXN];

ll Ans;
int N;

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

	cin >> N;

	for(int i = 1; i <= N; i++) {
		cin >> A[i];
	}

	if(1 == N) {
		puts("0");
		return 0;
	}
	if(2 == N) {
		printf("%d\n", A[1] < A[2] ? 0 : 1);
		return 0;
	}

	{
		vector<int> V;
		for(int i = 1; i <= N; i++)
			V.pb(A[i]);
		sorv(V);
		for(int i = 1; i <= N; i++)
			A[i] = (int)(lower_bound(allv(V), A[i]) - V.begin()) + 1;
	}

	priority_queue<int, vector<int>, greater<int>> PQ[2][2];
	for(int i = 1; i <= N; i++) {
		PQ[i&1][A[i]&1].push(A[i]);
	}

	for(int i = 1; i <= N; i++) {
		if(!PQ[i&1][i&1].empty() && PQ[i&1][i&1].top() == i) {
			PQ[i&1][i&1].pop();
			continue;
		}
		Ans++;
		PQ[!(i&1)][i&1].pop();
		if(!PQ[i&1][!(i&1)].empty()) {
			PQ[!(i&1)][!(i&1)].push(PQ[i&1][!(i&1)].top());
			PQ[i&1][!(i&1)].pop();
		} else {
			PQ[!(i&1)][i&1].push(PQ[i&1][i&1].top());
			PQ[i&1][i&1].pop();
		}
	}
	cout << Ans << endl;
	return 0;
}

Measured memory_bytes: 5104
a,b,k = map(int,input().split())
A=[]
for i in range(a,min(a+k,b+1)):
    A.append(i)
B=[]
for i in range(b,max(b-k,a-1),-1):
    B.append(i)
C=list(set(A+B))
C.sort(reverse=False)
for j in range(len(C)):
    print(C[j])

Measured memory_bytes: 62432
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int N = sc.nextInt();
		int waza[] = new int[N];
		int Swaza = 0;
		for (int i = 0; i < N; i++) {
			Swaza += sc.nextInt();
		}

		if (H <= Swaza) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

}


Measured memory_bytes: 48560
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

int main()
{
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int n,m;cin>>n>>m;
  vi a(n,0);
  rep(i,m){
    int x,y;cin>>x>>y;
    a[x-1]++;a[y-1]++;
  }
  rep(i,n){
    cout(a[i]);
  }
  
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public Main() {
    }

    public static void main(String[] args ) {
    		Main main = new Main();
    		main.exec();
    }

    public void exec() {
        BufferedReader bf = null;
        try{
            bf = new BufferedReader(new InputStreamReader(System.in));
            String line = bf.readLine();
            String[] values = line.split(" ");

            MyStack mys = new MyStack();
            for( String value : values ) {
                if( "+".equals(value)) {
                    int right = mys.pop();
                    int left = mys.pop();
                    mys.push(left+right);
                } else if ( "-".equals(value) ) {
                    int right = mys.pop();
                    int left = mys.pop();
                    mys.push(left-right);
                } else if ( "*".equals(value) ) {
                    int right = mys.pop();
                    int left = mys.pop();
                    mys.push(left*right);
                } else {
                    mys.push(Integer.parseInt(value));
                }
            }

            System.out.println(mys.pop());
        } catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
        finally{
            if( bf != null ) {
                try {
					bf.close();
				} catch (IOException e) {
					// TODO 自動生成された catch ブロック
					e.printStackTrace();
				}
            }
        }
    }

    public class MyStack {
        public static final int MAX = 1000;
        int[] values = new int[MAX];
        int index = 0;

        public MyStack() {}

        void push( int val ) {
            if( isFull() ) {
                throw new RuntimeException("MyStack is Full.");
            }

            index++;
            values[index] = val;
        }

        int pop() {
            if( isEmpty() ) {
                throw new RuntimeException("MyStack is Empty.");
            }

            index--;
            return values[index+1];
        }

        boolean isEmpty() {
            return index <= 0;
        }

        boolean isFull() {
            return index >= 1000;
        }
    }
}


Measured memory_bytes: 24344
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long int

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int anst, ansa;
    cin >> anst >> ansa;
    rep(i, N-1) {
        int t, a;
        cin >> t >> a;
        int n = max((anst+t-1)/t, (ansa+a-1)/a);
        anst = n * t;
        ansa = n * a;
        //cout << "*" <<anst << " " << ansa << endl;
    }
    cout << anst + ansa << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n); std::vector<int> a(n);
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	sort(begin(a), end(a));

	double ans = a.front();
	for(int i = 1; i < n; i++) ans = (ans + (double)a[i]) / 2.;
	printf("%.8lf\n", ans);
	return 0;
}


Measured memory_bytes: 256
def s()
  gets().chomp
end
def i()
  gets.to_i
end
def li()
  gets.split.map(&:to_i)
end
def ili()
  n = gets.to_i
  as = gets.split.map(&:to_i)
  [n, as]
end
class Array
  def sum
    total = 0
    self.each do |item|
      total += item
    end
    total
  end
end

def eratosthenes(size)
  prime_list = []
  is_prime = Array.new(size, true)
  is_prime[0] = false
  is_prime[1] = false

  2.upto(size-1){|i|
    if is_prime[i]
      prime_list << i
      (2).upto((size.to_f/i).ceil-1){|j|
        is_prime[j*i] = false
      }
    end
  }
  [prime_list, is_prime]
end

def dijkstra(s, e, cost)
  size = cost.length
  if s==e
    return 0
  end
  dp = {}
  dp[s] = 0
  undefined_node = {}
  size.times{|i|
    if i != s
      undefined_node[i] = cost[s][i]
    end
  }
  while undefined_node.length != 0
    min = undefined_node.min_by{|_, v| v}
    stock = {}
    temp = undefined_node.clone
    temp.each{|k, v|
      if min[1] == v
        undefined_node.delete(k)
        if k == e
          return v
        end
        dp[k] = v
        stock[k] = v
      end
    }

    stock.each{|k, v|
      undefined_node.each{|k2, v2|
        undefined_node[k2] = v + cost[k][k2] < v2 ?  v + cost[k][k2] : v2
      }
    }
  end
end

def get_bits(len)
  res =  []
  (2**len).times{|i|
    res << i.to_s(2).rjust(len, '0')
  }
  res
end

d, g = li()
ps = []
d.times{|i|
  ps << [(i+1)*100].concat(li())
}
bits = get_bits(d)[0..2**d-2]
ans = 1000000000
bits.each{|bit|
  sum = 0
  count = 0
  bit.each_char.with_index{|b, i|
    if b == "1"
      sum += ps[i][0]*ps[i][1] + ps[i][2]
      count += ps[i][1]
    end
  }

  index = d - 1 - bit.reverse.index("0")
  rest = g - sum
  if rest > 0
    rest_count = (rest.to_f / ps[index][0]).ceil

    if rest_count < ps[index][1]
      ans = (count + rest_count) < ans ? (count + rest_count) : ans
    end
  else
    ans = (count) < ans ? (count) : ans
  end
}
all = ps.reduce(0){|sum, p| sum + p[1]}
p ans  < all ? ans : all

Measured memory_bytes: 4220
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF LLONG_MAX/2

ll A[2000000];
int size;

void heapIncreaseKey(int i, int key){
  if(key < A[i])
    assert(false);
  A[i] = key;
  while(i > 1 && A[i/2] < A[i]){
    swap(A[i], A[i/2]);
    i = i/2;
  }
}

void maxHeapInsert(ll key){
  size++;
  A[size] = -INF;
  heapIncreaseKey(size, key);
}
void maxHeapify(ll i){
  int l = i*2;
  int r = i*2+1;
  int largest;
  if(l <= size && A[l] > A[i])
    largest = l;
  else
    largest = i;
  if(r <= size && A[r] > A[largest])
    largest = r;
  if(largest != i){
    swap(A[i], A[largest]);
    maxHeapify(largest);
  }
}

ll heapExtractMax(){
  if(size < 1){
    assert(false);
  }
  ll maxv = A[1];
  A[1] = A[size];
  size--;
  maxHeapify(1);
  return maxv;
}

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

  while(1){
    string str;
    cin >> str;
    if(str == "end") break;
    if(str == "insert"){
      ll k; cin >> k;
      maxHeapInsert(k);
    }if(str == "extract"){
      cout << heapExtractMax() << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 9404
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const int MOD = 1000000007;
using Data = pair<long long, vector<ll> >;

int main() {
  string s;
  cin >> s;
  
  ll sumb=0;
  ll ans=0;
  rep(i,s.size()){
    if(s[i]=='W') ans+=sumb;
    else sumb++;
  }
  
  cout << ans << endl;
}

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

int main(){
    string S;
    cin >> S;

    int N = S.length();
    int count = 0;

    for (int i = 0; i < N; i++){
        if (i % 2 == 0){
            if (S[i] == 'R' || S[i] == 'U' || S[i] == 'D'){
                count++;
            }
        }
        if (i % 2 == 1){
            if (S[i] == 'L' || S[i] == 'U' || S[i] == 'D'){
                count++;
            }
        }
    }
    if (count == N){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


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

const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int n, k;

int gcd(int x, int y) {
    while (y) {
        x %= y;
        swap(x,y);
    }
    return x;
}

int main() {
    cin >> n >> k;
    int g;
    int M = -1;
    rep(i,n) {
        int a;
        cin >> a;
        M = max(M, a);
        if (i == 0) {
            g = a;
            continue;
        }
        g = gcd(g, a);
    }
    if (n == 1) {
        if (g != k) puts("IMPOSSIBLE");
        else puts("POSSIBLE");
        return 0;
    }
    if (k%g == 0 && M >= k) puts("POSSIBLE");
    else puts("IMPOSSIBLE");
}
































Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6)

N = int(input())
adj = [ [] for _ in range(N+1) ]
for _ in range(N-1):
  a,b = map(int,input().split())
  adj[a].append(b)
  adj[b].append(a)

def dfs(v, p=-1):
  global ans

  res = 1
  ts = []
  for u in adj[v]:
    if (u==p): continue
    t = dfs(u,v)
    res += t
    ts.append(t)

  if p != -1:
    ts.append(N-res)

  # print(v, ts)

  # now = pow(2, N-1, MOD)-1
  now = pows[N-1]-1
  for t in ts:
    # now -= pow(2, t, MOD)-1
    now -= pows[t] - 1
  ans += now
  return res

ans = 0
MOD = 10**9+7
# 高速化1
pows = [1] * (N+1)
for i in range(1, N+1):
  pows[i] = (pows[i - 1] * 2) % MOD

dfs(1)
print((ans * pow(pows[N], MOD-2, MOD)) % MOD)

Measured memory_bytes: 226628
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long x=sc.nextLong();
		long y=sc.nextLong();
		long min=n;
		min=Math.min(y-1, n-x);

		if((y-x)%2==0) {
			min=Math.min(min, (y-x)/2);
		}else {
			if((y-(x-1))%2==1) {
				min=Math.min(min, (x-1)+(y-x)/2);
			}else {
				min=Math.min(min, x+(y-x)/2);
			}
			if(n-(x+(n-y))%2==0) {
				min=Math.min(min, n-y+(y-x)/2);
			}else {
				min=Math.min(min, n-y+1+(y-x)/2);
			}
		}
		System.out.println(min);


	}

}


Measured memory_bytes: 23508
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdlib.h>
#include<stack>
#include<set>
#include<string.h>
#include<map>
#include<vector>
#define pb push_back
#define eb emplace_back
#define ins insert 
#define mp make_pair
#define ll long long 
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define M 10000007
#define inf 1000000000000000000
using namespace std;
void solve(){
	ll n,w;
	cin>>n>>w;
	ll we[n],v[n],maxv=0;
	for (int i = 0; i < n; ++i)
	{
		cin>>we[i]>>v[i];
		maxv+=v[i];
	}
	ll dp[maxv+1];
	for (int i = 1; i <=maxv; ++i)
	{
		dp[i]=inf;
	}
	dp[0]=0;
	for (int i = 1; i <=n; ++i)
	{
		ll x=v[i-1];
		for (int j = maxv; j>=x; --j)
		{
			dp[j]=min(dp[j],dp[j-x]+we[i-1]);
		}
	}
	for (int i = maxv; i >=0; --i)
	{
		if(dp[i]<=w){
			cout<<i;
			break;
		}
	}
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0 ;
}


Measured memory_bytes: 1024
n = int(input())

dp = [0] * (n + 1)

for i in range(1, n + 1):
    dp_min = dp[i - 1]
    p = 6
    q = 9
    while p <= i:
        if dp[i - p] < dp_min:
            dp_min = dp[i - p]
        p *= 6
    while q <= i:
        if dp[i - q] < dp_min:
            dp_min = dp[i - q]
        q *= 9
    dp[i] = dp_min + 1
        
print(dp[n])

Measured memory_bytes: 3828
#include <vector>
#include <iostream>
#include <cmath>
#include<iomanip>

using namespace std;

int need_count(int k, int n) {
    if (n >= k) return 0;
    //cout << k << "," << n << ":" <<log2((double)k/n)  + 1<<endl;
    long double temp = log2((double)k/n);
    int ans = ceil(temp);
    if (ans - temp < 0.0000001) return floor(log2((double)k/n));
    else return floor(log2((double)k/n) + 1);
    //return floor(log2((double)k/n) + 1);
}

int main() {
    int N, K;
    cin >> N >> K;
    long double ans = 0;

    cout<<fixed<<setprecision(12);

    for(int i = 1; i <= N; i++) {
        long double tmp = 1/pow(2,need_count(K, i));
        ans += tmp;
    }

    cout << ans/N << endl;

    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

ll solve(vector<P> v) {
  ll n=v.size(),ret=0;
  rep(i,n) v[i].first=min(v[i].first,n);
  vector<lvector> w(n+1);
  rep(i,n) w[v[i].first].emplace_back(v[i].second);
  lpque q;
  for(ll i=n;i>0;--i) {
    for(ll j:w[i]) q.push(j);
    if(q.size()) {ret+=q.top();q.pop();}
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll T,n,k,l,r,m,ans;cin>>T;
  rep(t,T) {
    cin>>n;ans=0;
    vector<P> A,B;
    rep(i,n) {
      cin>>k>>l>>r;
      m=min(l,r);ans+=m;
      l-=m,r-=m;
      if(l>0) A.emplace_back(k,l);else B.emplace_back(n-k,r);
    }
    ans+=solve(A);ans+=solve(B);
    print(ans);
  }
  return 0;
}

Measured memory_bytes: 14344
import math

N = int(input())

def is_prime(x):
    c = 2
    while c < math.sqrt(x):
        if x % c == 0:
            return False
        c += 1
    return True

if N % 2 == 0 and N > 2:
    N += 1

while True:
    if is_prime(N):
        break
    N += 2

print(N)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	static int a,b;
	static int[][] field;

	public static void main(String args[]){

		Scanner s=new Scanner(System.in);
		while(true){

			a=s.nextInt();
			if(a==0)System.exit(0);
			int minN=0,maxN=0;
			int[][] map = new int[10][10];
			for(int i=0; i<10; i++) {
				for(int j=0; j<10; j++) {
					map[i][j] = 1<<25;
					if(i==j)map[i][j]=0;
				}
			}

			for(int i=0; i<a; i++) {
				int p = s.nextInt();
				int q = s.nextInt();
				int w = s.nextInt();
				maxN = Math.max(maxN,Math.max(p, q));
				map[p][q] = Math.min(map[p][q], w);
				map[q][p] = map[p][q];
			}

			for(int k=0; k<10; k++) {
				for(int i=0; i<10; i++) {
					for(int j=0; j<10; j++) {
						if(map[i][j]>map[i][k]+map[k][j]) {
							map[i][j]=map[i][k]+map[k][j];
						}
					}
				}
			}

			int minSum= 1<<25;
			for(int i=0; i<=maxN; i++) {
				int sum=0;
				for(int j=0; j<=maxN; j++) {
					sum+=map[i][j];
				}
				if(sum<minSum) {
					minN=i;
					minSum=sum;
				}
			}
			System.out.println(minN+" "+minSum);
		}
	}

}



Measured memory_bytes: 26360
//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
const int mod=1e9+7;
ll qpow(ll x, ll k) {return k==0? 1: 1ll*qpow(1ll*x*x%mod,k>>1)*(k&1?x:1)%mod;}
const int maxn = 300111;
char s[maxn];
int n;
int dp[maxn][3][3];
void upd(int &x, int v) {x=(x+v)%mod;}
int main()
{
	scanf("%s", s);
	n = strlen(s);
	dp[0][0][0] = 1;
	for (int i=0; i<n; i++)
	{
		for (int x=0; x<3; x++)
		{
			for (int y=0; y<3; y++)
			{
				int cur = dp[i][x][y];
				if (!cur) continue;
				for (int t=0; t<2; t++)
				{
					if (s[i]!='?'&&s[i]-'0'!=t) continue;
					int nx, ny;
					if (x==2) nx=2, ny=0;
					else
					{
						if (t==0) nx=x, ny=y+1==3?1:y+1;
						else
						{
							if (y==0) nx=x+1, ny=0;
							else nx=x, ny=y-1;
						}
					}
					upd(dp[i+1][nx][ny], cur); 
				}
			}
		}
	}
	int ans = 0;
	upd(ans, dp[n][2][0]);
	upd(ans, dp[n][1][0]);
	upd(ans, dp[n][0][0]);
	cout<<ans<<endl;
	return 0;
}


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

int main(){
    int N;
    int64_t D;
    cin >> N >> D;
    int ans = 0;
    for(int i=0; i<N; i++){
        int64_t x, y;
        cin >> x >> y;
        if(x*x + y*y <= D*D) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
// 177

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <queue>
#include <iomanip>
#include <climits>
#include <string>
#include <cmath>

using namespace std;
using ll = long long int;
#define NUM 1000000007

int main(){
    ll n, m, buf_a, buf_b, max_buf;
    cin >> n >> m;
    vector<vector<ll>> v(n);
    vector<int> g_list(n, INT_MAX), count(n, 0);
    for(int i=0; i<m; i++){
        cin >> buf_a >> buf_b;
        v.at(buf_a-1).push_back(buf_b-1);
        v.at(buf_b-1).push_back(buf_a-1);
    }
    int class_id=0;
    for(int i=0; i<n; i++){
        queue<int> que;
        if(class_id < g_list.at(i)){
            que.push(i);
            while(!que.empty()){
                int buf = que.front();
                que.pop();
                g_list.at(buf) = class_id;
                for(auto itr=v.at(buf).begin(); itr != v.at(buf).end(); itr++){
                    if(g_list.at(*itr) > class_id){
                        g_list.at(*itr) = class_id;
                        que.push(*itr);
                    }
                }                     
            }
            class_id++;
        }
    }

    for(auto itr=g_list.begin(); itr != g_list.end(); itr++){
        count.at(*itr)++;
    }
    max_buf = *max_element(count.begin(), count.end());
    cout << max_buf << endl;
    return 0;
}


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


int main() { 
  int n,k,ans=0;
  cin>>n;
  vector<int> p(n);
  rep(i,n){cin>>k;p[k-1]=i+1;}
  rep(i,n){cout<<p[i];if(i!=n-1)cout<<' ';}cout<<endl;
  

}

Measured memory_bytes: 1152
#include <iostream>

using namespace std;

int main()
{
    string s; cin >> s;
    string arr[3];
    arr[0] = "Sunny", arr[1] = "Cloudy", arr[2] = "Rainy";
    if(s == arr[0])
    {
        cout << arr[1];
    }
    else if(s == arr[1])
    {
        cout << arr[2];
    }
    else
    {
        cout << arr[0];
    }
    return 0;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  int N, R; std::cin >> N >> R;
  if (N >= 10) std::cout << R << std::endl;
  else         std::cout << R + 100 * (10 - N) << std::endl;
}


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

using namespace std;

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long llint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double pi = 3.14159265358979323846;

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

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

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

  llint n, k;
  cin >> n >> k;
  vector<llint> h(n);
  rep(i, n) cin >> h[i];
  sort(all(h));
  reverse(all(h));
  llint ans = 0, cnt = 0;
  rep(i, n) {
    if (cnt < k) {
      cnt++;
      continue;
    }
    ans += h[i];
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>

//#define infile_n "in1.txt"
//#define outfile_n "out1.txt"


int main(void)
{
	int N,M,i,j,vote_max=0,vote_maxi=0;
	int ai[1000],bj[1000],vote[1000];
	//FILE *infile,*outfile;
	
	/*infile=fopen(infile_n,"r");
	if(infile==NULL){
		printf("Can't open infile\n");
		return -1;
	}
	
	outfile=fopen(outfile_n,"w");
	if(outfile==NULL){
		printf("Can't open outfile\n");
		return -1;
	}*/
	 
	for(i=0;i<1000;i++){
		ai[i]=0;
		bj[i]=0;
		vote[i]=0;
	}
	
	//fscanf(infile,"%d %d",&N,&M);
	scanf("%d %d",&N,&M);
	
	for(i=0;i<N;i++){
		//fscanf(infile,"%d",&ai[i]);
		scanf("%d",&ai[i]);
	}
	
	for(i=0;i<M;i++){
		//fscanf(infile,"%d",&bj[i]);
		scanf("%d",&bj[i]);
	}
	
	for(i=0;i<M;i++){
		for(j=0;j<N;j++){
			if(ai[j]<=bj[i]){
				vote[j]++;
				break;
			}
		}
	}
	
	vote_max=vote[0];
	for(i=1;i<N;i++){
		if(vote_max<vote[i]){
			vote_max=vote[i];
			vote_maxi=i;
		}
	}
	
	//fprintf(outfile,"%d\n",vote_maxi+1);
	printf("%d\n",vote_maxi+1);
	
	//fclose(infile);
	//fclose(outfile);
	
	return 0;
}

Measured memory_bytes: 608
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

char s[300005];
int cnt1[300005];
int cnt2[300005];
int main()
{
	int n;
	cin>>n>>s;
	int tem1=0,tem2=0;
	memset(cnt1,0,sizeof(cnt1));
	memset(cnt2,0,sizeof(cnt2));
	for(int i=0,j=n-1;i<n;i++,j--)
	{
		cnt1[i]=tem1;
		cnt2[j]=tem2;
		if(s[i]=='W')	tem1++;
		if(s[j]=='E')	tem2++;
	}
	
	int ans=1e8;
	for(int i=0;i<n;i++)
	{
		if(ans>cnt1[i]+cnt2[i])	ans=cnt1[i]+cnt2[i];
	}
	
	cout<<ans<<endl;
	
	
	return 0;
}

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

int n, h, w;

int main()
{
	std::cin >> n >> h >> w;
	std::cout << (n - h + 1) * (n - w + 1) << std::endl;
	return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	int n, m; cin >> n >> m;
	VI a(n), b(m);
	rep(i, n)cin >> a[i];
	rep(i, m)cin >> b[i];

	VI ans1, ans2;
	set_intersection(all(a), all(b), inserter(ans1, ans1.end()));
	set_union(all(a), all(b), inserter(ans2, ans2.end()));
	Cout2(sz(ans1), sz(ans2));
	for (auto x : ans1)cout << x << endl;
	for (auto x : ans2)cout << x << endl;
}


Measured memory_bytes: 4876
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

//最大公約数
long long gcd(long long a, long long b) {
	if (a < b) std::swap(a, b);
	long long r = a % b;
	while (r) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}

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

	ll n, m;
	cin >> n >> m;
	priority_queue<ll> pq;
	for (ll i = 0; i < n; i++) {
		ll a;
		cin >> a;
		pq.push(a);
	}
	for (ll i = 0; i < m; i++) {
		ll x = pq.top();
		pq.pop();
		pq.push(x / 2);
	}
	ll ans = 0;
	for (ll i = 0; i < n; i++) {
		ans += pq.top();
		pq.pop();
	}
	cout << ans << endl;
}


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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template <class T> bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vi v(n);
	REP(i, n)cin >> v[i];
	bool ok = true;
	RREP(i, n - 1) {
		if (v[i] > v[i + 1])v[i]--;
		if (v[i] > v[i + 1])ok = false;
	}
	cout << (ok ? "Yes" : "No") << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;
struct UnionFind {
  vector<int> parent,s;
  UnionFind(int n): parent(n), s(n){
    rep(i,n) {
      parent[i] = i;
      s[i] = 1;
    }
  }
  int root(int x) { return parent[x]==x ? x : parent[x] = root(parent[x]); }
  bool same(int x, int y) { return root(x)==root(y); }
  int size(int x){ return s[root(x)]; }
  void unite(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return;
    if (s[x] < s[y]) {
      parent[x] = y;
      s[y] += s[x];
    } else {
      parent[y] = x;
      s[x] += s[y];
    }   
  }
};

int main() {
  int n,k,l;
  cin >> n >> k >> l;
  UnionFind u1(n),u2(n);
  rep(i,k){
    int s,t;
    cin >> s >> t;
    --s; --t;
    u1.unite(s,t);
  }
  rep(i,l){
    int s,t;
    cin >> s >> t;
    --s; --t;
    u2.unite(s,t);
  }
  map<P,int> ans;
  rep(i,n) ans[P(u1.root(i),u2.root(i))]++;
  rep(i,n) cout << ans[P(u1.root(i),u2.root(i))] << " "; cout << endl;
}

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

int main(){
    int N;
    double A;
    double A_REV_SUM;

    cin >> N;
    int n;
    for (n=0;n<N;n++){
        cin >> A;
        A_REV_SUM +=1/A;        
    }

    cout << 1/A_REV_SUM << endl;

} 

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

int main()
{
    int L, R, d;
    cin >> L >> R >> d;
    if((R%d) == 0) {
        cout << (R-L)/d+1 << endl;
    } else {
        cout << (R-L)/d << endl;
    }
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<iomanip>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
    string a, b, c;
    cin >> a >> b >> c;
    cout << a[0] << b[0] << c[0] << endl;
    return 0;
}

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

int main() {
  int N; cin >> N;
  vector<int> a(N);
  rep(i, N) cin >> a[i];
  
  int ans = 0;
  rep(i, N) {
    while(a[i]%2 == 0) {
      a[i] /= 2;
      ans++;
    }
  }
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int> //tuple<ll,ll,ll>
#define pr(x) cout << x << endl;
using namespace std;

int main(){
  int n,c; cin >> n >> c;
  vector<vector<int> > bc(c,vector<int>(100001,0));
  rep(i,n){
    int s,t,a; cin >> s >> t >> a;
    a--;
    for(int j=s; j<=t; j++){
      bc[a][j]++;
    }
  }

  int ans=0;
  for(int i=1; i<=100000; i++){
    int tmp=0;
    rep(j,c){
      if(bc[j][i]) tmp++;
    }
    ans=max(ans,tmp);
  }

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


Measured memory_bytes: 15404