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

using namespace std;

typedef long long ll;

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

const int inf = 1e9 + 7;
const int mod = 1e9 + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}

inline int mul(int a, int b) {
  return (a * (ll) b) % mod;
}

inline int pw(int x, int n) {
  int res = 1;
  while (n > 0) {
    if (n % 2) {
      res = mul(res, x);
      n--; 
    } else {
      x = mul(x, x);
      n /= 2;
    }
  }
  return res;
}

typedef long double ld;

const int N = 3e3 + 7;

int n;
vector <int> a;
ll dp[N][N];

ll solve(int l, int r) {
  if (l > r) {
    return 0;
  }
  auto &res = dp[l][r];
  if (res != -1) {
    return res;
  }
  int step = n - 1 - r + l;
  step %= 2;
  if (l == r) {
    if (step ^ 1) {
      return res = a[l];
    }
    return res = 0;
  }
  res = 0;
  if (step ^ 1) {
    res = max(res, solve(l + 1, r) + a[l]);
    res = max(res, solve(l, r - 1) + a[r]);
  } else {
    res = min(solve(l + 1, r), solve(l, r - 1));
  }
  return res;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, -1, sizeof dp);
  cin >> n;
  a.resize(n);
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  solve(0, n - 1);
  cout << 2 * dp[0][n - 1] - sum << '\n';
  return 0;
}

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

using namespace std;
 
int main()
{
    int N, M;
    cin >> N >> M;

    double sum = 0;
    
    vector<int> A(N);

    for (int i = 0; i < N; i++)
    {
        cin >> A.at(i);
        sum = sum + A.at(i);
    }
    
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());

    /*小数点の考慮*/
    double x = sum / (4 * M);

    if (A.at(M-1) < x)
    {
        cout << "No" << endl;
    }
    
    else
    {
        cout << "Yes" << endl;
    }
}

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

int main() {
  int H,W;
  cin >>H>>W;
  vector<char> S(H*W);
  for(int i=0; i<H*W; i++) cin >>S.at(i);
  for(int i=0; i<H*W; i++){
    if(i!=0 && i%W==0) cout <<endl;
    if(S.at(i)=='.'){
      int ans=0;
      if(W-1<i){
        if(S.at(i-W)=='#') ans++;
        if(i%W!=0 && S.at(i-W-1)=='#') ans++;
        if((i+1)%W!=0 && S.at(i-W+1)=='#') ans++;
      }
      if(i%W!=0 && S.at(i-1)=='#') ans++;
      if((i+1)%W!=0 && S.at(i+1)=='#') ans++;
      if(i<W*(H-1)){
        if(S.at(i+W)=='#') ans++;
        if(i%W!=0 && S.at(i+W-1)=='#') ans++;
        if((i+1)%W!=0 && S.at(i+W+1)=='#') ans++;
      }
      cout <<ans;
    }
    else cout <<'#';
  }
}


Measured memory_bytes: 256
from itertools import permutations, product

N, M, R = map(int, input().split())
r = [int(x) for x in input().split()]
abc = [[int(x) for x in input().split()] for _ in range(M)]

dist = [[float('inf') for _ in range(N)] for _ in range(N)]
for a, b, c in abc:
    dist[a - 1][b - 1] = c
    dist[b - 1][a - 1] = c

for k, i, j in product(range(N), repeat=3):
    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = float('inf')
for route in permutations(r):
    d = 0
    for i in range(R - 1):
        s = route[i] - 1
        g = route[i + 1] - 1
        d += dist[s][g]
    ans = min(ans, d)
print(ans)


Measured memory_bytes: 66136
import java.util.*;

public class Main {
	public static void main(String[] args) {
				
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int i = 3;
		while(i <= n) {
			if(i % 3 == 0 || String.valueOf(i).contains("3")) {
				Integer.valueOf(i);
				System.out.printf(" %d", i);
			}
			i++;
		}
		System.out.printf("\n");
	}
}

Measured memory_bytes: 38524
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
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; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

const int MOD = 1000000007;

int ans = 100000000;

int main(){
    int N; cin >> N;
    map<string, int> blues;
    rep(i,N){
        string s; cin >> s;
        blues[s]++;
    }
    int M; cin >> M;
    map<string, int> reds;
    rep(i,M){
        string s; cin >> s;
        reds[s]++; 
    }
    int ans = 0;
    for(auto blue : blues){
        ans = max(ans, blue.second-reds[blue.first]);
    }

    cout << ans << endl;
}


Measured memory_bytes: 3588
n, q = map(int, input().split())
aa = [list() for i in range(n)]
for i in range(q):
  order = list(map(int, input().split()))
  if order[0] == 0:
    t = order[1]
    x = order[2]
    aa[t].append(x)
  elif order[0] == 1:
    t = order[1]
    for j in range(len(aa[t])):
      if j == 0:
        print(aa[t][j], end = "")
      else:
        print("", aa[t][j], end = "")
    print()
  elif order[0] == 2:
    t = order[1]
    del aa[t][:]
  else:
    pass
  


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

