akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

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

int main(){
	int n,m;
	cin>>n>>m;
	priority_queue<int> a;
	int b;
	rep(i, n){
		cin>>b;
		a.push(b);
	}
    int d;
	rep(i, m){
        d = a.top();
        d = d / 2;
		a.pop();
        a.push(d);
	}
	int long long  c = 0;
	rep(i, n){
		c += a.top();
        a.pop();
	}
	cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 892
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD2 1000000007
#define MOD 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

vector<int> divisors;

    int n;
    string str;

Int solve(int x){
    Int res = 0;
    for(int i = 0;i < x;i++){
        res *= 2;
        if(str[i] == '1')res++;
        res %= MOD;
    }
    bool exactly = true;
    for(int i = 0;i < n;i++){
        char c = str[i % x];
        if((i / x) % 2 == 1)c = '1' + '0' - c;
        if(str[i] == c)continue;
        if(str[i] < c)exactly = false;
        break;
    }
    if(exactly)res++;
    return res;
}

Int cnt[220000];
Int ans;
int main(){
    cin >> n;
    cin >> str;
    for(int i = 1;i <= n;i++){
        if(n % i != 0)continue;
        if((n / i) % 2 == 0)continue;               
        cnt[i] = solve(i);
        for(auto div: divisors){
            if(i % div != 0)continue;
            cnt[i] -= cnt[div];
            cnt[i] %= MOD;
        }
        ans += cnt[i] * i*2 % MOD;
        ans %= MOD;
        divisors.push_back(i);
    }
    if(ans < 0)ans += MOD;
    cout << ans << endl;
    return 0;
}

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

bool judge(string temp){
	string front,end;
	int length = temp.length();

	// 奇数の場合(ほんとは長さ１の時は成り立たないけど、今回はないからいいか。)
	if(length % 2 == 1){
		for(int i=0;i<(length-1)/2;i++){
			front += temp[i];
		}
		for(int i=length-1;i>(length+1)/2-1;i--){
			end += temp[i];
		}

		if(front == end){
			return true;
		}else{
			return false;
		}
	}else{//偶数の場合
		for(int i=0;i<length/2;i++){
			front += temp[i];
		}
		for(int i=length-1;i>length/2-1;i--){
			end += temp[i];
		}

		if(front == end){
			return true;
		}else{
			return false;
		}
	}


}

int main(){
	string S;
	cin >> S;
	if(judge(S)){
		string front;
		for(int i=0;i<(S.length()-1)/2;i++){
			front += S[i];
		}
		if(judge(front)){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}else{
		cout << "No" << endl;
	}

	return 0;
}



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

using lli = long long int;

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)

constexpr int INF = 1e9 + 1;

std::vector<int> A;

int find_mn_and_mx(int n){
    int mn = INF, mx = -1;
    REP(i, n){
        if(A[i] < mn) mn = A[i];
        else if(A[i] > mx) mx = A[i];
        if(mx - mn > 1) return -1;
    }
    return mn;
}

int main(void){
    /* 入力 */
    int n; scanf("%d", &n);
    A.resize(n); REP(i, n) scanf("%d", &A[i]);
    /* 考察 :
        全員異なる色 => 全員が n-1と主張する
        1組だけが同じ色 => (n-2)人は n-2 と主張, 2人は n-1 と主張
        a組だけが同じ色 => (n-2a)人は n-1-a と主張 2a人は n-a と主張
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ① : 同じ帽子を被っている ~~~> 同じ人数に見える
        ② : 主張する人数の差は高々 1 である!!!!
        X の主張が n-k のとき => Xをのぞいて 色被りをしているのは (k-1) + 1 人考えられる

     */
    int mn = find_mn_and_mx(n);
    if(mn == -1) puts("No");
    else{
        int L = 0, U = 0;
        REP(i, n){
            if(A[i] == mn) L++;
            else U++;
        }
        if(U == 0){
            /* 全員異なる */
            if(mn == n-1) puts("Yes");
            /*　全員他の誰かと同じ色 : ペアは最大 n/2個 */
            else if(2 * mn <= n) puts("Yes");
            else puts("No");
        }
        else{
            /* L人は互いに異なる色の帽子を装着している 
               U人は他の誰かと同じ色の帽子を装着している
               つまり, 追加で (mn + 1) - L ペアを U 人で作れれば良い : 上記考察と同様
            */
           int pair_number = (mn + 1) - L;
           if(pair_number > 0 and pair_number * 2 <= U) puts("Yes");
           else puts("No");
        }
    }
    return 0;
}

Measured memory_bytes: 640
M,D=map(int,input().split())

if M<4 or D<22:
	print(0)
else:
	cnt=0
	for i in range(4,M+1):
		for j in range(22,D+1):
			s=j//10
			t=j%10
			if s>=2 and t>=2:
				if s*t==i:cnt+=1
	print(cnt)

Measured memory_bytes: 3060
#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 a, b;
    cin >> a >> b;
    float price8 = ceil(a*12.5);
    float price10 = b*10;
    int ans = -1;
    if (price8 >= price10) {
        rep(i,10) {
            if (price10+i == price8) {
                ans = price8;
                break;
            }
        }
    } else if (price8 < price10) {
        int maxIndex = 12;
        if (a%2 == 1) maxIndex = 11;
        for (int i = 1; i <= maxIndex; ++i) {
            if (price8+i == price10) {
                ans = price10;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    string alp = "abcdefghijklmnopqrstuvwxyz";
    ll n;
    cin >> n;
    string ans = "";
    while(n > 0) {
        n--;
        ans += alp[n % 26];
        n /= 26;
    }
    reverse(all(ans));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3652
/*
Created by Rishu Sahu @ covid 20-20
*/
/*
*****************************************************************
*/

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

#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define pai pair<int,int>
#define pal pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,a,b) for(int i=a;i<=b;i++)
#define ff first 
#define ss second
#define sz(x) (int)x.size()
#define vi vector<int>
#define vl vector<ll>
#define mpl map<ll,ll>
#define mpi map<int,int>
#define pb push_back
#define all(x) x.begin(),x.end()

const int mod = 1e9+7;
const int INF = INT_MAX;
const int mxm = 1e6+6;


void solve(){
   ll d,t,s;
   cin>>d>>t>>s;
   ll dis=t*s;
   if(d>dis) cout<<"No";
   else cout<<"Yes";
}


int main(){
    int t=1;
    // cin>>t;
    while(t--){
        // mp.clear();
        solve();
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define space " "
#define MOD (long long) 1000000007
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename T> void __f(const char* variable_name, T&& value){cout << variable_name << ": " << value << endl;}
template <typename T1, typename... T2> void __f(const char* names, T1&& arg1, T2&&... args){const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << ": " << arg1 << " |";__f(comma + 1, args...);}

const ll N = 5000;
ll pref[3][N];
string s;
ll n;

int code_k(int i, int j){
    if(i == 0 && j == 1)
        return 2;
    if(i == 0 && j == 2)
        return 1;
    if(i == 1 && j == 0)
        return 2;
    if(i == 1 && j == 2)
        return 0;
    if(i == 2 && j == 1)
        return 0;
    if(i == 2 && j == 0)
        return 1;
}

int code(char ch){
    if(ch == 'R')
        return 0;
    if(ch == 'G')
        return 1;
    return 2;
}

ll cnt(ll i, ll j, ll c){
    // trace(i, j);
    j = min(n - 1, j);
    if(i > j)
        return 0;
    return pref[c][j] - pref[c][i] + (code(s[i]) == c ? 1 : 0);
}

void solve(){
    cin >> n;
    cin >> s;
    pref[0][0] = s[0] == 'R' ? 1 : 0;
    pref[1][0] = s[0] == 'G' ? 1 : 0;
    pref[2][0] = s[0] == 'B' ? 1 : 0;
    for(int i = 1; i < n; i++){
        pref[0][i] = pref[0][i-1] + (s[i] == 'R' ? 1 : 0);
        pref[1][i] = pref[1][i-1] + (s[i] == 'G' ? 1 : 0);
        pref[2][i] = pref[2][i-1] + (s[i] == 'B' ? 1 : 0);
    }
    // for(int i = 0; i < n; i++){
    //     cout << pref[0][i] << space;
    // }
    // cout << endl;
    // for(int i = 0; i < n; i++){
    //     cout << pref[1][i] << space;
    // }
    // cout << endl;
    // for(int i = 0; i < n; i++){
    //     cout << pref[2][i] << space;
    // }
    // cout << endl;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            if(s[i] != s[j]){
                int i_c = code(s[i]);
                int j_c = code(s[j]);
                int k = code_k(i_c, j_c);
                // trace(i, j, i_c, j_c, k);
                int a = cnt(j + 1, j + (j - i - 1), k);
                int b = cnt(j + (j - i + 1), n - 1, k);
                // trace(a, b);
                ans += a + b;
            }
        }
    }
    cout << ans;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    ll t = 1;
    // cout << "\n\nBLAH BLAH BLAH\n\n";
    // cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3640
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2020 Bjarni Dagur Thor Karason

#include <bits/stdc++.h>

using namespace std;

#define rep(i,a,b) for (__typeof(a) i=(a); i<(b); i++)
#define MP make_pair
#define PB push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000
#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    vector<double> ans(n + 1);
    ans[0] = 1;
    for (int i = 0; i < n; i++) {
        double phead;
        cin >> phead;
        for (int j = i + 1; j >= 0; j--) {
            if (j == 0) {
                ans[j] = ans[j] * (1 - phead);
            }
            else {
                ans[j] = ans[j] * (1 - phead) + ans[j - 1] * phead;
            }
        }
    }
    double ansOut = 0;
    for (int i = 0; i <= n; i++) {
        if (i > n - i) ansOut += ans[i];
    }
    cout << fixed << setprecision(10) << ansOut << 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)

/* short names and const
using ll = long long;
using vll = vector<long long>;
using df = vector<vector<long long>>;
df data(n, vector<long long>(m));
const int MOD = 1e9 + 7;
const long long INF = 1e18;
*/

/* Boost!
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
using boost::algorithm::split; // split(result, s, boost::is_any_of(","));
#include <boost/algorithm/string/join.hpp>
using boost::algorithm::join; // string s = join(arr, "");
#include <boost/algorithm/string/replace.hpp>
using boost::algorithm::replace_all; // replace_all(s, "AtCoder", "A");
#include <boost/range/algorithm.hpp> // boost::sort(arr)
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;
*/

/* print(arr)
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
    cout << a;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
}
*/

/* fast cin and precise cout
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  getline(cin, s);
  cout << fixed << setprecision(15);
*/

/* sum function
int sum(vector<int> &arr) {
  int res = accumulate(arr.begin(), arr.end(), 0);
  return res;
}
*/

int cnt_nine(int rest) {
  int res = 0;
  while (rest > 0) {
    res += rest % 9;
    rest /= 9;
  }
  return res;
}

void cnt_six(int rest, int six, int cnt, int &min_cnt) {
  for (int i = 0; i < 6; ++i) {
    if (rest >= i * six) {
      int cnt6 = cnt + i;
      int cnt9 = cnt_nine(rest - i * six);
      min_cnt = min(min_cnt, cnt6 + cnt9);
      if ((rest - i * six) >= six * 6) {
        cnt_six(rest - i * six, six * 6, cnt6, min_cnt);
      }
    }
  }
}

int main() {
  int n;
  cin >> n;
  int min_cnt = 100000;
  cnt_six(n, 6, 0, min_cnt);
  cout << min_cnt << endl;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
a=list(map(int,input().split()))

total=0
a.sort(reverse=True)
for i in range(n):
    total+=a[i]


ans=1
for i in range(m):
    if a[i]<1/4/m*total:
        ans=0
        break
if ans==1:
    print("Yes")
else:
    print("No")


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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

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

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

    string S;
    cin >> S;

    list<char> lst;
    for (int i = 0; i < (int)S.size(); i++) {
        lst.push_back(S[i]);
    }

    int Q;
    cin >> Q;

    bool is_rev = false;
    while (Q--) {
        int q;
        cin >> q;
        if (q == 1) {
            is_rev ^= true;
        }
        else {
            int f;
            char c;
            cin >> f >> c;

            if (f == 1) {
                if (is_rev) {
                    lst.push_back(c);
                }
                else {
                    lst.push_front(c);
                }
            }
            else {
                if (is_rev) {
                    lst.push_front(c);
                }
                else {
                    lst.push_back(c);
                }
            }
        }
    }

    string ans;
    ans.insert(ans.begin(), lst.begin(), lst.end());
    if (is_rev) {
        reverse(ans.begin(), ans.end());
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 10320
#include <cstdio>
#include <algorithm>

long long calc(long long h)
{
	if(h==1) return 1;
	return 1+calc(h>>1)*2;
}


int main()
{
long long h;
	scanf("%lld", &h);
	printf("%lld\n", calc(h));
	return 0;
}

Measured memory_bytes: 128
n = int(input())
csf = []
for _ in range(n-1):
    c, s, f = map(int, input().split())
    csf.append((c, s, f))
ans = [0]*n
for i, (c, s, f) in enumerate(csf):
    for j in range(0, i+1):
        if ans[j] <= s:
            ans[j] = c+s
        else:
            ans[j] = (ans[j]+f-1)//f*f+c
for i in ans:
    print(i)

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()

using namespace std;
using ll = long long;

constexpr int MOD = 1000000007;

class mint {
  int n;
public:
  mint(int n_ = 0) : n(n_) {}
  explicit operator int() { return n; }
  friend mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
  friend mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
  friend mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
  friend mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
  friend mint &operator+=(mint &a, mint b) { return a = a + b; }
  friend mint &operator-=(mint &a, mint b) { return a = a - b; }
  friend mint &operator*=(mint &a, mint b) { return a = a * b; }
  friend bool operator==(mint a, mint b) { return a.n == b.n; }
  friend bool operator!=(mint a, mint b) { return a.n != b.n; }
  friend istream &operator>>(istream &i, mint &a) { return i >> a.n; }
  friend ostream &operator<<(ostream &o, mint a) { return o << a.n; }
};

mint modpow(mint a, long long b) {
  mint res = 1;
  while (b > 0) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}


mint modinv(mint n) {
  int a = (int)n, b = MOD;
  int s = 1, t = 0;
  while (b != 0) {
    int q = a / b;
    a -= q * b;
    s -= q * t;
    swap(a, b);
    swap(s, t);
  }
  return s >= 0 ? s : s + MOD;
}


int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N; cin >> N;
  vector<vector<int>> G(N);
  rep(i, N - 1) {
    int a, b; cin >> a >> b; a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<int> size(N);
  mint ans = 0;
  auto dfs = [&](auto dfs, int u, int p) -> void {
    size[u] = 1;
    mint q = modinv(2);
    q -= modinv(modpow(2, N));
    for (int v : G[u]) if (v != p) {
      dfs(dfs, v, u);
      size[u] += size[v];
      q -= (modpow(2, size[v]) - 1) * modinv(modpow(2, N));
    }
    q -= (modpow(2, N - size[u]) - 1) * modinv(modpow(2, N));
    ans += q;
  };
  dfs(dfs, 0, -1);
  cout << ans << endl;
}


Measured memory_bytes: 26496
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<n;i++)
#define rf(i,n) for(int i=n-1;i>=0;i--)
#define rep(a,b,c) for(int i=a;i<b;i++)
#define repn(a,b,c) for(int i=a;i<=b;i++)
#define PI 3.1415926535897932384626433832795
#define fi first
#define se second
#define mp(x,y) make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define BIN(n,x) bitset<n>(x)  
#define mod (ll)1000000007
using namespace std;
typedef vector<ll> vl;
typedef vector<int> vi;

//nC2
ll C2(ll n){
    ll ans= max(((n*(n-1))/2),(ll)0);
    return ans;
}

//GCD
ll gcd(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    if(a%b==0){
        return b;
    }
    else{
        return gcd(b,a%b);
    }
}
//sort pair by second values
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second < b.second); 
}


ll BinExp(ll a, ll b, ll m){
    a%=m;
    ll res =1;
    while(b>0){
        if(b&1){
            res = (res * a)%m;
        }
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}


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

    ll x;
    cin>>x;
    if(x==101){
        cout<<1<<endl;
    }
    else{
        ll dp[100001]={0};
        dp[0]=100;
        f1(i,100000){
            dp[i]=dp[i-1]+(ll)(dp[i-1]/100);
            if(dp[i]>=x){
                cout<<i<<endl;
                break;
            }
        }
    }
    


    return 0;
}



Measured memory_bytes: 4432
#include<bits/stdc++.h>
#define eoi ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
int main()
{
    eoi;
    vector<string>v;
    string m;
    int a,b;
    cin>>a>>b;
    while(a--){
        cin>>m;
        v.push_back(m);
    }
    sort(v.begin(),v.end());
    for(int z=0;z<v.size();z++){
        cout<<v[z];
    }

    return 0;
}







Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
    int N; cin >> N;
    if(N%10 == 2 || N%10 == 4 || N%10 == 5 || N%10 == 7 || N%10 == 9 ){
        cout << "hon" << endl;
    }else if(N%10 == 0 || N%10 == 1 || N%10 == 6 || N%10 == 8 ){
        cout << "pon" << endl;
    }else{
        cout << "bon" << endl;
    };

}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
using namespace std;

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P; //ペア　タイプでふ
int main()
{
    array<char, 3> ar;
    REP(i, 3)
    {
        cin >> ar[i];
    }
    int a = 0;
    REP(i, 3)
    {
        if (ar[i] == '1')
            a++;
    }
    cout << a;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++)
    cin >> a[i];
  sort(a.rbegin(), a.rend());
  int A = 0;
  int B = 0;
  for(int i = 0; i < n; i++){
    if(i%2 == 0) A += a[i];
    else B += a[i];
  }
  cout << A - B << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <iomanip>
#include <deque>
#include <queue>
#include <unordered_map>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <sstream>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
ll pow(ll N, ll P){
    if(P==0) return 1;
    if(P%2==0){
        ll t = pow(N, P/2);
        return t*t;
    }
    return N * pow(N, P-1);
}
ll modpow(ll N, ll P,ll k){
    if(P==0) return 1;
    if(P%2==0){
        ll t = modpow(N, P/2,k)%k;
        return t*t%k;
    }
    return N * modpow(N, P-1,k)%k;
}
ll modkai(ll n,ll m,ll k){//n*(n-1)*(n-2)*...(m+1)%k
    if(n == m)return 1;
    return modkai(n-1,m,k)*n%k;
}
ll mod_cnb(ll n,ll m,ll k){//nCm%k,kは十分大きい素数
  int m_=modkai(m,0,k);
  return modkai(n,n-m,k)*modpow(m_,k-2,k)%k;
}
ll gcd(ll n,ll m){
    ll n_ = max(n,m);
    ll m_ = min(n,m);
    if(n_%m_ == 0)return m_;
    return gcd(m_,n_%m_);
}
ll lcm(ll n,ll m){
    return n*m/gcd(n,m);
}

int main() {
   int a,b;cin>>a>>b;
   if(a%2==1&&b%2==1)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;

}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

  int r, d, x;
  cin >> r >> d >> x;
  for (int i = 0; i < 10; i++) {
    int y = r * x - d;
    cout << y << endl;
    x = y;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <cstdint>

using namespace std;

template<class T>
T read()
{
    T value;
    std::cin >> value;
    return value;
}
 
template<class F>
void times_do(size_t n, F func)
{
    for(size_t i = 0; i < n; ++i) func();
}
 
template<class T>
vector<T> reads(size_t n)
{
    vector<T> a;
    a.reserve(n);
    times_do(n, [&](){
        a.push_back(read<T>());
    });
    return a;
}

int main()
{
    const auto n = read<int>();

    unordered_map<int,int> counts;
    
    for(int i = 0; i < n; ++i)
    {
        int ai;
        cin >> ai;
        counts[ai]++;
    }
    
    int to_remove = 0;
    
    for(auto p : counts)
    {
        if(p.first == p.second)
            continue;
        else if(p.first < p.second)
            to_remove += (p.second - p.first);
        else
            to_remove += p.second;
    }
    
    cout << to_remove << endl;

    return 0;
}


Measured memory_bytes: 4260
#include <bits/stdc++.h>
using  namespace  std;
using ll=long long;
int main(){
  int a,b;
  cin>>a>>b;
  int count=0;
  for(int i=0;i<=b-a;i++){
    int l=(a+i)/1000;
    int s=(a+i)%100;
    if(l/10==s%10&&l%10==s/10)count++;
  }
    cout<<count<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define REEP(i, N) for(ll i = N - 1; i >= 0; --i)
#define FOR(i,m,n) for(ll i = m; i < n; ++i)
#define RFOR(i,m,n) for(ll i = n - 1; i >= m; --i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define PB push_back
#define KIRIAGE(a, b) a += (b - a % b) % b // a を b の倍数値まで増やす
#define CEIL(c, a, b) if(a % b == 0) { c = a / b;} else { c = a / b + 1;} // a / b 以上の最小整数
#define sp(n) setprecision(n)
#define INF 1000000000
#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(void) {
	int A,B;
	cin>>A>>B;
	cout<<(A + B) % 24<<endl;
}



Measured memory_bytes: 256
def parent(i)
  ( i / 2 ).ceil
end

def right(i)
  2 * i + 1
end

def left(i)
  2 * i
end

def max_heapify(arr, i)
  l = left(i)
  r = right(i)
  h = arr.size - 1

  # puts "i : #{i}, l : #{l}, r : #{r}, h : #{h} arr[r] : #{arr[r]}, arr : #{arr}"

  largest = nil
  if l <= h && arr[l] > arr[i]
    largest = l
  else
    largest = i
  end
  if r <= h && arr[r] > arr[largest]
    largest = r
  end

  if largest != i
    arr[i], arr[largest] = arr[largest], arr[i]
    max_heapify(arr, largest)
  end
end

n = gets.to_i
arr = gets.split.map(&:to_i)
arr.unshift(nil)
(n/2).downto(1) do |i|
  max_heapify(arr, i)
end
arr.shift
arr.each { |v| print " #{v}"}
puts ""


Measured memory_bytes: 46000
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 k = sc.nextInt();

        int ans = 0;
        int numa = 0;
        int numb = 0;
        for(int i=0; i<k; i++) {
            if(i < a) {
                ans += 1;
            } else {
                break;
            }
            numa++;
        }
        if(numa == k) printAns(ans);

        for(int j=0; j<k-numa; j++) {
            if(j < b) {
                ;
            } else {
                break;
            }
            numb++;
        }
        if(numa+numb == k) printAns(ans);

        for(int l=0; l<k-(numa+numb); l++) {
            if(l < c) {
                ans += -1;
            }
        }
        printAns(ans);
    }

    public static void printAns(int ans) {
        System.out.println(ans);
        System.exit(0);
    }
}


