akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;

uintmax_t ncr(unsigned int n, unsigned int r) {
    if ( r * 2 > n ) r = n - r;
    uintmax_t dividend = 1;
    uintmax_t divisor  = 1;
    for ( unsigned int i = 1; i <= r; ++i ) {
        dividend *= (n-i+1);
        divisor  *= i;
    }
    return dividend / divisor;
}

signed main() {
    ll n;
    cin >> n;
    
    ll ans = 0;
    
    vll cnt(5, 0);
    
    
    string s;
    rep(i, n) {
        cin >> s;
        if (s[0] == 'M') {
            cnt[0]++;
        }
        if (s[0] == 'A') {
            cnt[1]++;
        }
        if (s[0] == 'R') {
            cnt[2]++;
        }
        if (s[0] == 'C') {
            cnt[3]++;
        }
        if (s[0] == 'H') {
            cnt[4]++;
        }
    }
    
    rep(bit, 1<<5) {
        ll tmp = 1;
        if (__builtin_popcount(bit) == 3) {
            rep(i, 5) {
                if (bit & (1 << i)) {
                    tmp *= cnt[i];
                }
            }
            ans += tmp;
        }
    }

    
    mes(ans);
    
    
    
    

}
    
    
    
    
    


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
 
const int mod = 1000000007;
//const int mod = 998244353;
 
 
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
 
 
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} c(200005);
 
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数
 
        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
 
        // その結果を push
        res.push_back({a, ex});
    }
 
    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}
vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
}
 