int main(){
    int n;
    int alice = 0;
    int bob = 0;
    int a[110];

    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    sort(a, a+n, greater<int>());
    for(int i = 0; i <n ; i++){
        if(i % 2 == 0){
            alice += a[i];
        }
        else{
            bob += a[i];
        }
    }
    cout << (alice - bob) << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;

int main(void)
{
    int n;
    cin >> n;
    vector<int> a;
    REP(i, n)
    {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    int ans = 0;
    REP(i, n - 1)
    {
        if (a[i] == a[i + 1])
        {
            a[i + 1] = -1;
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define REPN(i, m, n) for(ll i = (m); i <= (n); ++i)
#define REPR(i, m, n) for(ll i = (m)-1; i >= (n); --i)
#define REPNR(i, m, n) for(ll i = (m); i >= (n); --i)
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void co(void){cout << '\n';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); co();}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); co();}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
// constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const ld PI = acos(-1);

using VecP = Vec1<P>;

Vec pn;

bool isPrime(ll n){
	if(n == 1) return false;
	for(ll i : pn){
		if(i * i > n) return true;
		if(n % i == 0) return false;
	}
	return true;
}

void init(ll n = 2e5){
	pn.pb(2);
	REP(num, 3, n) if(isPrime(num)) pn.pb(num);
}

VecP primeFactorization(ll n){
	VecP res;

	for(ll i : pn){
		ll cnt = 0;
		while(n % i == 0){
			n /= i;
			cnt++;
		}
		if(cnt) res.pb({i, cnt});
		if(n < i * i) break;
	}
	if(n != 1) res.pb({n, 1});

	return res;
}

Vec divisorEnumeration(ll n){
	auto v = primeFactorization(n);

	Vec res, a, b, cp;
	res.pb(1);
	for(auto p : v){
		cp.resize(res.size());
		copy(all(res), cp.begin());
		a.resize(res.size());
		repn(k, p.sc){
			ll t = pow(p.fs, k);
			rep(i, a.size()) a[i] = cp[i] * t;
			merge(all(res), all(a), back_inserter(b));
			swap(res, b);
			b.clear();
		}
	}

	return res;
}

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

	ll ans = 0;
	repn(i, n){
		ll e = n / i * i;
		ans += (i + e) * e / i / 2;
	}
	co(ans);

	return 0;
}


Measured memory_bytes: 3664
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############
"""
N = rand_N(2, 6)
query = rand_query(2, 10, N)
print(query)
ans_taka, ans_aoki = query[0]
"""

N = getN()
query =  [getList() for i in range(N)]
ans_taka, ans_aoki = query[0]

# 次の高橋くん、青木くんの票数が出てくる
def vote(taka, aoki, ratio):
    ratio_taka, ratio_aoki = ratio
    taka_multi = (taka + ratio_taka - 1) // ratio_taka
    aoki_multi = (aoki + ratio_aoki - 1) // ratio_aoki
    multi = max(taka_multi, aoki_multi)

    return [ratio_taka * multi, ratio_aoki * multi]

for i in range(1, N):
    ans_taka, ans_aoki = vote(ans_taka, ans_aoki, query[i])
    # print(ans_taka, ans_aoki)
print(ans_taka + ans_aoki)

Measured memory_bytes: 60396
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdlib.h>
using namespace std;

int main()
{
	int n,m;
  	int cost=0;
  	
  	cin>>n>>m;
  
  	vector<int> x(m);
  	vector<int> sa(m-1);
  
  	for(int i=0;i<m;i++)
    {
      	cin>>x[i];
    }
  
  	sort(x.begin(),x.end());
  
  	for(int j=0;j<m-1;j++)
    {   
        sa[j]=abs(x[j]-x[j+1]);
    }
  
  	sort(sa.begin(),sa.end());
  
  	for(int k=0;k<m-n;k++)
    {
      	cost=cost+sa[k];
    }
  
  	cout<<cost<<endl;

	return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	
	n *= 3;
	
	int a[300010];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	
	sort(a, a + n);
	
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		n--;
		int x = a[n-1];
		n--;
		ans += x;
	}
	
	cout << ans;
	return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define V vector<int>
#define ll long long
using namespace std;


int main() {
    int n; cin >> n;
    V a(n);
    rep(i, 0, n) cin >> a[i];

    ll ans = 0;
    rep(i, 0, n) ans += a[i] - 1;

    cout << ans << endl;
}

Measured memory_bytes: 256
/*================= *\
|  ID : aman__guta__ |
|      LANG: C++     |
\*==================*/
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define ll long long int
#define ld long double 
#define For(i,n) for(int i=0;i<n;i++)
#define Forn(i,n) for(int i=1;i<=n;i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mk make_pair
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define fs first
#define sc second 
#define mod 998244353
#define sp <<" "<<
#define JOKER ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
// typedef tree<lli, null_type, less_equal<lli>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;
int spf[10000001];
ll fac[200005];
ll comb[1010][1010];
const ll MAXN=1e6+5;
ll tree[MAXN];
void inc(ll pos);
ll get(ll pos);
ll get_kth(ll k);
void combfun();
void sieve(int n);
int expo(int base,int exponent);
ll power(ll x, ll y, ll p);
ll modInverse(ll n, ll p);
ll nCrModPFormat(ll n, ll r, ll p);
int main()  
{
    JOKER
    int t=1;
    // cin>>t;
    Forn(tc,t)
    {
        ld r;
        cin>>r;
        ld ans=3.141592635;
        cout<<ans*r*2.0<<endl;
    }
    cerr<<"Time elapsed : "<<clock()*1000.0/CLOCKS_PER_SEC<<"ms"<<'\n'; 
    return 0;
}

void combfun()
{
    for(int i=1; i<1010; i++)
    {
        for(int j=0; j<=i; j++)
        {
            if(j==0 or i==j)
            {
                comb[i][j]=1;
            }
            else 
            {
                comb[i][j]=comb[i-1][j]+comb[i-1][j-1];
                comb[i][j]%=mod;
            }
        }
    }
}

int expo(int base,int exponent)
{
    ll ans=1;
    while(exponent!=0){
        if(exponent&1)ans=(ans*base)%mod;
        base=(base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}

void sieve(int n)
{
    spf[1]=1;
    for(int i=2;i<=n;i++) spf[i]=i;
    for(int i=4;i<=n;i+=2) spf[i]=2;
    for(int i=3;i*i<=n;i++)
    {
        if(spf[i]==i)
        {
            for(int j=i*i;j<=n;j+=i)
            {
                if(spf[j]==j) spf[j]=i;
            }
        }
    }
}

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;
    x = x % p;
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;
        x = (x*x) % p; 
    } 
    return res; 
}

void inc(ll pos) {
    for (; pos < MAXN; pos |= (pos + 1)) {
        tree[pos] += 1;
    }
}
 
ll get(ll pos) {
    ll ans = 0;
    for (; pos >= 0; pos = (pos & (pos + 1)) - 1) {
        ans += tree[pos];
    }
    return ans;
}

ll get_kth(ll k) {
    ll l = -1, r = MAXN;
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        if (get(mid) < k) {
            l = mid;
        } else {
            r = mid;
        }
    }
    return r;
}

