akhauriyash/Code-Regression huggingface dataset:
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector<double> vd;
typedef std::vector<std::string> vs;
typedef std::vector<pii> vpii;
typedef std::vector<vi> vvi;
typedef std::vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { rep(i,v.size()) is >> v[i]; return is; }
template<typename A, typename B> std::istream &operator>>(std::istream &is, std::pair<A, B> &p) { is >> p.first; is >> p.second; return is; }
using namespace std;
// clang-format on

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(const int &s = 0, const int &d = 0, const Weight &w = 0) : src(s), dst(d), weight(w) {}
};

typedef std::vector<Edge> Edges;
typedef std::vector<Weight> Array;
typedef std::vector<Array> Matrix;

class Graph {
  std::vector<Edges> g;

public:
  Graph(const int &size = 0) : g(size) {}
  int size() const { return g.size(); }
  const Edges &operator[](const int &i) const { return g[i]; }
  void addArc(const int &src, const int &dst, const Weight &w = 1) { g[src].emplace_back(src, dst, w); }
  void addEdge(const int &node1, const int &node2, const Weight &w = 1) {
    addArc(node1, node2, w);
    addArc(node2, node1, w);
  }
};

template<int inf = std::numeric_limits<Weight>::max() / 8> std::pair<std::vector<Weight>, std::vector<int>> dijkstra(const Graph &g, const int &src) {
  using state = std::pair<Weight, int>;
  std::priority_queue<state, std::vector<state>, std::greater<state>> q;
  std::vector<Weight> dist(g.size(), inf);
  std::vector<int> via(g.size());
  dist[src] = 0;
  q.emplace(0, src);
  while (q.size()) {
    Weight d;
    int v;
    std::tie(d, v) = q.top();
    q.pop();
    if (dist[v] < d) continue;
    for (auto &e : g[v]) {
      if (cmin(dist[e.dst], dist[v] + e.weight)) {
        via[e.dst] = v;
        q.emplace(dist[e.dst], e.dst);
      }
    }
  }
  return {dist, via};
}
main {
  int n, m;
  while (cin >> n >> m, n) {
    Graph g(n * 3);
    while (m--) {
      int a, b, c;
      cin >> a >> b >> c;
      --a, --b;
      g.addEdge(a, b, c);
      g.addEdge(n * 2 + a, n * 2 + b, c);
      g.addArc(a, n + b, 0);
      g.addArc(b, n + a, 0);
      g.addArc(n + a, n * 2 + b, 0);
      g.addArc(n + b, n * 2 + a, 0);
    }
    vector<Weight> dist = dijkstra(g, 0).first;
    cout << min({dist[n - 1], dist[n * 3 - 1]}) << endl;
  }
}