int main(int argc, const char * argv[]) {

    ll K; cin >> K;
    if(K%2==0){
        cout << -1 << endl;
        return 0;
    }

    ll next,before=7;
    if(before%K==0){
        cout << 1 << endl;
        return 0;
    }
    
    ll cnt=1;
    for(ll i=0;i<K;i++){
        next = (before*10+7)%K;
        cnt++;
        if(next==0){
            cout << cnt << endl;
            return 0;
        }
        
        before = next;
    }
    
    cout << -1 << endl;
    return 0;
}


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

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
    int n, k;
    while(cin >> n >> k, n+k){
        vector<int> v(n);
        rep(i, n) cin >> v[i];
        int a = 0, b = 0;
        rep(i, n-k+1){
            int t = 1;
            rep(j, k)t *= v[i+j];
            a = max(a, t);
        }

        rep(i, n)rep(j, n){
            if(i == j) continue;
            swap(v[i], v[j]);
            int t = 1;
            rep(l, n-k+1){
                int t = 1;
                rep(m, k) t *= v[l+m];
                b = max(b, t);
            }
            swap(v[i], v[j]);
        }
        cout << max(0, b-a) << endl;
    }
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
#define No cout<<"No"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
    int n;
    cin>>n;
    ll a[n],ans=0;
    rep(i,n){
        cin>>a[i];
        ans+=a[i]-1;
    }    
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
/*
 * main.c
 *
 *  Created on: 2020/02/22
 *      Author: family
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a > b ? b : a)
typedef long long int ll;
typedef unsigned long long int ull;

int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b);}
int sort_dec(const void* a, const void* b) { return (*(int*)b - *(int*)a);}
int sort_dec_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = -1; }
    else if (da == db) { val = 0; }
    else { val = 1; }
    return val;
}
int sort_inc_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = 1; }
    else if (da == db) { val = 0; }
    else { val = -1; }
    return val;
}
int sort_dic(const void *a, const void *b) {
    char *pa = (char *)a;    char *pb = (char *)b;    int i = 0, val = 0, N = 10;
    for (i = 0; i < N; i++) {
    	char da = pa[i], db = pb[i];
    	if (da == db) continue;
  		if (da > db) val = 1; else val = -1;
        break;
    }
    return val;
}


int main()
{
	ll N = 0, K = 0, ans = 1;
	scanf("%lld %lld", &N, &K);

	while(1) {
		N = N/K;
		if (N != 0) {
			ans++;
		} else {
			break;
		}
	}
	printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 128
N = int(int(input()))
C_S_F = [list(map(int, input().split(" "))) for _ in range(N-1)]

for i in range(N-1):
	time = 0
	for j in range(i, N-1):
		c, s, f = C_S_F[j]
		time = max(s, time + abs(time%-f))
		time += c
	print(time)
print(0)

Measured memory_bytes: 3188
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
 
  int main(){
    int n,m;cin>>n>>m;
    if(n==m)
      cout<<"Yes";
    else
      cout<<"No";
  }

Measured memory_bytes: 256
i = gets.to_i
ps = gets.strip.split.map(&:to_i)

r = 0

while true
    ps = ps.drop_while{|j| j == 0 }
    break unless ps.any?
    j = 0
    while j < ps.length and ps[j] > 0
        ps[j] -= 1
        j += 1
    end

    r += 1
end

puts r

Measured memory_bytes: 3964
S = input()
first = int(S[:2])
last = int(S[2:])
if 1 <= first <= 12:
    if 1 <= last <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= last <= 12:
        print('YYMM')
    else:
        print('NA')

Measured memory_bytes: 2940
#include <iostream>
using namespace std;
int main(void){
    while(true){
        int m, f, r, score;
        cin >> m >> f >> r;
        if(m == -1 and f == -1 and r == -1) break;
        score = m + f;
        
        if(m == -1 or f == -1){
            std::cout << 'F' << std::endl;
            continue;
        }
        
        if(score >= 80){
            std::cout << 'A' << std::endl;
            
        }else if(score >= 65){
            std::cout << 'B' << std::endl;
            
        }else if(score >= 50){
            std::cout << 'C' << std::endl;
            
        }else if(score >= 30){
            if(r >= 50){
                std::cout << 'C' << std::endl;
                
            }else{
                std::cout << 'D' << std::endl;
            }
            
        }else{
            std::cout << 'F' << std::endl;
        }
    }
}

Measured memory_bytes: 1152
n, k, s = map(int, input().split())
a = [None]*n
for i in range(k):
    a[i] = s

if s != 10**9:
    t = s+1
    for i in range(k, n):
        a[i] = t
else:
    for i in range(k, n):
        a[i] = 1

print(' '.join(map(str, a)))


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template<typename T> using v = vector<T>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 2019;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
void dump_debug(T list) {
#ifdef MY_DEBUG
    each(e, list) cout << e << " ";
    printf("\n");
#endif
}

inline ll inl() {
    ll x;
    cin >> x;
    return x;
}

inline string ins() {
    string x;
    cin >> x;
    return x;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        ll l, r;
        cin >> l >> r;
        ll ans = ll_inf;
        if (r - l >= mod) cout << 0 << endl;
        else {
            l %= mod, r %= mod;
            if (l > r) {
                cout << 0 << endl;
                return 0;
            }
            for (long long i = l; i <= r - 1; ++i) {
                for (long long j = i + 1; j <= r; ++j) {
                    ans = min(ans, (i * j) % mod);
                }
            }
            cout << ans << endl;
        }
//        ll ans = ll_inf;
//        if (l <= mod && mod <= r) {
//            cout << 0 << endl;
//        } else if (l <= mod && r <= mod) {
//            for (long long i = 0; i < min(r - l, mod); ++i) {
//                ll now = r - i;
//                ans = min(ans, ((now % mod) * (now - 1) % mod) % mod);
//            }
//            cout << ans << endl;
//        } else {
//            for (long long i = 0; i < min(r - l, mod); ++i) {
//                ll now = l + i;
//                ans = min(ans, ((now % mod) * (now + 1) % mod) % mod);
//            }
//            cout << ans << endl;
//        }
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	ll N;
	cin >> N;
	vector<ll> A(N);
	REP(i, N) cin >> A[i];

	bool flag = true;

	ll sum = 0;
	ll sumA = 0;
	REP(i, N){
		sum += (i+1);
		sumA += A[i];
	}

	if(sumA%sum!=0) flag = false;

	vector<ll> B(N);
	REP(i, N) B[i] = A[i] - A[(i+1)%N];
	REP(i, N) B[i] += (sumA/sum);
	REP(i, N) if(B[i]<0) flag = false;
	ll tmp = 0;
	REP(i, N){
		if(B[i]%N!=0) flag = false;
		tmp += B[i]/N;
	}
	if(tmp!=(sumA/sum)) flag = false;

	cout << (flag?"YES":"NO") << endl;

	/*
	vprint(B);
	dump(sum)
	dump(sumA)
	*/
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    Long x = 0;
    Long ans = 0;
    for(int i = 0; i < n; i++) {
        ans = max(ans,x);
        if (s[i] == 'D') x--;
        else x++;
        ans = max(ans,x);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main(){
    int W, H, N;
    cin >> W >> H >> N;
    vector< vector<int> > data(N, vector<int> (3));
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            cin >> data.at(i).at(j);
        }
    }//data入力完了
    vector<vector<int> > rectangle(H, vector<int>(W));
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            rectangle.at(i).at(j) = 1;
        }
    }//長方形完成
    for(int i = 0; i < N; i++){
        if(data.at(i).at(2) == 1){
            for(int j = 0; j < H; j++)
                for(int k = 0; k < data.at(i).at(0); k++){
                    rectangle.at(j).at(k) = 0;
                }
        }
        if(data.at(i).at(2) == 2){
            for(int j = 0; j < H; j++){
                for(int k = data.at(i).at(0); k < W; k++){
                    rectangle.at(j).at(k) = 0;
                }
            }
        }
        if(data.at(i).at(2) == 3){
            for(int j = 0; j < data.at(i).at(1); j++){
                for(int k = 0; k < W; k++){
                    rectangle.at(j).at(k) = 0;
                }
            }
        }
        if(data.at(i).at(2) == 4){
            for(int j = data.at(i).at(1); j < H ; j++){
                for(int k = 0; k < W; k++){
                    rectangle.at(j).at(k) = 0;
                }
            }
        }
    }//図形生成完了
    int count = 0;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            count += rectangle.at(i).at(j);
        }
    }
    cout << count << endl;
    return 0; 
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    ll ans = B - B / C - B / D + B / ((C * D) / __gcd(C, D));
    A--;
    ans -= (A - A / C - A / D + A / ((C * D) / __gcd(C, D)));
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