ll modInverse(ll n, ll p) 
{ 
    return power(n, p-2, p); 
} 

ll nCrModPFormat(ll n, ll r, ll p) 
{ 
    fac[0]=1;
    for(int i=1; i<200005; i++)
    {
        fac[i]=(fac[i-1]*i)%mod;
    }
    if (r==0) 
        return 1; 
    return (fac[n]* modInverse(fac[r], p) % p * modInverse(fac[n-r], p) % p) % p; 
}


Measured memory_bytes: 3808
s = input()
old = ''
flag = 0
sample = [chr(i) for i in range(97, 97+26)]
if len(s) == 26:
    for i, s1 in enumerate(s[::-1]):
        if i != 0 and s1 < old[-1]:
            out = s[:len(s) - i - 1] + min([o for o in old if o > s1])
            print(out)
            exit()
        old += s1
    if flag == 0:
        out = -1
else:
    out = s + min(set(sample)-set(s))

print(out)

Measured memory_bytes: 3064
while 0<n=gets.to_i
p *(1..n).map{a,b,c,d,e,f,g,h,i=gets.split.map &:to_i
[(b+d+f+h)*60+c+e+g+i,a]}.sort.map{|i|i[1]}.values_at(0,1,-2)
end

Measured memory_bytes: 6256
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	int count;
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a+3);

	count = (a[2] - a[0]) / 2 + (a[2] - a[1]) / 2;
	if ((a[2] - a[1]) % 2 == 0 && (a[2] - a[0]) % 2 == 0){
		cout << count << endl;
	}
	else if((a[1] - a[0]) % 2 == 0){
		count++;
		cout << count << endl;
	}
	else {
		count += 2;
		cout << count << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<int, pair<int, int>> PP;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const ll mod = 1e+9 + 7;
const int INF = 1001001001;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

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

    int n;
    ll T;
    cin >> n >> T;
    ll limit = 0;
    ll res = 0;
    for(int i = 0; i < n; ++i){
        ll t;
        cin >> t;
        if(t >= limit){
            res += T;
            limit = t + T;
        }
        else{
            res += T - (limit - t);
            limit = t + T;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    Program().solve()
}

class Program {
    fun solve() {
        val sc = MyScanner()
        val x = sc.nextInt()
        var s = 0
        for(i in 1..99999999){
            s += i
            if(s >= x){
                println(i)
                return
            }
        }
    }
}

class MyScanner {
    private var ptr = 0
    private var l = listOf<String>()

    fun next(): String {
        while (l.size <= ptr) {
            l = readLine()!!.split(' ')
            ptr = 0
        }
        return l[ptr++]
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextDouble() = next().toDouble()
    fun nextCharArray() = next().toCharArray()
    fun nextChar() = next()[0]

    fun list(): List<String> {
        ptr = l.size
        return readLine()!!.split(' ')
    }

    fun intList() = list().map { s -> s.toInt() }
    fun longList() = list().map { s -> s.toLong() }
    fun doubleList() = list().map { s -> s.toDouble() }

    fun array() = list().toTypedArray()
    fun intArray() = intList().toIntArray()
    fun longArray() = longList().toLongArray()
    fun doubleArray() = doubleList().toDoubleArray()
}


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

using namespace std;

set <int> d;

int main()
{
    #ifdef HOME
        freopen("input.txt", "rt", stdin);
    #endif // HOME
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        int x;
        cin >> x;
        if (d.find(x) == d.end())
            d.insert(x);
        else
            d.erase(x);
    }
    cout << d.size();
    return 0;
}


Measured memory_bytes: 4864
import { readFileSync } from "fs";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const range = (n: number | bigint) => [...Array(Number(n))].map((_, i) => i);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const tuple = <T extends unknown[]>(...ts: T) => ts;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [cin, nCin, biCin] = (() => {
  const inputs = readFileSync("/dev/stdin", "utf-8").split(/[\n|\s]+/);
  let count = 0;
  const cin = () => inputs[count++];
  return tuple(
    cin,
    () => Number(cin()),
    () => BigInt(cin())
  );
})();
type NumberOrBigintOrElse<T> = T extends number
  ? number
  : T extends bigint
  ? bigint
  : undefined;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const isNumber = (x: unknown): x is number => typeof x === "number";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const isBigint = (x: unknown): x is bigint => typeof x === "bigint";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const max = <T>(...ts: T[]): NumberOrBigintOrElse<T> =>
  (ts.length === 0
    ? undefined
    : typeof ts[0] === "number"
    ? Math.max(...((ts as unknown) as number[]))
    : ((ts as unknown) as bigint[]).reduce((acc, t) =>
        acc >= t ? acc : t
      )) as NumberOrBigintOrElse<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const min = <T>(...ts: T[]): NumberOrBigintOrElse<T> =>
  (ts.length === 0
    ? undefined
    : typeof ts[0] === "number"
    ? Math.min(...((ts as unknown) as number[]))
    : ((ts as unknown) as bigint[]).reduce((acc, t) =>
        acc <= t ? acc : t
      )) as NumberOrBigintOrElse<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const abs = <T>(t: T): NumberOrBigintOrElse<T> =>
  (typeof t === "number"
    ? t >= 0
      ? t
      : -t
    : typeof t === "bigint"
    ? t > 0n
      ? t
      : -t
    : undefined) as NumberOrBigintOrElse<T>;

/**
 * Program
 */
type Color = "R" | "W";

const getAnswer = (N: number, cs: Color[]): number => {
  const rNum = cs.filter((c) => c === "R").length;
  return min(rNum, N - rNum, cs.slice(0, rNum).filter((c) => c === "W").length);
};

{
  const N = nCin();
  const cs = cin()
    .split("")
    .map((c) => c as Color);
  const ans = getAnswer(N, cs);
  console.log(ans);
}


Measured memory_bytes: 41288
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    
    int k = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();
 
    int mulValue = k;
    
    for(int mulCount = 1; mulValue <= b; mulCount++){
      mulValue = k * mulCount;
      if(a <= mulValue && mulValue <= b){
        System.out.println("OK");
        return;
      }
    }
    System.out.println("NG");
  }
}