Measured memory_bytes: 35856
def main():
	s = input()
	stack = []
	total = 0
	for c in (s):
		if not stack:
			stack.append(c)
			continue
		if stack[-1] != c:
			stack.pop()
			total += 2
		else:
			stack.append(c)

	print(total)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3956
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<algorithm> // sort
#include<map> // pair
#include<cmath>
#include<cstring>
#include<set>
using namespace std;
using ll = long long;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
const ll mod = 1e9+7;
const int INF = 1e9;
const ll INFLONG = 1e18;
int main(){
  ll n,k;
  cin >> n >> k;
  ll h[n];
  rep(i,n){
    cin >> h[i];
  }
  sort(h,h+n);
  ll minimum = INFLONG;
  rep(i,n-k+1){
    chmin(minimum,h[i+k-1]-h[i]);
  }
  cout << minimum;
}


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

int main()
{
    int n;
    cin >> n;
    vector<int> v(n+1);
    bool aru = false;
    for (int i=1;i <= n;i++)
    {
        cin >> v[i];
        if (v[i] == 2)
        {
            aru = true;
        }
    }
    if (!aru)
    {
        cout << -1 << endl;
    }
    else
    {
        int a = 1;
        int count = 0;
        while (true)
        {
            a = v[a];
            count++;
            if (a == 2)
            {
                cout << count << endl;
                break;
            }
            else if (count > n)
            {
                cout << -1 << endl;
                break;
            }
        }
    }
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>
#include <string>
#include <tuple>

template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

// [l, r) from l to r
struct range {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr range(int l_, int r_): l(std::min<int>(l_, r_)), r(r_) {}
  constexpr itr begin() const { return l; }
  constexpr itr end() const { return r; }
};

// [l, r) from r to l
struct revrange {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr r, l;
  constexpr revrange(int l_, int r_): r(std::max<int>(l_, r_) - 1), l(l_ - 1) {}
  constexpr itr begin() const { return r; }
  constexpr itr end() const { return l; }
};

template <class T>
inline T scan() {
  T res;
  std::cin >> res;
  return res;
}

int main() {
  std::string S;
  std::cin >> S;
  std::cout << std::string(S.size(), 'x') << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, 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() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, K;
    cin>>N>>K;
    vector<int> ps(N);
    rep(i, N) cin>>ps[i];

    vector<double> s(N + 1);
    vector<double> avg(1000);

    double sum = 0.0;
    rep(i, 1000) {
        sum += i + 1;
        avg[i] = sum / (i + 1);
    }
    rep(i, N) {
        s[i + 1] = s[i] + avg[ps[i] - 1];
    }

    double ans = 0.0;
    rep(i, N - K + 1) {
        chmax(ans, s[K + i] - s[i]);
    }
    printf("%.10f", ans);
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
/*
string S_str[H];
cins(S_str, S_str + H);
S_str[i][j];
*/
inline int at(ll x, int k){ return (x >> k) & 1; }
#define rep(i, n) for(ll i = 0; i < n; i++)


int main(){
  ll s;
  ll w;

  cin >> s >>w;
  if(w>=s){
    cout << "unsafe" << endl;
  }
  else{
    cout << "safe" << endl;
  }

}


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

using namespace std;

int main()
{
    int N;
    cin >> N;
    int X[N];
    for (int i = 0; i < N; i++)
    {
        cin >> X[i];
    }
    int sum_min = 100000000;
    for (int i = 1; i <= 100; i++)
    {
        int tmp = 0;
        for (int j = 0; j < N; j++)
        {
            tmp += (X[j] - i) * (X[j] - i);
        }
        sum_min = min(sum_min, tmp);
    }
    cout << sum_min << endl;
}

Measured memory_bytes: 256
//Only the Creator has given me strength!🖤
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#include<bitset>
typedef long long ll;
#define pi 3.1415926535897931159979635
#define pb push_back
#define vctr vector<int>
#define vvtr vector<vctr>
int mod=1e9+7;
using namespace std;
void fastio() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int main() {
    fastio();
    int s;
    ll g=0;
    string a;
    cin>>s>>a;
    ll r=0,gr=0,b=0,k,l;
    for(int i=0; i<s; i++) {
        if(a[i]=='R') r++;
        else if(a[i]=='G') gr++;
        else b++;
        for(int j=0; j<s; j++) {
            k=2*j+i;
            l=j+i;
            if(k>=s) break;
            if(a[i]!=a[l] && a[i]!=a[k] && a[l]!=a[k])
                g++;
        }
    }
    ll ans=r*gr*b-g;
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#define INF 210000000
using namespace std;

int a[300], b[300];
int n;
int abs(int x){
    return  x < 0 ? -x : x;
}

int dfs(int now, double radio, int last){
    int low = (int)ceil(a[now] - a[now] * radio);
    int high = (int)ceil(a[now] + a[now] * radio);
    int st;
    if (low % last == 0) st = low; else st = (low / last + 1) * last;
    for(int i = st;  i < high; i+=last){
        if (now == n - 1) return 1;
        if (dfs(now + 1, radio, i)) return 1;
    }
  return 0;
}  

int check(double x){
    return dfs(0, x, 1);
}

int main(){
    int i, j;
    double ans = 1e10;
    cin>>n;
    for(i = 0; i < n; i++)
        cin>>a[i];
    double l = 0, r = 1;
    while(r - l >= 1e-11){
        double mid = (r + l) / 2.0;
        if (check(mid)) r = mid; else l = mid;
    }
    printf("%.10f\n", l);
    return 0;
}

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

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()
#define vprint(v) for(auto e:v){cout<<e<<" ";};cout<<endl;
#define vvprint(vv) for(auto v:vv)vprint(v);

class STree{
public:
    vector<STree*> nexts = vector<STree*>(26, nullptr);
    bool end = false;

    void append(string &s, ll idx){
        if(idx<0) this->end = true;
        else{
            if(this->nexts[s[idx]-'a']){
                this->nexts[s[idx]-'a']->append(s, idx-1);
            }
            else{
                this->nexts[s[idx]-'a'] = new STree();
                this->nexts[s[idx]-'a']->append(s, idx-1);
            }
        }
    }

    ll solve_sub(string &s, vector<vector<bool>> &t, ll idx){
        if(idx<0) return 0;
        else{
            ll count = 0;
            rep(i, 26){
                if(this->nexts[i] && this->nexts[i]->end && t[idx][i]){
                    ++count;
                }
            }
            if(this->nexts[s[idx]-'a']) return count + this->nexts[s[idx]-'a']->solve_sub(s, t, idx-1);
            else return count;
        }
    }

    ll solve(string &s){
        vector<vector<bool>> t(s.length(), vector<bool>(26, false));
        rep(i, s.length()){
            if(i==0){
                t[i][s[i]-'a'] = true;
            }
            else{
                rep(j, 26) t[i][j] = t[i-1][j];
                t[i][s[i]-'a'] = true;
            }
        }
        return solve_sub(s, t, s.length()-1);
    }
};

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

    ll N;
    cin >> N;
    vector<string> S(N);
    rep(i, N) cin >> S[i];

    STree st;
    rep(i, N){
        st.append(S[i], S[i].length()-1);
    }
    ll total = 0;
    rep(i, N){
        total += st.solve(S[i]);
    }
    total -= N;
    cout << total << endl;
}


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

using namespace std;

int main()
{
	int N;
	int x[100000];
	int y[100000];
	int t[100000];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> t[i] >> x[i] >> y[i];
	}
	int nx = 0, ny = 0, nt = 0;
	for (int i = 0; i < N; i++) {
		int dx = abs(nx - x[i]);
		int dy = abs(ny - y[i]);
		int dt = abs(nt - t[i]);
		int te = dt - dx - dy;
		if (te < 0 || te % 2 == 1) {
			cout << "No" << endl;
			return 0;
		}
		nx = x[i];
		ny = y[i];
		nt = t[i];
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 1408
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

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

using namespace std;
typedef long long ll;

int main() {

    ll A,B;
    cin >> A >> B;
    ll out = A - 2*B;
    if(out<0) out = 0;
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
n, a, b = map(int, input().split())
 
 
mod = 1000000007
 
inv = [1] * 222222
 
# 0 = a * MOD/a + MOD % a
# a*MOD/a = -MOD%a
# a = -MOD%a * inv[MOD/a]
# inv[a] = -inv[MOD%a] * MOD/a
for i in range(2, 222222):
    inv[i] = -inv[mod % i] * (mod // i)
    inv[i] %= mod
    
def comb(n, a):
    res = 1
    for i in range(a):
        res *= n-i
        res *= inv[i+1]
        res %= mod
    return res
 
ans = pow(2, n, mod) - 1 - comb(n, a) - comb(n, b)
 
ans %= mod
if ans < 0:
    ans += mod
 
print(ans)

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

int main(){
	int A, B, C;
	cin >> A >> B >> C;

	int tmp = C - (A - B);
	if(tmp < 0){
		cout << 0 << endl;
	}else{
		cout << C - (A - B) << endl;
	}
}


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

int main(){
  int k,s;
  cin>>k>>s;
  int count=0;
  for(int i=0;i<=k;i++){
    for(int j=i;j<=k;j++){
      for(int l=j;l<=k;l++){
        if(i+j+l==s){
          if(i!=j && j!=l && i!=l) count += 6;
          else if(i==j && j==l) count += 1;
          else count += 3;
        }
      }
    }
  }
  cout<<count<<endl;
  return 0;
}

Measured memory_bytes: 3636
#![allow(unused)]

//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

//input
//use std::io::Read;

//collections
//use std::collections::BTreeMap;
//use std::collections::BTreeSet;
//use std::collections::HashMap;
//use std::collections::HashSet;
//use std::collections::VecDeque;

fn main() {
    input! {
        n: usize,
        t : u64,
        ts: [u64;n],
    }

    let mut ans = 0;

    for i in 0..n - 1 {
        if ts[i + 1] - ts[i] < t {
            ans += ts[i + 1] - ts[i]
        } else {
            ans += t;
        }
    }
    ans += t;
    println!("{}", ans);
}


Measured memory_bytes: 6396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int X;
    cin >> X;
    if ((X == 7) || (X == 5) || (X == 3))
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;

int ex(int n){
    int ans=1;
    for (int i = 0; i < n; i++){
        ans*=(i+1);
    }
    return ans;
}

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

    int P[N],Q[N];

    for (int i = 0; i <N; i++){
        cin >> P[i];
    }
    for (int i = 0; i <N; i++){
        cin >> Q[i];
    }

    int p=1,q=1,num=0;

    bool flag[N];

    for (int i = 0; i < N; i++){
        flag[i]=true;
    }
    

    for (int i = 0; i <N; i++){
        for (int j = 0; j <P[i]; j++){
            if(flag[j]==false){
                num++;
            }
        }
        p+=(P[i]-num-1)*ex(N-i-1);
        //cout << p << ',';
        flag[P[i]]=false;
        num=0;
    }

    for (int i = 0; i < N; i++){
        flag[i]=true;
    }


    for (int i = 0; i <N; i++){
        for (int j = 0; j <Q[i]; j++){
            if(flag[j]==false){
                num++;
            }
        }
        q+=(Q[i]-num-1)*ex(N-i-1);
        //cout << q << ',';
        flag[Q[i]]=false;
        num=0;
    }

    //cout << p << ' ' << q;

    if(p<q){
        cout << q-p;
    }
    else{
        cout << p-q;
    }

    return 0;
}


Measured memory_bytes: 256
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    p = b - 2
    c = ""
    for _ in range(b):
        c += "#"
    c += "\n"
    for _ in range(a - 2):
        c += "#"
        for __ in range(p):
            c += "."
        c += "#"
        c += "\n"
    for _ in range(b):
        c += "#"
    c += "\n"
    print(c)


Measured memory_bytes: 5628
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int a = keyboard.nextInt();
		int b = keyboard.nextInt();
		int h = keyboard.nextInt();
		
			System.out.println((a + b) * h / 2);
			
		keyboard.close();	
	}
}


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

typedef long long LL;

const int N = 1e5 + 5;
const int MOD = 1e9 + 7;

map <int, int> cnt;

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

    for(int i = 1; i <= n; i++)
    {
        int x;
        cin>>x;
        cnt[x]++;
        cnt[x-1]++;
        cnt[x+1]++;
    }

    int ans = 0;
    for(auto i: cnt)
    {
        ans = max(ans, i.second);
    }

    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 4736
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr ll INF = 1LL << 40;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// ----------------------------------------------------------------------------

int main(){
  int N;
  cin >> N;
  vector<pair<int,int>> B(N),R(N);
  for(int i=0; i<N; i++){
    int a,b;
    cin >> a >> b;
    R[i] = make_pair(b,a);
  }
  for(int i=0; i<N; i++){
    int c,d;
    cin >> c >> d;
    B[i] = make_pair(c,d);
  }
  int ans=0;
  sort(B.begin(),B.end());
  sort(R.begin(),R.end(),greater<pair<int,int>>());
  vector<bool> id(N,false);
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      if(id[j]) continue;
      if(R[j].second<B[i].first && R[j].first<B[i].second){
        ans++;
        id[j] = true;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
  string s,t,u;
  int a,b;
  cin >> s >> t;
  cin >> a>> b;
  cin >> u;
  if(s==u){
    cout << a-1 << " " << b << endl;
  }
  else{
    cout << a << " " << b-1 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

signed main() {
#ifdef LOCAL
  assert(freopen("a.in", "r", stdin));
#endif
 string s;
 cin >> s;
 if (s.size() >= 4 && s.substr(0, 4) == "YAKI") {
   cout << "Yes\n";
 } else {
   cout << "No\n";
 }
}

Measured memory_bytes: 256
#include <stdio.h>

//#define MyPrint fprintf
#define MyPrint

int get_int1(void)
{
    int input;
    char ch;

    while (scanf("%d", &input) != 1) {
        while ((ch = getchar()) != '\n')
            putchar(ch);        // dispose of bad input
        MyPrint(stderr, " is not an integer.\nPlease enter an integer value.\n");
    }

    while (getchar() != '\n')   // discard rest of line
        continue;
    return input;
}

int main(int argc, char *argv[])
{
    int val1;
    int cnt = 0;
    int d3, d2, d1;

    MyPrint(stdout, "Please input integer value.\n");

    val1 = get_int1();
    if ((val1 < 0) || (val1 > 111)) {
        MyPrint(stdout, "your input number is error.\n");
        return -1;
    }
    MyPrint(stdout, "Your input value is %d.\n", val1);

    d3 = (val1 / 100);
    if ((d3 != 0) && (d3 != 1)) {
        MyPrint(stdout, "your input number is error.\n");
        return -1;
    }
    MyPrint(stdout, "d3=%d\n", d3);

    d2 = (val1 - d3 * 100) / 10;
    if ((d2 != 0) && (d2 != 1)) {
        MyPrint(stdout, "your input number is error.\n");
        return -1;
    }
    MyPrint(stdout, "d2=%d\n", d2);

    d1 = val1 - d3 * 100 - d2 * 10;
    if ((d1 != 0) && (d1 != 1)) {
        MyPrint(stdout, "your input number is error.\n");
        return -1;
    }
    MyPrint(stdout, "d1=%d\n", d1);

    cnt += ((val1 & 0x04) >> 2);
    cnt += ((val1 & 0x02) >> 1);
    cnt += (val1 & 0x01);

    MyPrint(stdout, "Your input result : ");
    fprintf(stdout, "%d\n", cnt);

    return 0;
}


Measured memory_bytes: 128
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

Q,H,S,D = I()
N = i()
A = [[Q*8,0.25,Q],[H*4,0.5,H],[S*2,1,S],[D,2,D]]
A.sort()
ans = 0
for i in range(4):
    a,b,c = A.pop(0)
    if b <= N:
        ans += int((N//b)*c)
        N -= (N//b)*b
    if N == 0:
        print(ans)
        break

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

int main(){
  int n, h, ans, max;
  cin >> n;
  max = 0;
  ans = 0;
  for ( int i = 0; i < n; i++ ) {
    cin >> h;
    if ( h >= max ) {
      max = h;
      ans ++;
    }
  }
  
  cout << ans;
}

Measured memory_bytes: 256