namespace ABC156_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var nk = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var n = nk[0];
            var k = nk[1];

            var ans = 0;
            while (n != 0)
            {
                ans++;
                n -= n % k;
                n /= k;
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13396
#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

#ifdef DEBUG
#define dprintf      printf
#define dputs        puts
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)  {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for(int (i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for(int (i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dputs        (1)?0:puts
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(int i=0){}else
#define drep(i,n)    if(int i=0){}else
#define dstop()
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__)
#define array(T,id,n) T id[(n)]; for(int i=0;i<(n);i++)cin>>id[i]
#define putv(n)     cout<<(n)<<endl

//#define int long long;
#ifndef int
#define INF (0x7fffffff)
#else
#define INF __INT64_MAX__
#endif

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

signed main(void)
{
  char s[1000]={};
  scanf("%s",s);
  char co[]="CODEFESTIVAL2016";
  int i;
  int sum=0;
  int n=strlen(co);
  rep(i,n)
    {
      if(s[i]!=co[i])
	sum++;
    }
  putv(sum);
  return 0;
  
}


Measured memory_bytes: 256
import java.io.*;

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

        while(true){
            int count = 0;
            String[] str = br.readLine().split(" ");
            int n = Integer.parseInt(str[0]);
            int x = Integer.parseInt(str[1]);

            if(n == 0 && x == 0)break;
            for(int i=1; i<=n; i++){
                for(int k=1; k<=n; k++){
                    for(int w=1; w<=n; w++){
                        if(i!=k && k!=w && i!=w && (i+k+w) == x)count++;
                    }
                }
            }
            System.out.println(count / 6);
        }
    }
}

Measured memory_bytes: 25204
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define endl "\n"
#define int long long
#define test int t; cin>>t; while(t--)
#define debug(x) cout<<#x<<" "<<(x)<<endl
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
const int N=1e5;
signed main()
{
	fastio
	//test
	{
        int a,b,c,d; cin>>a>>b>>c>>d;
        int tak=0,aok=0;
        while(a && c)
        {
        	c-=b;
        	if(c<1)
        	{
        		cout<<"Yes";
        		return 0;
        	}
        	a-=d;
        	if(a<1)
        	{
        		cout<<"No";
        		return 0;
        	}
        }
  	}
}

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

using namespace std;

int n,k,a[110],b[110],sum=0;

int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=1;i<=n;i++)
    {
       b[i]=min(2*a[i],2*(k-a[i]));
    }
    for(int i=1;i<=n;i++)
    {
        sum=sum+b[i];
    }
    cout<<sum<<endl;
    return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;

int N;
const int MAX_N = 2.0e5 + 10;
int A[MAX_N];
ll cnt[MAX_N];

int main() {
    memset(cnt, 0, sizeof(cnt));
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        cnt[A[i]]++;
    }

    ll val = 0;
    for (int i = 1; i < MAX_N; i++) {
        val += (cnt[i]*(cnt[i] - 1) / 2);
    }

    for (int i = 0; i < N; i++) {
        ll tmp = val;
        tmp -= (cnt[A[i]] * (cnt[A[i]] - 1) / 2);
        tmp += ((cnt[A[i]] - 2)* (cnt[A[i]] - 1) / 2);
        cout << tmp << endl;
    }


    return 0;
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
#define pb push_back
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define lb lower_bound
#define ld long double
using namespace std;
int h,w;
int ch[101][101];
bool valid (int x,int y){
	if(x>=1 && x<=h && y>=1 && y<=w)
		return 1;
	return 0;
}
int dp[101][101][2];
int solve (int x,int y,int flag){
	if(x == h && y == w){
		return 0;
	}
	if(dp[x][y][flag]!=-1)
		return dp[x][y][flag];
	int ans = 1e18;
	if(valid(x+1,y)){
		if(ch[x+1][y] == flag)
			ans = min(ans,solve(x+1,y,flag));
		else if(ch[x+1][y] == 1)
			ans = min(ans,solve(x+1,y,1));
		else ans = min(ans,1+solve(x+1,y,flag^1));
	}
	if(valid(x,y+1)){
		if(ch[x][y+1] == flag)
			ans = min(ans,solve(x,y+1,flag));
		else if(ch[x][y+1] == 1)
			ans = min(ans,solve(x,y+1,1));
		else ans = min(ans,1+solve(x,y+1,flag^1));
	}
	dp[x][y][flag] = ans;
	return ans;
}
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>h>>w;
	memset(dp,-1,sizeof(dp));
	for(int i = 1;i<=h;i++){
		for(int j = 1;j<=w;j++){
			char x;
			cin>>x;
			if(x == '#')
				ch[i][j] = 0;
			else ch[i][j] = 1;
		}
	}
	int ans;
	if(ch[1][1] == 0){
		ans = 1+solve(1,1,0);
	}
	else ans = solve(1,1,1);
	cout<<ans;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
long long INF = 1e18;

int main(){
    int x;
    cin>>x;
    int flag = 0;
    for(int i = 2; i<100015;i++){
        if(flag == 0 && i == x){
            cout<<x<<endl;
            break;
        }
        if(x%i==0){
            flag = 1;
        }
        if(i>x){
            for(int j = 2 ; j <= i+1;j++){
                if(i%j == 0 && i != j){
                    break;
                }
                if(i == j){
                    cout<<j<<endl;
                    return 0;
                }
            }
        }
        
    }
    return 0;
}

Measured memory_bytes: 256
///
// File:  2001.cpp
// Author: ymiyamoto
//
// Created on Mon Nov 13 02:17:48 2017
//

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

int32_t main()
{
  while (true) {
    uint32_t n, m, a;
    cin >> n >> m >> a;
    if (n == 0) break;
    vector<uint32_t> vers(n + 1, 0);

    for (uint32_t i = 0; i < n + 1; i++) {
      vers[i] = i;
    }

    vector<pair<uint32_t, pair<uint32_t, uint32_t>>> pals;
    for (uint32_t i = 0; i < m; i++) {
      uint32_t h, p, q;
      cin >> h >> p >> q;
      pals.push_back({h, {p, q}});
    }
    sort(pals.begin(), pals.end());

    for (uint32_t i = 0; i < pals.size(); i++) {
      pair<uint32_t, uint32_t> line = pals[i].second;
      swap(vers[line.first], vers[line.second]);
    }
    cout << vers[a] << endl;
  }

  return 0;
}

Measured memory_bytes: 3040
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
//typedef vector<unsigned int>vec;
typedef vector<ll>vec;
typedef vector<vec> mat;
typedef vector<vector<int>> Graph;

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

int dp[3030][3030];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size();
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            if(s[i] == t[j]) chmax(dp[i+1][j+1], dp[i][j] + 1);
            chmax(dp[i+1][j+1], dp[i+1][j]);
            chmax(dp[i+1][j+1], dp[i][j+1]);
        }
    }
    string ans = "";
    int i = n, j = m;
    while(i > 0 && j > 0){
        if(dp[i][j] == dp[i-1][j]) --i;
        else if(dp[i][j] == dp[i][j-1]) --j;
        else{
            ans = s[i-1] + ans;
            --i, --j;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 35840
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0
for i in range(n-2):
    j = i+1
    k = n-1
    while j < k:
        if l[i]<l[j]+l[k]:
            ans += k-j
            j += 1
        else:
            k -= 1
print(ans)


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

int main(){
   int N;
   cin >> N;
   vector<int> H(N);
   for (int i=0; i<N; i++){
      cin >> H.at(i);
   }
   int Ans = 0;
   int cnt = 0;
   for (int i=0; i<N-1; i++){
      if (H.at(i) >= H.at(i+1)){
         cnt++;
         //cout << cnt << endl;
      } else{
         if (cnt > Ans){
            Ans = cnt;
         }
         cnt = 0;
      }
   }
   cout << max(cnt, Ans) << endl;
}



Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <cstring>

using namespace std;

int main() {
	int n;
	while (cin >> n, n) {
		long double room[3][3][n+1];
		memset(room, 0, sizeof(room));

		char s, t, b;
		cin >> s >> t >> b;

		int y = (s-'A') / 3;
		int x = (s-'A') % 3;
		int by = (b-'A') / 3;
		int bx = (b-'A') % 3;
		int gy = (t-'A') / 3;
		int gx = (t-'A') % 3;

		room[y][x][0] = 1.0;

		int dx[] = {-1, 0, 0, 1};
		int dy[] = {0, -1, 1, 0};
		for (int i = 0; i < n; i++) {
			for (int k = 0; k < 3; k++) {
				for (int l = 0; l < 3; l++) {
					for (int j = 0; j < 4; j++) {
						int nx = l + dx[j];
						int ny = k + dy[j];
						if (nx < 0 || 2 < nx || ny < 0 || 2 < ny || (bx == nx && by == ny)) {
							room[k][l][i+1] += room[k][l][i] * 0.25;
						} else {
							room[ny][nx][i+1] += room[k][l][i] * 0.25;
						}
					}
				}
			}
		}
		cout.precision(9);
		cout << fixed << room[gy][gx][n] << endl;
	}
	return 0;
}

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

long long ara[200002],tra[200002];

int main()
{

    long long n,m,i,j,k,a,b,c,st=-1,fn=-1,flg=1,p,q,x,y,tlg;
    vector<long long>u,v;

    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
        scanf("%lld",&a); v.push_back(a); ara[a]++;
    }

    for(i=0;i<n;i++)
    {
        scanf("%lld",&a); u.push_back(a); tra[a]++;
    }

    for(i=1;i<=n;i++)
    {
        if(ara[i]!=0)
        {
            if(ara[i]+tra[i]>n){ flg=0; break;  }
        }

    }


    if(flg==1)
    {

        reverse(u.begin(),u.end());

        for(i=0;i<n;i++)
        {
            if(v[i]==u[i])
            {
                if(st==-1){  st=i; }

                fn=i;
            }

        }

        if(st!=-1)
        {

            p=st-1; q=fn+1;

            for(i=st;i<=fn;i++)
            {
                x=v[i]; tlg=0;

                for(j=q;j<n;j++)
                {

                    q=j+1;

                    if(v[j]!=x && u[j]!=x)
                    {
                        u[i]=u[j];  u[j]=x; tlg=1; break;
                    }

                }

                if(tlg==0)
                {
                    for(j=p-1;j>=0;j--)
                    {
                        p=j-1;

                        if(v[j]!=x && u[j]!=x)
                        {
                            u[i]=u[j]; u[j]=x; tlg=1; break;
                        }
                    }
                }

                if(tlg==0){  flg=0; break; }

            }

        }


    }


    if(flg==0)printf("No\n");
    else
    {
        printf("Yes\n");

        for(i=0;i<n;i++)
        {
            printf("%lld ",u[i]);
        }


    }




    return 0;
}


Measured memory_bytes: 10416
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N;

	cin >> N;

	cout << 180 * (N - 2) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define all(a) a.begin(), a.end()

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

	int ans,a;
	for(int i = 1; i <= 5; i++) {
		cin >> a;
		if(a == 0) ans = i;
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 3612
#pragma comment(linker, "/STACK:10240000")
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int h, n;
    scanf("%d%d", &h, &n);
    int tot = 0;
    for (int i = 1; i <= n; i ++)
    {
        int x;
        scanf("%d", &x);
        tot += x;
    }
    if (tot >= h)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 256
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
#define nin(n) int n; cin >> n;
#define kin(k) int k; cin >> k;
int main() {
  nin(n);
  vector<string> vec(n);
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
  }
  int ans=0;
  int s,t,u;
  s=0;
  t=0;
  u=0;
  for(int i=0;i<n;i++){
    if(vec.at(i).at(0)=='B'){
      if(vec.at(i).at(vec.at(i).size()-1)=='A'){
        s++;
      }
      else{
        u++;
      }
    }
    else if(vec.at(i).at(vec.at(i).size()-1)=='A'){
      t++;
    }
    for(int j=0;j<vec.at(i).size()-1;j++){
      if(vec.at(i).at(j)=='A'){
        if(vec.at(i).at(j+1)=='B'){
          ans++;
        }
      }
    }
  }
  if(s>0&&t+u==0) cout << ans+s-1 << endl;
  else cout << ans+s+min(t,u) << endl;
}
      
         

Measured memory_bytes: 768
import math
A, B, H, M = map(int, input().split())
 
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = abs(H_degree - M_degree)
if diff > 180:
  diff = 360 - diff
else:
  diff = diff
 
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
 
print(length)

Measured memory_bytes: 9344
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, m = map(int, input().split())
    X = sorted(list(map(int, input().split())))

    dist = []
    for i in range(1, m):
        dist.append(X[i] - X[i - 1])

    dist = sorted(dist, reverse=True)
    res = 0
    for i in range(n - 1, len(dist)):
        res += dist[i]

    print(res)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 13960
import sys
import collections
n=int(raw_input())
ans=collections.deque()
while n:
    n-=1
    s=sys.stdin.readline().rstrip().split(' ')
    if s[0][0]=='i':
        ans.appendleft(s[1])
    elif s[0][-3]=='r':
        ans.popleft()
    elif s[0][-3]=='a':
        ans.pop()
    else:
        try:
            ans.remove(s[1])
        except:
            pass
sys.stdout.write(' '.join(ans))
print

Measured memory_bytes: 61008
# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
S =input().strip()
T =input().strip()
match =[]

for s_start in range(len(S)):
    S2 =S[s_start:]
    a=0
    if len(S2) < len(T):
        break
    for t in range(len(T)):
        if S2[t] ==T[t]:
            a +=1
    match.append(a)
ans =len(T) -max(match)
print(ans)

Measured memory_bytes: 9140
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; typedef long double ld;
const int INF32 = 1e9+10;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M, X, Y; cin >> N >> M >> X >> Y;
  int x[110]; int y[110];
  for (int i = 0; i < N; i++)
    cin >> x[i];
  for (int i = 0; i < M; i++)
    cin >> y[i];
  int xmax = *max_element(x, x+N);
  int ymin = *min_element(y, y+M);
  if (xmax <= ymin) {
    for (int z = xmax+1; z <= ymin; z++) {
      if (z > X && z <= Y) {
        cout << "No War" << endl;
        return 0;
      }
    }
  }
  cout << "War" << endl;
}