Measured memory_bytes: 35608
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(min(a + 1, x // 500 + 1)):
    rest1 = x - 500 * i
    for j in range(min(b + 1, rest1 // 100 + 1)):
        rest2 = rest1 - 100 * j
        if 50 * c >= rest2:
            ans = ans + 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL

#define PI 3.14159265358979

int main(){
	double R;
	cin >> R;
	cout << 2 * R * PI << endl;
}


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

int main() {
  int N, M, X;
  cin >> N >> M >> X;
  vector<int> C(N);
  vector<vector<int>> A(N, vector<int>(M));
  rep(i, N){
    cin >> C[i];
    rep(j, M) cin >> A[i][j];
  }

  vector<ll> ans(0);

  rep(i, 1 << N){
    vector<int> B(N, 0);
    ll sum = 0;
    bitset<12> s(i);
    rep(j, N){
      if(s.test(j)){
        sum += C[j];
        rep(k, M) B[k] += A[j][k];
      }
    }
    bool h = true;
    rep(l, M){
      if(B[l] < X) h = false;
    }
    if(h) ans.push_back(sum);
  }

  if(ans.size() == 0) cout << "-1" << endl;
  else{
    sort(ans.begin(), ans.end());
    cout << ans[0] << endl;
  }
}


Measured memory_bytes: 3672
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <functional>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define LL long long
#define ll long long
#define ULL unsigned long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

int a,b;

int main(){

	cin >> a >> b;

	int sum = 0;
	if (b < 0) {
		if (a+b >0){
			sum = b*a + a*(a-1)/2;
		} else {
			sum = b*(a-1) + (a-1) * (a-2) / 2;
		}
	} else {
		sum = (b+1)*(a-1) + (a-1) * (a-2) / 2;
	}
	cout << sum;


}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int A = sc.nextInt();
      	int B = sc.nextInt();
      	int C = sc.nextInt();
      	int D = sc.nextInt();
      int aAtack = C / B;
      if (C % B != 0) aAtack += 1;
      int tAtack = A / D;
      if (A % D != 0) tAtack += 1;
      boolean isWin = aAtack <= tAtack; 
      String ans = "No";
        if(isWin) ans="Yes";
      System.out.println(ans);
    } 
}

Measured memory_bytes: 35784
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX_N (1010)

int dp[MAX_N][MAX_N];

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

    for ( int t = 0; t < q; t++ ) {
	string X;
	string Y;
	cin >> X;
	cin >> Y;

	dp[0][0] = ( X[0] == Y[0] ) ? 1 : 0;

	for ( int i = 1; i < X.size(); i++ ) {
	    dp[i][0] = ( X[i] == Y[0] ) ? 1 : dp[i-1][0];
	}
	
	for ( int i = 1; i < Y.size(); i++ ) {
	    dp[0][i] = ( X[0] == Y[i] ) ? 1 : dp[0][i-1];
	}

	for ( int i = 1; i < X.size(); i++ ) {
	    for ( int j = 1; j < Y.size(); j++ ) {
		dp[i][j] = ( X[i] == Y[j] ) ? dp[i-1][j-1] + 1 : max( dp[i][j-1], dp[i-1][j] );
	    }
	}

	printf("%d\n", dp[X.size()-1][Y.size()-1]);
    }

    return 0;
}

Measured memory_bytes: 5172
// Next or Nextnext
// * frank_c1
// * 2017 / 09 / 29

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

LL pow_mod(LL b, LL p, LL k) {
	LL ret = 1;
	for (; p; p >>= 1) {
		if (p & 1) ret = ret * b % k;
		b = b * b % k; 
	} return ret;
}

const int maxn = (int)(1e5) + 5;
const int mo = (int)(1e9) + 7;
int a[maxn], in[maxn], w[maxn], cnt[maxn], vi[maxn], s[maxn];
int q[maxn], l = 1, r, len;
LL fac[maxn], ivf[maxn], pw[maxn];

inline LL C(int n, int m) {
	if (m < 0 || n - m < 0) return 0;
	return (fac[n] * ivf[m] % mo) * ivf[n - m] % mo;
}

inline LL F(int n, int m) {
	return (C(n, m << 1) * C(m << 1, m) % mo) * (pow_mod(pw[m], mo - 2, mo) * fac[m] % mo) % mo;
}

int calc() {
	LL now = 1;
	for (int i = 1; i <= len; ++i) if (cnt[w[i]]) {
		int ps = i, v = 0;
		do {
			++v; --ps; if (ps < 1) ps = len;
		} while (!cnt[w[ps]]);
		if (v < cnt[w[i]]) return 0;
		if (v > cnt[w[i]]) now = now * 2 % mo;
	} return now;
}

int main() {
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), ++in[a[i]];
	fac[0] = ivf[0] = pw[0] = 1;
	for (int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mo, pw[i] = pw[i - 1] * 2 % mo;
	ivf[n] = pow_mod(fac[n], mo - 2, mo);
	for (int i = n - 1; i >= 1; --i) ivf[i] = ivf[i + 1] * (i + 1) % mo;
	memcpy(w, in, sizeof(in));
	for (int i = 1; i <= n; ++i) if (!in[i]) q[++r] = i;
	for (; l <= r; ) {
		int x = q[l++];
		if (!(--in[a[x]])) q[++r] = a[x]; cnt[a[x]] = cnt[x] + 1;
	}
	for (int i = 1; i <= n; ++i) if (w[i] - in[i] > 1) return printf("0\n"), 0;
	LL ret = 1;
	for (int i = 1; i <= n; ++i) if (in[i] && !vi[i]) {
		int x = i, c = 0; len = 0;
		while (!vi[x]) {
			w[++len] = x; vi[x] = 1; if (cnt[x]) c = 1; x = a[x];
		}
		if (!c) ++s[len]; else ret = ret * calc() % mo;
	} 
	for (int i = 1; i <= n; ++i) if (s[i]) {
		LL tmp = 0, ww = 1; 
		for (int j = 0; j <= (s[i] >> 1); ++j) {
			LL buf = 1; 
			(buf *= (F(s[i], j) * ww % mo)) %= mo;
			if ((i & 1) && i > 1) (buf *= pw[s[i] - (j << 1)]) %= mo; 
			ww = ww * i % mo; (tmp += buf) %= mo; 
		} (ret *= tmp) %= mo;
	} 
	return printf("%lld\n", ret), 0;
}

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

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

    cout << (S > W ? "safe" : "unsafe") << endl;

    return 0;
}