Measured memory_bytes: 3208
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (k : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  let
    queue = [1..9] ++ f queue :: [Int]
      where
        f (l : ls) = g l ++ f ls
        g l | d == 0    = [l', l' + 1]
            | d == 9    = [l' + 8, l' + 9]
            | otherwise = [l' + pred d, l' + d, l' + succ d]
          where
            d = l `mod` 10
            l' = 10 * l
  print . head . drop (pred k) $ queue

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n


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

int main(){
    int n;
    cin>>n;
    vector<Pii> x(n);
    rep(i,n) x[i].second=i;
    rep(i,n) cin>>x[i].first;
    sort(x.begin(), x.end());
    vector<int> a(n);
    rep(i,n) a[x[i].second]=i;
    rep(i,n){
        if(a[i]<n/2) cout<<x[n/2].first<<endl;
        else cout<<x[n/2-1].first<<endl;
    }
    return 0;
}

Measured memory_bytes: 4480
#include <bits/stdc++.h>
using namespace std;using ll=int_fast64_t;using ld=long double;using pll=pair<ll,ll>;using pld=pair<ld,ld>;
const ll INF=1LL<<60;void solve();int main(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(10);solve();}
#define foreach(i,a) for(auto &i:a)
#define SELECTOR(_1,_2,_3,_4,SELECT,...) SELECT
#define rep(...) SELECTOR(__VA_ARGS__,_rep2,_rep1,_rep0)(__VA_ARGS__)
#define _rep0(i,n) for(ll i=0;i<n;++i)
#define _rep1(i,k,n) for(ll i=k;i<n;++i)
#define _rep2(i,k,n,d) for(ll i=k;d!=0&&d>0?i<n:i>n;i+=d)
template<class T> vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<class... Ts> auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<class T> inline bool chmax(T &a,const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a,const T &b){if(a>b){a=b; return 1;} return 0;}

void solve(){
  ll n,W; cin>>n>>W;
  vector<pll> VW(n);
  rep(i,n){
    ll v,w; cin>>v>>w;
    VW[i]={v,w};
  }

  vector<ll> dp(W+1);
  rep(i,W+1){
    ll res=0;
    rep(j,n){
      ll v,w; tie(v,w)=VW[j];
      if(i>=w) chmax(res,dp[i-w]+v);
    }
    dp[i]=res;
  }

  cout<<*max_element(dp.begin(),dp.end())<<"\n";
}


Measured memory_bytes: 3240
N, M, Q = map(int, input().split())
f = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
for _ in range(M):
    l, r = map(int, input().split())
    f[r][l] += 1
for x in range(1, N + 1):
    for y in range(1, N + 1):
        f[y][x] += f[y-1][x]
for y in range(1, N + 1):
    for x in range(1, N + 1):
        f[y][x] += f[y][x-1]
for _ in range(Q):
    l, r = map(int, input().split())
    print(f[r][r] - f[l-1][l] - f[r][l-1] + f[l-1][l-1])


Measured memory_bytes: 13420
void main()
{
    string s = rdStr;

    writeln(s[2] == s[3] && s[4] == s[5] ? "Yes" : "No");
}

enum long mod = 10^^9 + 7;
enum long inf = 1L << 60;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N; cin >> N;
    vec t(N), a(N);
    rep(i, N) cin >> t[i] >> a[i];
    ll res1 = 0, res2 = 0;
    rep(i, N){
        if(res1 > t[i] || res2 > a[i]){
            // ll tmp = max(ceil((double)res1/t[i]), ceil((double)res2/a[i]));
            ll tmp = max((res1+t[i]-1)/t[i], (res2+a[i]-1)/a[i]);
            res1 = t[i]*tmp;
            res2 = a[i]*tmp;
        }else{
            res1 = t[i];
            res2 = a[i];
        }
    }
    cout << res1+res2 << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>


using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };

#define ARRAY_MAX 1010

const ll INF = 1e17 + 7;
const int MOD = 1e9 + 7;

ll dp[ARRAY_MAX][ARRAY_MAX];//dp[i][j]:=i日目に都市jにいる時の最小コスト

int main() {

	ll n, m;
	cin >> n >> m;
	vector<ll> d(n), c(m);

	for (ll i = 0; i < n; i++)
	{
		cin >> d[i];
	}

	for (ll i = 0; i < m; i++)
	{
		cin >> c[i];
	}


	for (int i = 0; i < ARRAY_MAX; i++)
	{
		for (int j = 0; j < ARRAY_MAX; j++)
		{
			dp[i][j] = INF;
		}
	}
	dp[0][0] = 0LL;

	for (ll i = 0; i < m; i++)
	{
		//i日目に
		for (ll j = 0; j <= n; j++)
		{
			
			//都市jにいる
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j]);//移動しない]
			if (j + 1 <= n)
			{
				dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j] + d[j] * c[i]);//移動する
			}
		}
	}

	cout << dp[m][n] << endl;	
}


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

int main() {
  int n,count=0; cin>>n;
  vector<int> p(n); vector<int> q(n);
  rep (i,n) cin>>p[i];
  rep (i,n) q[i]=p[i];
  sort(q.begin(),q.end());
  rep (i,n) {
    if(p[i]==q[i]) count++;
  }
  if(n-2==count or n==count) cout<<"YES"<< endl;
  else cout << "NO" << endl;
  return 0;
}

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

///#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,avx,sse4.1,sse4.2,mmx")
///#pragma GCC optimize ("unroll-loops")
///#pragma GCC optimize ("Ofast")
///#pragma GCC optimize ("O3")

using namespace std;

#define int long long
#define ff first
#define ss second
#define db double
#define ld long double
#define pb push_back

const int N = 1e6 + 5, M = 1e3 + 5;
const int inf = 1e9 + 100, mod = 1e9 + 7;
const ld eps = 1e-9, pi = atan2(0, -1);

mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r){
    return mt_rnd_64() % (r - l + 1) + l;
}

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

    cout << (n + 999) / 1000 * 1000 - n;
    return 0;
}
/// hto ya? zvychayna domohospodarka chy president Ykrainy?


Measured memory_bytes: 3648
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;