Measured memory_bytes: 256
from collections import deque
import sys

sys.setrecursionlimit(50000000)


ans = {1: 1}


def dfs(tree, nodes):
    for node in nodes:
        nexts = tree[node]
        for next, l in nexts.items():
            if l % 2 == 0:
                ans[next] = ans[node]
            else:
                ans[next] = 1 - ans[node]
            tree[next].pop(node)

        dfs(tree, nexts)

    return 0


if __name__ == "__main__":
    tree = {}
    N = int(input())
    if N == 1:
        u, v, w = list(map(int, input().split(" ")))
        if w % 2 == 1:
            print(1)
            print(0)
        else:
            print(0)
            print(0)
    else:
        for i in range(N - 1):
            u, v, w = list(map(int, input().split(" ")))

            if u not in tree:
                tree[u] = {}
            tree[u][v] = w

            if v not in tree:
                tree[v] = {}
            tree[v][u] = w
        dfs(tree, [1])
        for i in range(1, N + 1):
            print(ans[i])

Measured memory_bytes: 98708
//Author:- Yatin Patel
//Mail:- yatinpatel.gt@gmail.com

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define FILEIN ifstream fin;fin.open("input.txt");
#define FILEOUT ofstream fout;fout.open("output.txt");

using namespace std;
using namespace __gnu_pbds;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << "  ";
    err(++it, args...);
}