Measured memory_bytes: 3624
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

ll N;
ll arr[15];

int main() {
	scanf("%lld", &N);
	for(int i = 0; i < N; i++) {
		scanf("%lld", &arr[i]);
	}
	sort(arr, arr + N);
	ll sum = 0;
	for(int i = 0; i < N - 1; i++) {
		sum += arr[i];
	}
	if(sum > arr[N - 1]) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}
	return 0;
}
/*
	Powered by Buggy Plugin
*/


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

int solve(int n,int k,int arr[])
{
    int dp[n+1];
    dp[1]=0;
    for(int i=2;i<=n;i++)
    {
        int min=INT_MAX;
        for(int j=1;j<=k&&(i-j>=1);j++)
        {
                if(min>(abs(arr[i]-arr[i-j])+dp[i-j]))
                {
                    min=(abs(arr[i]-arr[i-j])+dp[i-j]);
                }
        }
        dp[i]=min;
    }
    return dp[n];
}

int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n+1];
    for(int i=1;i<=n;i++)
    {
        cin>>arr[i];
    }
    cout<<solve(n,k,arr);

    return 0;
}

Measured memory_bytes: 1024
import numpy as np
h,w=map(int,input().split())
a=np.array([list(input()) for i in range(h)])
c=0
for j in range(h,0,-1):
    if all([k=='.' for k in a[j-1,:]]):
        a=np.delete(a,j-1,0)
        c+=1