#define DE 1
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(__typeof__(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}



const int MAX_N = 100100;
int SIZE;

template<class T> struct BIT {    
    T dat[MAX_N+1];
    
    BIT() {}
    void init(int n = 1) {
        SIZE = n;
        for (int i = 0; i < SIZE+1; ++i) dat[i] = 0;
    }
    inline T operator [] (int i) {return sum(i) - sum(i-1);}
    
    inline void add(int i, int x) {
        if (i == 0) return;
        while (i <= SIZE) {
            dat[i] = dat[i] + x;
            i += i & -i;
        }
    }
    
    inline T sum(int i) {
        T res = 0;
        while (i > 0) {
            res = res + dat[i];
            i -= i & -i;
        }
        return res;
    }
    
    inline T sum(int a, int b) {
        return sum(b-1) - sum(a-1);
    }
    
    friend ostream& operator << (ostream& s, BIT bit) {
        for (int i = 1; i < SIZE; ++i) s << bit[i] << ", ";
        return s;
    }
    
};

BIT<int> bit;
int n, m, a, d, A, B;

int main() {
    cin >> n >> m;
    bit.init(n);
    
    for (int i = 0; i < n-1; ++i) {
        scanf("%d", &a);
        bit.add(i+1, a);
    }
    
    //cout << bit << endl;
    
    int now = 1, res = 0;
    for (int i = 0; i < m; ++i) {
        scanf("%d", &d);
        int next = now + d;
        A = min(now, next);
        B = max(now, next);
        int sum = bit.sum(A, B);
        
        //cout << A << ", " << B << " : " << sum << endl;
        
        res += sum; 
        if (res > 100000) res %= 100000;
        now = next;
    }
    cout << res << endl;
    
    return 0;
}


Measured memory_bytes: 1636
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
long long llabs(long long a){
	return a>0?a:-a;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
	return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
	return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
	return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
	int t=*a;
	*a=*b;
	*b=t;
}
long long gcd(long long x,long long y){
	return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
	return x/gcd(x,y)*y;
}

int main(void){
	int n=in(),a=in();
	puts(n%500<=a?"Yes":"No");
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, _, W = MAP()
A = [W] + LIST()

# memo[i][j] := 現在iターンで、山札からj枚目まで取った状態
memo = list2d(2, N+1, None)
def rec(turn, cnt):
    if memo[turn][cnt] is not None:
        return memo[turn][cnt]
    # 先手番
    if turn % 2 == 0:
        res = -INF
        for nxt in range(cnt+1, N):
            res = max(res, rec(1-turn, nxt))
        # 最後まで取る時は、結果を取得
        res = max(res, abs(A[N]-A[cnt]))
    # 後手番
    else:
        res = INF
        for nxt in range(cnt+1, N):
            res = min(res, rec(1-turn, nxt))
        res = min(res, abs(A[cnt]-A[N]))
    memo[turn][cnt] = res
    return res

ans = rec(0, 0)
print(ans)


Measured memory_bytes: 4852
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    string s; cin>>s;
    int N=s.size();

    reverse(ALL(s));
    for(int i=0;i<N;){
        if(s.substr(i,5)=="maerd") i+=5;
        else if(s.substr(i,7)=="remaerd") i+=7;
        else if(s.substr(i,5)=="esare") i+=5;
        else if(s.substr(i,6)=="resare") i+=6;
        else{
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    
}


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

typedef signed long long ll;

int main() {
    string c;
    cin >> c;
    if(c[0] == 'a' || c[0] == 'e' || c[0] == 'i' || c[0] == 'o' || c[0] == 'u')
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

K,X = II()

if 500*K>=X:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38256
import fractions
A,B,C,D = [int(s) for s in input().split()]
g=C*D//fractions.gcd(C,D)
print(B-(A-1)
      -(B//C)+((A-1)//C)
      -(B//D)+((A-1)//D)
      +(B//g)-((A-1)//g))

Measured memory_bytes: 5048
#include <stdio.h>
#include <map>
using namespace std;
const int N=1e5+10;
const long long int INF=1LL<<60;
long long int a[N],tot=0,s[N];
map<long long int ,int>m;
bool check(long long int val,int pos){
    int temp=m.lower_bound(s[pos-1]+val)->second;
    long long int ans;
    if(temp==N)return false;
    ans=m.lower_bound(s[temp]+val)->first-s[pos-1];
    temp=m.lower_bound(s[temp]+val)->second;
    if(temp==N)return false;
    if(tot-ans<val)return false;
    return true;
}
int main(){
    long long int l=0,r,mid;
    int n;
    scanf("%d",&n);
    s[0]=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        tot+=a[i];
        s[i]=s[i-1]+a[i];
        m.insert({s[i],i});
    }
    m.insert({INF,N});
    for(int i=1;i<=n;i++){
        r=tot;
        while(r-l>1){
            mid=(r+l)>>1;
            if(check(mid,i))l=mid;
            else r=mid;
        }
    }
    printf("%lld\n",l);
}


Measured memory_bytes: 10600
#!/usr/bin/env python3
import sys


def solve(S: int):
    s_array = list(str(S))
    N = len(s_array) - 1

    sum = 0
    for bit in range(2 ** N):
        num_string = s_array[0]
        for i in range(N):
            if not (bit & 1 << i):
                sum += int(num_string)
                num_string = ""
            num_string += s_array[i + 1]
        sum += int(num_string)
    print(sum)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#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 H, A;
  cin >> H >> A;
  int ans = 0;
  while (H > 0) {
    H -= A;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
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; }
//get the biggest element.
template<typename KeyType, typename ValueType>
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>;
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  });
}
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;

int main() {
  int n;
  cin >> n;
  vector<vector<int>> p(n, vector<int>(n, -1));
  rep (i, n) {
    int a;
    cin >> a;
    rep (j, a) {
      int x, y;
      cin >> x >> y;
      --x;
      p[i][x] = y;
    }
  }

  int ans = 0;
  for (int bit = 0; bit < 1 << n; bit++) {
    bool ok = true;
    vector<int> truth(n, -1);
    for (int i = 0; i < n; i++) {
      if (bit & 1 << i) {
        for (int j = 0; j < n; j++) {
          if (p[i][j] == -1) continue;
          if (p[i][j] == 0) {
            if (bit & 1 << j) ok = false;
          } else {
            if (!(bit & 1 << j)) ok = false;
          }
          if (truth[j] == -1) {
            truth[j] = p[i][j];
          } else {
            if (truth[j] != p[i][j]) ok = false;
          }
        }
      }
    }
    //if (ok) printf("bit = %d, popcount = %d\n", bit, __builtin_popcount(bit));
    if (ok) ans = max(ans, __builtin_popcount(bit));
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

int main()
{
    int N;
    cin >> N;
    vector<int> A(N);
    for(int& x: A) cin >> x;

    multiset<int> st;
    st.insert(A[0]);
    for(int i=1; i<N; i++){
        auto itr = st.lower_bound(A[i]);
        if(itr != st.begin()){
            itr--; st.erase(itr);
        }
        st.insert(A[i]);
    }

    cout << st.size() << endl;
}

Measured memory_bytes: 5376
k = int( input() )

lunlun_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]

def lunlun_maker( lun_num, lun_list ):
    if lun_num % 10 == 0:
        lun_list.append( lun_num * 10  )
        lun_list.append( lun_num * 10 + 1 )
    elif lun_num % 10 == 9:
        lun_list.append( lun_num * 10 + 8 )
        lun_list.append( lun_num * 10 + 9 )
    else:
        lun_list.append( lun_num * 10 + ( lun_num % 10 - 1 ) )
        lun_list.append( lun_num * 10 + ( lun_num % 10 ) )
        lun_list.append( lun_num * 10 + ( lun_num % 10 + 1 ) )

i = 0
while len( lunlun_numbers ) < 100000:
    lunlun_maker( lunlun_numbers[i], lunlun_numbers )
    i += 1

print( lunlun_numbers[ k - 1 ] )

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

void fnInput(vector<int> &a_rvoTarget, vector<int> &a_rvoSearch)
{
  int iTargetCnt;
  cin >> iTargetCnt;

  for (int i = 0; i < iTargetCnt; i++)
  {
    int iTarget;
    cin >> iTarget;
    a_rvoTarget.push_back(iTarget);
  }

  int iSearchCnt;
  cin >> iSearchCnt;

  for (int i = 0; i < iSearchCnt; i++)
  {
    int iSearch;
    cin >> iSearch;
    a_rvoSearch.push_back(iSearch);
  }
}

void fnLinearSearch(const vector<int> &a_cnrvoTarget, const vector<int> &a_cnrvoSearch, int &a_riFound)
{
  for (auto itvoSearch = begin(a_cnrvoSearch); itvoSearch != end(a_cnrvoSearch); itvoSearch++)
    for (auto itvoTarget = begin(a_cnrvoTarget); itvoTarget != end(a_cnrvoTarget); itvoTarget++)
      if (*itvoTarget == *itvoSearch)
      {
        a_riFound++;
        break;
      }
}

void fnResultOut(int a_iFound)
{
  cout << a_iFound << endl;
}

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

  vector<int> voTarget, voSearch;
  int iFound = 0;

  fnInput(voTarget, voSearch);
  fnLinearSearch(voTarget, voSearch, iFound);
  fnResultOut(iFound);

  return 0;
}

Measured memory_bytes: 1332
import math
while True:
    try:
        a,l,x=map(int,raw_input().split())
    except EOFError:
        break
    ADC=math.sqrt(pow((l+x)/2.0,2)-pow(l/2.0,2))*l/2
    ABC=math.sqrt(pow(l,2)-pow(a/2.0,2))*a/2
    print ABC+2*ADC

Measured memory_bytes: 4404
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
 
int main(){
    double x, h;
    while(cin >> x >> h, x != 0 || h != 0){
    printf("%.9lf\n", x * x + 2 * x * hypot(x / 2, h));
    }
    return 0;
}

Measured memory_bytes: 1248
import sys
n,m = map(int, input().split())
num = [0]*n
al = [-1]*n
Ans = 0
for i in range(m):
    s,c = map(int, input().split())
    if num[s-1] != 0 and num[s-1] != c:
        print(-1)
        sys.exit()
    else:
        num[s-1] = c
        al[s-1] = c
if al.count(0)==n and n >= 2:
    print(-1)
    sys.exit()
if al[0] == 0and n >= 2:
    print(-1)
    sys.exit()
if num[0] == 0 and n >= 2:
    num[0] = 1
for i in range(len(num)):
    Ans = Ans + num[i] * (10 ** (n-i-1))

if Ans == 0 and n >= 2:
    print(-1)
else:
    print(Ans)

Measured memory_bytes: 9252
#include <stdio.h>

int main(){
	int N, count = 0;
	scanf("%d", &N);
	
	if(N % 10 == 2) count++;
	if((N - N % 10) % 100 == 20) count++;
	if((N - N % 100) % 1000 == 200) count++;
	if((N - N % 1000) == 2000) count++;
	
	printf("%d\n", count);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
					
using namespace std;
			
typedef long long ll;
#define mp make_pair
#define pub push_back
#define x first
#define y second
#define all(a) a.begin(), a.end()
#define db long double
#define sz(a) (int)a.size()

ll l, r;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output1.txt", "w", stdout);
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> l >> r;
	ll last = l;
	int ans = 1;
	while(1){
		last *= 2;
		if (last > r) break;
		ans++;
	}
	cout << ans;
}

Measured memory_bytes: 256
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

# 美味しい順にソート
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

# 空のリストに、それぞれ食べられるまで値を入れる
basket = []
for x in range(X) :
  basket.append(p[x])

for y in range(Y) :
  basket.append(q[y])

for c in range(C) :
  basket.append(r[c])

# もう一度美味しい順にソート
basket.sort(reverse=True)

# 美味しいものから食べた時の総和
ans = 0
for eat in range(X+Y) :
  ans += basket[eat]

print(ans)

Measured memory_bytes: 22560
class UnionFind:
    # 初期化
    def __init__(self, n):
        # 根なら-size, 子なら親の頂点
        self.par = [-1] * n
        # 木の高さ
        self.rank = [0] * n

    # 検索
    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        # 異なる集合に属する場合のみ併合
        if x != y:
            # 高い方をxとする。
            if self.rank[x] < self.rank[y]:
                x,y = y,x
            # 同じ高さの時は高さ+1
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            # yの親をxとし、xのサイズにyのサイズを加える
            self.par[x] += self.par[y]
            self.par[y] = x

    # 同集合判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 集合の大きさ
    def size(self, x):
        return -self.par[self.find(x)]


n,m = map(int, input().split())
l = [[] for i in range(n+m)]
for i in range(n):
    k = list(map(int, input().split()))
    for j in range(1,k[0]+1):
        l[i].append(k[j]-1+n)
        l[k[j]-1+n].append(i)

u = UnionFind(len(l))
for i in range(len(l)):
    for j in range(len(l[i])):
        u.unite(i,l[i][j])

for i in range(n):
    if not u.same(0,i):
        print('NO')
        exit()
print('YES')


Measured memory_bytes: 85508
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <tuple>
#include <utility>
#include <stdlib.h>
#include <set>
#include <map>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define RSORT(x) sort(x.begin(),x.end(),greater<int>())
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define setp(x) setprecision(x)
using LL = long long;
using ULL = unsigned long long;

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int main() {
	LL A, B, C, D;
	cin >> A >> B >> C >> D;
	LL GCD = gcd(C, D);
	if (A == B) {
		if (A % C == 0 || A % D == 0) {
			cout << 0 << endl;
			return 0;
		}
		else {
			cout << 1 << endl;
			return 0;
		}
	}
	LL ac = (A-1) / C, ad = (A-1) / D, bc = B / C, bd = B / D, a = (A-1) / (C * D / GCD), b = B / (C * D / GCD);

	cout << (B - A + 1) - (bc + bd - b) + (ac + ad - a) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>

using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=4e5+10,oo=0x3f3f3f3f,MOD=1e9+7;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int a,b;
    cin>>a>>b;
    cout<<6-a-b<<endl;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3652
package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var stdin = bufio.NewScanner(os.Stdin)

func Input_int() int {
        stdin.Scan()
        out,err := strconv.Atoi(stdin.Text())
        if err != nil{
                panic(err)
        }
        return out
}

func main(){
	stdin.Split(bufio.ScanWords)
	N,M := Input_int(),Input_int()
	count := 0
	sum := 0
	B := make([]int,M)
	C := Input_int()
	for i:=0;i<M;i++ {
		B[i] = Input_int()
	}

	for n_iter:=0;n_iter<N;n_iter++{
		sum = C
		for m_iter:=0;m_iter<M;m_iter++{
			sum += Input_int()*B[m_iter]
		}
		if sum > 0{
			count++
		}
	}

	fmt.Println(count)
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9) + 7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int main() {
	int n; cin >> n;
	int a[51];
	rep(i, n) {
		cin >> a[i];
	}
	a[n] = 0;
	n++;
	Rep(t,1, 14) {
		bool f = true;
		vector<int> G[50];
		rep(i, n) {
			Rep(j, i + 1, n) {
				int x = a[i]; int y = a[j];
				if (x > y)swap(x, y);
				if (y - x < t) {
					if (min(y + x, 24 - (y + x)) >= t) {
						G[i].push_back(j); G[j].push_back(i);
					}
					else {
						f = false;
					}
				}
			}
		}
		if (!f) {
			cout << t - 1 << endl; break;
		}
		int used[50] = {};
		rep(i, n) {
			if (used[i])continue;
			queue<int> q; q.push(i);
			used[i] = 1;
			while (!q.empty()) {
				int ne = q.front(); q.pop();
				int len = G[ne].size();
				rep(j, len) {
					int v = G[ne][j];
					if (used[v]) {
						if (used[v] == used[ne])f = false;
					}
					else {
						used[v] = -used[ne]; q.push(v);
					}
				}
			}
		}
		if (!f) {
			cout << t - 1 << endl; break;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int k, c;
    while (true) {
        cin >> k;
        if (k == 0) {
            break;
        }
        int stop = k*(k-1)/2;
        int total = 0;
        for (int i=0; i<stop; i++) {
            cin >> c;
            total += c;
        }
        cout << total/(k-1) << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define pf push_front
#define F first
#define S second
#define ll long long
#define f(i) return cout<<i<<"\n",0;
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define lp(i,a,b) for (int i=(a);i<=(int)(b);++i)
#define lp2(i,a,b) for (int i=(a);i>=(b);--i)
#define clr(c,x) memset(c,x,sizeof(c))
#define allr(v) v.rbegin(),v.rend()
#define all(v) v.begin(),v.end()
const int N=2e5+5,mod=(int)1e9+7;
bool col[N];
vii g[N];
inline void dfs(int node,int par,bool odd)
{
    col[node]=col[par];
    if (odd) col[node]=col[par]^1;
    for (auto u:g[node])
        if (u.F!=par)
            dfs(u.F,node,u.S&1);
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n;
    cin>>n;
    lp(i,1,n-1)
    {
        int x,y,z;
        cin>>x>>y>>z;
        g[x].pb({y,z});
        g[y].pb({x,z});
    }
    dfs(1,1,0);
    lp(i,1,n) cout<<col[i]<<"\n";
    return 0;
}

Measured memory_bytes: 9600
#include<stdio.h>
int A[100000];
int pariton(int*,int,int);
int main(){
  int n,r,x;
  int i,j;
  scanf("%d",&n);  
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  x = A[n-1];
  r=partition(A,0,n-1);
  printf("%d",A[0]);
  for(i=1;i<n;i++){
    if(i == r) printf(" [%d]",A[i]);
    else printf(" %d",A[i]);
  }
  printf("\n");
  return 0;
}
  
int partition(int *A,int p,int r){
  int x,n;
  int i,j;
  int tmp1,tmp2;
  n=r;
  x = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i=i+1;
      tmp1=A[i];
      A[i]=A[j];
      A[j]=tmp1;
    }
  }
  tmp2=A[i+1];
  A[i+1]=A[r];
  A[r]=tmp2;
  return i+1;
}

Measured memory_bytes: 992
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M; cin >> N >> M;
  int ans = 0;
  for(int i = 1; i * i <= M; i++){
    if(M % i == 0){
      if(M / i <= M / N){
        ans = max(ans, M / i);
      }else if(i <= M / N){
        ans = max(ans, i);
      }
    }
  }
  cout << ans << endl;
}

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

// ===============================================================================

int main() {
  int a, b;
  cin >> a >> b;
  if (a > b) {
    cout << "a > b" << endl;
  } else if (a < b) {
    cout << "a < b" << endl;
  } else {
    cout << "a == b" << endl;
  }
}



Measured memory_bytes: 3108
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

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

    vector<ll> as(N);
    for (int i = 0; i < N; i++) {
        cin >> as[i];
    }
    sort(as.begin(), as.end());

    ll acc = 1;
    bool ok = true;
    for (auto a : as) {
        if (__builtin_mul_overflow(acc, a, &acc)) {
            ok = false;
            break;
        }
        if (acc > 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL) {
            ok = false;
            break;
        }
    }

    if (ok) {
        cout << acc << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;
}


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

int main() {
	int a[100];
	int n;
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	// your code goes here
	for (int i = n-1; i >=1; --i)
	{
		cout << a[i] <<" ";
		/* code */
	}
	cout<<a[0]<<endl;

	return 0;
}

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

using namespace std;

int main() {
    int n;
    long long int a,sum=0;
    cin >> n;
    priority_queue<long long int> pq;
    for(int i=0; i<3*n; i++){
        cin >> a;
        pq.push(a);
    }

    for(int i=0; i<n; i++){
        pq.pop();
        sum += pq.top();
        pq.pop();
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 6000
a,b,c,d=map(int,input().split())
cnt=0
while True:
  cnt+=1
  if cnt%2==0:
    s=a-(cnt/2)*d
    if s<=0:
      print('No')
      break
      
  else:
    s=c-(cnt+1)/2*b
    if s<=0:
      print('Yes')
      break

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

namespace ConsoleApp15
{
    class MainClass
    {
        static void Main()
        {
            var x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            for (int i = 0; i < 5; i++)
            {
                if (x[i] == 0) {
                    Console.WriteLine(i + 1);
                    return;
                }
            }
        }
    }
}


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

int N, M;
vector<string> A, B;

bool solve(int y, int x) {
    rep(i, M) {
        rep(j, B[0].size()) {
            if (y+i >= N || x+j >= A[0].size()) return false;
            if (A[y+i][x+j] != B[i][j]) return false;
        }
    }
    return true;
}

int main() {
    cin >> N >> M;
    rep(i,N) {
        string t; cin >> t;
        A.push_back(t);
    }
    rep(i,M) {
        string t; cin >> t;
        B.push_back(t);
    }

    rep(i, N) {
        rep(j,A[0].size()) {
            if (solve(i, j)) { puts("Yes"); return 0; }
        }
    }

    puts("No");
}


Measured memory_bytes: 256
#include <stdio.h>
#define FREE -1
#define NOT_FREE 1
#define N 8
int row[N],col[N],dpos[2*N-1],dneg[2*N-1];
int X[N][N];

void initialize(){
    int i;
    for(i=0;i<N;i++){
        row[i]=FREE;
        col[i]=FREE;
    }
    for(i=0;i<2*N-1;i++){
        dpos[i]=FREE;
        dneg[i]=FREE;
    }
}

void printBord(){
    int i,j;
    for(i=0;i<N;i++){
        for(j=0;j<N;j++){
            if(X[i][j]==1){
                if(row[i]!=j){
                    return;
                }
            }
        }
    }
    for(i=0;i<N;i++){
        for(j=0;j<N;j++){
            if(row[i]==j)printf("Q");
            else printf(".");
        }
        printf("\n");
    }
}

void recursive(int i){
    int j;
    if(i==N){
        printBord();
        return;
    }
    for(j=0;j<N;j++){
        if(col[j]==NOT_FREE || dpos[i+j]==NOT_FREE || dneg[i-j+N-1]==NOT_FREE)continue;
        row[i]= j;
        col[j]= dpos[i+j]= dneg[i-j+N-1]= NOT_FREE;
        recursive(i+1);
        row[i]= col[j]= dpos[i+j]= dneg[i-j+N-1]= FREE;
    }
}

int main(){
    int i,j;
    initialize();
    for(i=0;i<N;i++){
        for(j=0;j<N;j++){
            X[i][j]=-1;
        }
    }
    int k;
    scanf("%d",&k);
    for(i=0;i<k;i++){
        int r,c;
        scanf("%d%d",&r,&c);
        X[r][c]=1;
    }
    recursive(0);
    return 0;
}


Measured memory_bytes: 2108
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0316
{
    class Program
    {
        static void Main(string[] args)
        {
            int hiroshi = 0;
            int kenjiro = 0;
            int[] jsD = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int hi = jsD[0], hy = jsD[1];
            int[] ui = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ki = ui[0], ky = ui[1];
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            hiroshi = hi * a[0] + hy * a[1] + (hi / 10) * a[2] + (hy / 20) * a[3];
         kenjiro = ki * a[0] + ky * a[1] + (ki / 10) * a[2] + (ky / 20) * a[3];
            if (hiroshi > kenjiro) { Console.WriteLine("hiroshi"); }
            else if (hiroshi == kenjiro) { Console.WriteLine("even"); }
            else { Console.WriteLine("kenjiro"); }
            Console.ReadLine();
        }
    }
}

Measured memory_bytes: 9408
X, Y , A, B, C = map(int, input().split())
RED = list(map(int, input().split()))
GREEN = list(map(int, input().split()))
TRANSPARENT = list(map(int, input().split()))

RED = sorted(RED, reverse=True)
GREEN = sorted(GREEN, reverse=True)
TRANSPARENT = sorted(TRANSPARENT, reverse=True)

New = RED[0:X]+GREEN[0:Y]+TRANSPARENT[0:X+Y]

New = sorted(New, reverse=True)

print(sum(New[0:X+Y]))

Measured memory_bytes: 23328
import collections

h,w,m = map(int,input().split())
X = []
Y = []
for _ in range(m):
    x,y = map(int,input().split())
    X.append(x)
    Y.append(y)

most_common_x = collections.Counter(X).most_common()
most_common_x_index = most_common_x[0][0]
most_common_x_count = most_common_x[0][1]
most_common_y = collections.Counter(Y).most_common()
most_common_y_index = most_common_y[0][0]
most_common_y_count = most_common_y[0][1]

otherwisey = []
otherwisex = []
for i in range(m):
    if X[i] != most_common_x_index:
        otherwisey.append(Y[i])
    if Y[i] != most_common_y_index:
        otherwisex.append(X[i])

most_common_y = collections.Counter(otherwisey).most_common()
if len(most_common_y)!= 0:
    ansx = most_common_y[0][1] + most_common_x_count
else:
    ansx = most_common_x_count

most_common_x = collections.Counter(otherwisex).most_common()
if len(most_common_x)!= 0 :
    ansy = most_common_x[0][1] + most_common_y_count
else:
    ansy = most_common_y_count

print(max(ansx,ansy))

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

#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main(){
  int n,a,b;
  cin>>n>>a>>b;
  cout<<min(b,a*n)<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>

#define FOR(i, a, b) for(decltype(b) i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

using namespace std;

int main()
{
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	
	int r = 0;
	sort(a.begin(), a.end());
	REP(i, 2)
	{
		r += (a[2] - a[i]) / 2;
		a[i] += (a[2] - a[i]) / 2 * 2;
	}
	sort(a.begin(), a.end());
	if (a[0] != a[2])
	{
		if (a[1] == a[2])
			r += 2;
		else
			r += 1;
	}

	cout << r << endl;

	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> height(N);
  for(int i = 0; i < N; i++) {
    cin >> height.at(i);
  }
  int ans = 0;
  int keep = 0;
  for(int i = 0; i < N - 1; i++) {
    if(height.at(i) >= height.at(i + 1)) {
      keep++;
    }
    else {
      if(keep > ans) {
        ans = keep;
      }
      keep = 0;
    }
  }
  if(keep > ans) {
    ans = keep;
  }
  cout << ans << endl;
}

Measured memory_bytes: 640