#define FAST ios::sync_with_stdio(false);ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second

#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define minQueue priority_queue<ll,vector<ll>,greater<ll> >
#define maxQueue priority_queue<ll,vector<ll>,less<ll> > 

#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define RFOR(i,a,b) for(ll i=a;i>b;i--)
#define FILL(a,b) memset((a),(b),sizeof((a)))

#define MOD 1000000007
#define INF LONG_MAX
#define MINF LONG_MIN

typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

ll power(ll x, unsigned ll y){
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}

//#define fin cin
//#define fout cout

int main(){

    FAST;
    string str;
    cin>>str;

    ll cnt = 0;
    for(ll i=0;i<str.length();i++){
        if(str[i]=='o'){
            cnt++;
        }
    }

    cnt += (15-str.length());

    if(cnt>=8){
        cout<<"YES";
    }
    else{
        cout<<"NO";
    }
    return 0;
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
constexpr int INF = (numeric_limits<int>::max() == INT_MAX ? (int)1e9 : (long long)1e18);
constexpr long double eps = 1e-6;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
using ld  = long double;using pii = pair<int,int>;using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
void fast_io(){ios::sync_with_stdio(false); cin.tie(nullptr);}
signed main(){
    fast_io();
    const string el = "\n";
    int N; cin >> N;
    vector<int>A(N + 1);
    for(auto& e : A) cin >> e;
    vector<int>B(N); for(auto& e : B) cin >> e;
    int ans  = 0;
    int tans = 0;
    auto yebi = B;
    auto h = A;
    for(int i = N - 1; i >= 0; --i){
        int r = min(B[i],A[i + 1]);
        tans += r; B[i] -= r;
        r = min(B[i],A[i]);
        tans += r; B[i] -= r;
        A[i] -= r;
    }
    
    for(int i = 0; i < N; ++i){
        int r = min(yebi[i],h[i]);
        ans += r; yebi[i] -= r;
        r = min(yebi[i],h[i + 1]);
        ans += r; yebi[i] -= r;
        h[i+1] -= r;
        
        
    }
    cout << max(tans,ans) << endl;
}


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int i = 0;
  while (A > 0 && C > 0) {
    if (i%2 == 0) C -= B;
    else A -= D;
    i++;
  }
  if (i%2 != 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
const int inf = 1000000001;
const ll INF = 1e18 * 4;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

int main() {
	int n, i, j;
	cin >> n;
	vi a(n);
	int gu = 0, ki = 0;
	for (i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2) {
			ki++;
		}
		else {
			gu++;
		}
	}
	ll ans = (ll)pow(3, n);
	ll allki = pow(2, gu);
	ans -= allki;
	cout << ans << endl;


}

Measured memory_bytes: 640
def GoJoHo(a,b):
  if max(a,b) % min(a,b) == 0:
    return min(a,b)
  if min(a,b) % (max(a,b) % min(a,b)) == 0:
    return max(a,b) % min(a,b)
  else:
    return GoJoHo(min(a,b),max(a,b)%min(a,b))

n = int(input())
result = 1

for i in range(n):
  tmp = int(input())
  result = result*tmp//GoJoHo(result,tmp)
print(result)

Measured memory_bytes: 3064
def rowSum(matrix):
  n=len(matrix)
  sumcolumn=[0]*n
  for i in range(0,n):
    sumcolumn[i] = sum(matrix[i])
  return sumcolumn

def colSum(matrix):
  n=len(matrix)
  sumrow=[0]*n
  for i in range(0,n):
    for j in range(0,n):
      sumrow[i]+=matrix[j][i]
  return sumrow

while True:
  n=int(input())
  if n==0:  break
  matrix=[None]*n
  for i in range(0,n):
    matrix[i] = list(map(int,input().split()))

  c=rowSum(matrix)
  r=colSum(matrix)

  matrix.append(r)

  for i in range(0,n):
    matrix[i].append(c[i])

  matrix[n].append(sum(matrix[n]))

  for row in matrix:
    line=""
    for element in row:
      line += '{:>5}'.format(str(element))
    line.rstrip()
    print(line)

Measured memory_bytes: 7688
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
	string a;
	cin >> a;
	int x=0,y=0;
	for(auto qwq:a)
		x+=qwq=='0',y+=qwq=='1';
	cout << min(x,y)*2;
	return 0;
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

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

    ll res;
    cin >> res;
    for(int i = 2; i <= n; ++i) {
        ll x; cin >> x;
        res = x / __gcd(x, res) * res;
    }

    cout << res << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
typedef long long ll;

int main(void) {
  ll n, i, j, k;
  char s[30];
  ll a[5];
  for(i = 0; i < 5; ++i) a[i] = 0;
  scanf("%lld", &n);
  for(i = 0; i < n; ++i) {
    scanf("%s", s);
    if(s[0] == 'M') a[0]++;
    else if(s[0] == 'A') a[1]++;
    else if(s[0] == 'R') a[2]++;
    else if(s[0] == 'C') a[3]++;
    else if(s[0] == 'H') a[4]++;
  }
  ll ans = 0;
  for(i = 0; i < 5; ++i) for(j = i + 1; j < 5; ++j) for(k = j + 1; k < 5; ++k) ans += a[i] * a[j] * a[k];
  printf("%lld", ans);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<string> ves;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define fs first
#define sc second
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
 
int main() {
	//cout.precision(10);
	cin.tie(0);
	ios::sync_with_stdio(false);
    
    int H,W; cin >> H >> W;
    ve_vec a(H,vec(W));
    ve_vec ans(H+2,vec(W+2));
    rep(i,H) rep(j,W) cin >> a[i][j];

    rep(i,H+2){
        rep(j,W+2){
            if(i == 0 or j == 0 or i == H+1 or j == W+1) ans[i][j] = '#';
            else ans[i][j] = a[i-1][j-1];
        }
    }
    rep(i,H+2){
        rep(j,W+2){
            cout << ans[i][j];
        }
        cout << endl;
    }
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1,p2;
    p1 = mp(l1,r1); p2 = mp(l2,r2);
    if(p1>p2)swap(p1,p2);
    if(p2.fi <= p1.se)return true;
    else return false;
}
ll fexp (ll num1, ll num2, ll MOD){
    if(num2==0)return 1;
    else if(num2==1)return num1;
    else{
        ll temp = fexp (num1,num2/2,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2%2==1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return fexp (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/gcd(num1,num2))*num2;}


// end of Template

int x,t;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>x>>t;
    cout<<max(0,x-t)<<newl;

}


Measured memory_bytes: 256
from functools import lru_cache
from collections import defaultdict
MOD = 10**9 + 7


def Is_prime(n):
    # nが1以下ならFalse
    if n<=1:
        return False
    # nが2または3ならTrue
    if n==2 or n==3:
        return True
    # nが2の倍数ならFalse
    if n%2==0:
        return False
    # nの平方根を整数で取得
    sqrt_root = int(n**.5)
    # nがnの平方根以下の3以上の奇数で1回でも割れたらFalse
    for i in range(3,sqrt_root+1,2):
        if n%i==0:
            return False
    # 上の条件を全てぬけたものはTrue
    return True

# 素数テーブル
# n以下の素数を列挙する
def Prime_table(n):
    res = []
    for i in range(n+1):
        if Is_prime(i):
            res.append(i)
    return res

# 素因数分解
def Factorization(n):
    prime_table = Prime_table(n)
    arr = []
    temp = n
    for i in prime_table:
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N = int(input())
L = list(map(Factorization, range(2,N+1)))

d = defaultdict(int)
for i in range(len(L)):
    for l in L[i]:
        d[l[0]] += l[1]

res = 1
for i in d.values():
    res *= (i+1)
    res %= MOD
print(res)

Measured memory_bytes: 3808