for l in range(w,0,-1):
    if all([n=='.' for n in a[:,l-1]]):
        a=np.delete(a,l-1,1)
for m in range(h-c):
    print(''.join(a[m,:]))

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

constexpr int M = 100010;
int main(){
    int Q;
    cin >> Q;

    bool data[M] = {};
    for(int i = 2; i < M; ++i){
        bool check = true;
        for(int j = 2; j * j <= i; ++j){
            if(i % j == 0){
                check = false;
                break;
            }
        }
        if(check) data[i] = 1;
    }
    vector<int> data2(M);
    for(int i = 2; i < M; ++i){
        if(data[i] && data[(i + 1) / 2]){
            data2[i] = 1;
        }
    }
    for(int i = 2; i < M; ++i){
        data2[i] += data2[i - 1];
    }
    for(int i = 0; i < Q; ++i){
        int l, r;
        cin >> l >> r;
        cout << data2[r+1] - data2[l-1] << endl;
    }
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

int main() {
    int a,b;
    string s;
    cin >> a >> b >> s;
    string ans = "Yes";
    if(s[a] == '-'){
        s.replace(a,1,"");
        for(int i = 0;i < s.length();i++){
            if(!(s[i] >= '0' && s[i] <= '9')){
                ans = "No";
            }
        }
    }else{
        ans = "No";
    }
    cout << ans << endl;
    
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    int n=readI();
    int a[]=new int[n];
    int b[]=new int[n];
    int count=0;
    for(int i=0;i<n;i++){
      a[i]=readI();b[i]=readI();
    }
    Arrays.sort(a);Arrays.sort(b);
    if(n%2==1){
      count=b[n/2]-a[n/2]+1;
    }else{
      count=(b[n/2]+b[n/2-1])-(a[n/2]+a[n/2-1])+1;
    }
    pl(count+"");
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
}


Measured memory_bytes: 60688
h, w = map(int, input().split())
g = [[True]*(w+2)]
for i in range(h):
    g.append([True] + [a == '#' for a in input()] + [True])
g.append([True]*(w+2))

bp = []
for i in range(1, h+1):
    for j in range(1, w+1):
        if g[i][j]:
            bp.append((i, j))

cnt = 0
while bp:
    p = []
    for i, j in bp:
        if not g[i+1][j]:
            g[i+1][j] = True
            p.append((i+1, j))
        if not g[i-1][j]:
            g[i-1][j] = True
            p.append((i-1, j))       
        if not g[i][j+1]:
            g[i][j+1] = True
            p.append((i, j+1))
        if not g[i][j-1]:
            g[i][j-1] = True
            p.append((i, j-1))
    cnt += 1
    bp = p
print(cnt-1)

Measured memory_bytes: 105980
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
	bool f[31];
	memset(f, -1, sizeof f);
	for(int i = 0; i < 28; i++) {
		int t;
		scanf("%d", &t);
		f[t] = false;
	}
	for(int i = 1; i <= 30; i++) {
		if(f[i]) {
			printf("%d\n", i);
		}
	}
	return 0;
}

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

using P = pair<int, int>;

int idx(vector<int> const& v, int i) {
    return lower_bound(v.begin(), v.end(), i) - v.begin();
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> sum(n+2, vector<int>(n+2));
    vector<int> xs(n), ys(n);
    vector<int> x(n), y(n);
    for(int i=0; i<n; ++i) {
        cin >> x[i] >> y[i];
        xs[i] = x[i];
        ys[i] = y[i];
    }
    sort(x.begin(), x.end());
    x.erase(unique(x.begin(), x.end()), x.end());
    sort(y.begin(), y.end());
    y.erase(unique(y.begin(), y.end()), y.end());

    for(int i=0; i<n; ++i) {
        int tx = idx(x, xs[i]);
        int ty = idx(y, ys[i]);
        ++sum[ty+1][tx+1];
    }
    for(int i=0; i<y.size(); ++i) {
        for(int j=0; j<x.size(); ++j) {
            sum[i+1][j+1] += sum[i+1][j] + sum[i][j+1] - sum[i][j];
        }
    }

    for(int i=0; i<m; ++i) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        x1 = idx(x, x1);
        y1 = idx(y, y1);
        x2 = idx(x, x2+1);
        y2 = idx(y, y2+1);
        cout << sum[y2][x2] - sum[y2][x1] - sum[y1][x2] + sum[y1][x1] << endl;
    }
}


Measured memory_bytes: 101012
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
#include <queue>
#include <functional>
using namespace std;

typedef pair<int,int> pii;

int main(){
	int n, m, c;
	int fi, ti, ci;

	int pii::*cost = &pii::first;
	int pii::*v = &pii::second;

	vector<pii>::iterator it;
	
	while( scanf("%d%d%d", &n, &m, &c), n != 0 ){
		vector<vector<pii> > edges(n + 1);
		for(int i = 0; i < m; ++i){
			scanf("%d%d%d", &fi, &ti, &ci);
			edges[fi].push_back( pii(ci, ti) );
		}

		vector<vector<int> > dp( n + 2, vector<int>(n + 1, 1e9) );
		dp[0][1] = 0;

		for(int k = 0; ; ++k){
			priority_queue<pii,vector<pii>,greater<pii> > pq;
			for(int i  = 1; i <= n; ++i){
				pq.push( pii(dp[k][i], i) );
			}

			while( !pq.empty() ){
				pii p = pq.top();
				pq.pop();

				if( dp[k][p.*v] != p.*cost ){
					continue;
				}

				for(it = edges[p.*v].begin(); it != edges[p.*v].end(); ++it){
					int a = dp[k][p.*v] + (*it).*cost;
					if( dp[k][(*it).*v] > a ){
						dp[k][(*it).*v] = a;
						pq.push( pii(a, (*it).*v) );
					}

					a = min(dp[k + 1][(*it).*v], dp[k][p.*v]);
					dp[k + 1][(*it).*v] = a;
				}
			}

			if( dp[k][n] <= c ){
				printf("%d\n", k);
				break;
			}
		}
	}
}

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

int main() {
  string s, t;
  cin >> s >> t;
  bool r = false;
  for (int i = 0; i < s.size(); i++) {
    r |= s.substr(i) + s.substr(0, i) == t;
  }
  cout << (r ? "Yes" : "No") << endl;
}


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

using graph = vector<vector<int>>;

int main() {
  int n, x, y;
  cin >> n >> x >> y;
  graph to(n);
  for (int i = 1; i < n - 1; i++) {
    to.at(i).push_back(i - 1);
    to.at(i).push_back(i + 1);
  }
  to.at(0).push_back(1);
  to.at(n - 1).push_back(n - 2);
  to.at(x - 1).push_back(y - 1);
  to.at(y - 1).push_back(x - 1);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    vector<int> d(n, -1);
    queue<pair<int, int>> q;
    q.emplace(i, 0);
    d.at(i) = 0;
    while (!q.empty()) {
      auto x = q.front();
      q.pop();
      int pos = x.first, d0 = x.second;
      for (int next : to.at(pos)) {
        if (d.at(next) >= 0) continue;
        q.emplace(next, d0 + 1);
        d.at(next) = d0 + 1;
      }
    }
    for (int j = i + 1; j < n; j++) {
      ans.at(d.at(j))++;
    }
  }
  for (int i = 1; i < n; i++) {
    cout << ans.at(i) << "\n";
  }
}


Measured memory_bytes: 384
N = int(input())
H = list(map(int,input().split()))
c = 0
t = 0
for i in range(1,N):
  if H[i] <= H[i-1]:
    t += 1
  else:
    if c < t:
      c = t
    t = 0
if c < t:
  c = t
print(c)

Measured memory_bytes: 14224
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
  int a,b,s=0;
  cin>>a>>b;
  rep(i,0,b-a+1) s+=i;
  cout<<s-b;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
#define rep2(i,a,n) for (int i = a; i < n; i++)
using namespace std;
int main() {
    int N; cin >> N;
    int res = 0;
    for (int i = 1; i <= N; i += 2) {
        int cur = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) cur++;
        }
        if (cur == 8) res++;
    }
    printf("%d\n", res);
    return 0;
}


Measured memory_bytes: 3720
//AGC 003-B
#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <numeric>
#include <string>
#include <map>
#include <sstream>
using namespace std;

int main() {
	long long A, B, C;
	long long ans;
	cin >> A >> B >> C;
	if (A*B*C % 2 == 0) ans = 0;
	else {
		long long anstemp = min(A*B, B*C);
		ans = min(anstemp, C*A);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
typedef long double lb;
typedef long double ld;
typedef pair<int,int> P;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0L)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1e9+7;
#define INF 1e12;
#define EPS 1e-9;

//----***入出力***---
#define print(out) cout<< out  << "\n";
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}initial_;


signed main(){
  int N,a;cin>>N;
  deque<int> b;
  REP(i,0,N){
    cin>>a;
    if(i%2==0){
      b.push_back(a);
    }
    else {
      b.push_front(a);
    }
  }
  if(N%2==1){
    deque<int>::iterator right=b.end(),left=b.begin();
    right--;
      for(;;right--){
        cout<<(*right);
        if(right==left){
          cout<<"\n";
          return 0;
        }
      cout<<" ";
      }
  }
  else {
    deque<int>::iterator right=b.end(),left=b.begin();
      for(;;left++){
        
        if(right==left){
          cout<<"\n";
          return 0;
        }
      cout<<(*left);
      cout<<" ";
      }
  }

  

}


Measured memory_bytes: 3840
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        Int N;
        cin >> N;
        vector<Int> A(N);
        set<Int> B;
        for (int i = 0; i < N; ++i) {
            Int tmp;
            cin >> tmp;
            A[i] = tmp;
            B.insert(tmp);
        }
        if (A.size() == B.size()) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 12544
import sys
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False

def ddprint(x):
  if DBG:
    print(x)

n = inn()
dst = [ [] for i in range(n) ]
for i in range(n-1):
    a,b = inm()
    a -= 1
    b -= 1
    dst[a].append((b,i+1))
    dst[b].append((a,i+1))

narcs = [len(x) for x in dst]
mx = max(narcs)
for i in range(n):
    if narcs[i]==mx:
        mxi = i
        break

color = [-1]*n
color[dst[mxi][0][1]] = 0
q = [mxi, dst[mxi][0][0]]
while len(q)>0:
    p = q.pop()
    for i in range(len(dst[p])):
        arc = dst[p][i][1]
        if color[arc] != -1:
            c = color[arc]
            arc0 = arc
            break
    for i in range(len(dst[p])):
        arc = dst[p][i][1]
        if arc==arc0:
            continue
        nd = dst[p][i][0]
        c = (c+1)%mx
        color[arc] = c
        q.append(nd)

print(mx)
for i in range(1,n):
    print(color[i]+1)


Measured memory_bytes: 73120
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>
#include <cmath>
#include <cstring>
#include <map>
#include <unordered_map>
#include <sstream>
#include <iomanip>

using namespace std;
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; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

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

	ll N, M;
	cin >> N >> M;

	vector<ll> A(M);
	for (ll i = 0; i < M; ++i) cin >> A[i];

	ll ans = N;
	for (ll i = 0; i < M; ++i) ans -= A[i];

	if (ans < 0) ans = -1;

	cout << ans << endl;
}


Measured memory_bytes: 3724
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int Max = 1000000;
int main(){
  	ll a, b;
    cin >> a >> b;

    if(a <= 0){
        if(b>=0){
        cout << "Zero" <<endl;
      }else{
        if((b-a)%2==0){
          cout << "Negative" <<endl;
        }else{
          cout << "Positive" <<endl;
        }
      }
    }else{
      cout << "Positive" <<endl;
    }
    

  	return 0;
}


Measured memory_bytes: 256
#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;

int main(){ 
  int h, a;
  cin >> h >> a;
  cout << (h + a - 1) / a << endl;
  return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <limits>
#include <algorithm>
#include <utility>
#include <sstream>
#include <numeric>
#include <iterator>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef pair<int, int> P;

int main(int argc, const char * argv[]) {
  vector<int> vec = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k;
  cin >> k;
  k--;
  cout << vec[k] << endl;
  return 0;
}


Measured memory_bytes: 256