akhauriyash/Code-Regression huggingface dataset:
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>


/* ---------- Namespace ---------- */

using namespace std;


/* ---------- Type Abbreviation ---------- */

template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;

using ll = long long;
using PL = P<ll, ll>;
using PS = P<string, ll>;

using VI = V<int>;
using VVI = V<VI>;
using VL = V<ll>;
using VVL = V<VL>;
using VS = V<string>;
using VB = V<bool>;
using VVB = V<VB>;
using VPL = V<PL>;
using VPS = V<PS>;

#define fst first
#define snd second


/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)


/* ---------- container ---------- */

#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define GSORT(c) sort(ALL(c), greater<decltype((c).front())>())
#define SZ(x) (LL((x).size()))


/* ---------- repetition ---------- */

#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)

#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// Usual REP runs from 0 to n-1 (R: n to 0)
// Natural REP runs from 1 to n (R: n to 1)


/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = 3.14159265358979;
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};


/* ---------- Short Functions ---------- */

template <typename T>
T square(T a) {
    return a * a;
}


/* ---------- Debug ---------- */
#define GET_VAR_NAME(variable) #variable

#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;
#define testP(p) cout << GET_VAR_NAME(p) << " = (" << (p).fst << ", " << (p).snd << ")" << endl;


/* ^^^^^^^^^^^^^^^ Settting Part ^^^^^^^^^^^^^^^ */

/* ---------- Variances ---------- */


/* ---------- Functions ---------- */


/* ---------- Main Function ---------- */

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

    ll N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;

    ll diff = B - A;
    REP(i, N) {
        ll ub = (N - i - 1) * D - i * C;
        ll lb = (N - i - 1) * C - i * D;

        // cout << i << ":" << lb << "~" << ub << endl;
        if (diff >= lb && diff <= ub) {
            cout << "YES" << endl;
            return 0;
        }
    }

    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, gcd, lcm 
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string
#include <vector> // vector
#include <queue> // queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <cstdint> // int64_t, int_fast64_t

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define all(v) v.begin(),v.end()

typedef std::int_fast64_t ll; // at least int64 > 9*10^18
typedef std::uint_fast64_t ull; // at least uint64

int main() {
  int n,m;
  std::cin >> n >> m;
  std::vector<int> x(m);
  rep(i,m) std::cin >> x[i];
  if(n>=m) {
    std::cout << 0 << ENDL;
    return 0;
  }
  std::sort(all(x));
  std::vector<int> intervals(m-1);
  int max_interval = x[m-1]-x[0];
  rep(i,m-1) {
    intervals[i] = x[i+1]-x[i];
  }
  std::sort(all(intervals),std::greater<int>());
  rep(i,n-1) {
    max_interval-=intervals[i];
  }
  std::cout << max_interval << ENDL;
  return 0;
}

Measured memory_bytes: 1024
#pragma region header
#include <bits/stdc++.h>
using namespace std;

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;
#pragma endregion

#pragma region const
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#pragma endregion

#pragma region util
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}
#pragma endregion

#pragma region init
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

int main()
{
	i64 A,B;
	cin >> A >> B;
	cout << (B % A == 0 ? A + B : B - A) << endl;
	return 0;
}


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

int main() {

	int n, m;	cin >> n >> m ;
	vector <vector <int>> dp(n, vector <int> (m, 0));

	vector <string> s(n);
	for (auto &i: s)	cin >> i;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (i == 0 && j == 0)		
				dp[i][j] = (s[i][j] == '#');
			else if (i == 0)
				dp[i][j] = dp[i][j - 1] + (s[i][j] == '#' && s[i][j - 1] != '#');
			else if (j == 0)
				dp[i][j] = dp[i - 1][j] + (s[i][j] == '#' && s[i - 1][j] != '#');
			else	
				dp[i][j] = min(dp[i][j - 1] + (s[i][j] == '#' && s[i][j - 1] != '#'), dp[i - 1][j] + (s[i][j] == '#' && s[i - 1][j] != '#'));
		}
	}

	cout << dp[n - 1][m - 1] << endl;

	return 0;
}

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

using namespace std;

int main(){
    ios::sync_with_stdio(0);
    int n, a;
    set<int> arr;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a;
        arr.insert(a);
    }
    if(arr.size() == n){
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO\n";
    }
    
    
}

Measured memory_bytes: 9600
import java.util.*;
import java.io.*;
import java.math.*;

public class Main{

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

    Integer[] HWhw = Arrays.stream(in.readLine().split(" ")).map(Integer::parseInt).toArray(Integer[]::new);

    int H = HWhw[0];
    int W = HWhw[1];
    int h = HWhw[2];
    int w = HWhw[3];

    long[][] rect = new long[H][W];

    long large = (long)Math.pow(10L, 9)-1;

    if (H%h==0 && W%w==0) {
      System.out.println("No");
    }else{
      System.out.println("Yes");
      for(int i=0;i<H;i+=h){
        for(int j=0;j<W;j+=w){
          rect[i][j] = large;
        }
      }
      for(int i=h-1;i<H;i+=h){
        for(int j=w-1;j<W;j+=w){
          rect[i][j] -= (large+1);
        }
      }
      for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
          System.out.print(rect[i][j]+" ");
        }
        System.out.println();
      }
    }
  }
}


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

using namespace std;

int main() {
  
  long long X=0;
  
  cin >> X;
  
  long long P=100, year=0;
  
  while(P<X) {
    
    P += P/100;
    
    year++;
    
  }
  
  cout << year << endl;
  
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
const int N=1<<18;
int a[N];

int ab(int a)
{
	return a>0?a:-a;
}

int main()
{
	int n;
	scanf("%d",&n);
	a[0]=a[n+1]=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	int ans=0;
	for(int i=0;i<=n;i++)
	{
		ans+=ab(a[i]-a[i+1]);
	}
	for(int i=1;i<=n;i++)
	{
		printf("%d\n",ans-ab(a[i-1]-a[i])-ab(a[i]-a[i+1])+ab(a[i-1]-a[i+1]));
	}
	return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n;
  ll h;cin >> n >> h;
  vector<ll> va,vb;
  repi(i,0,n){
    ll a,b;cin >> a>>b;
    va.push_back(a);
    vb.push_back(b);
  }
  sort(all(va));
  sort(all(vb));
  ll max_a = va[n-1];
  ll cnt = 0LL;
  for(int j=n-1;j>=0;--j){
    if(vb[j] < max_a || h<=0) break;
    h -= vb[j];
    ++cnt;
  }
  if(h>0){
    cnt += h/max_a;
    if(h%max_a != 0) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 2036
<?php
//error_reporting(0);
//$A = explode(" ",trim(fgets(STDIN)));
$N = trim(fgets(STDIN));
//list($A,$B) = explode(" ",trim(fgets(STDIN)));
for($i=0;$i<$N-1;$i++) {
  list($C[$i],$S[$i],$F[$i])=explode(" ",trim(fgets(STDIN)));
}
$r = array();
for($i=0;$i<$N;$i++) {
  $t=0;
  for($j=$i;$j<$N-1;$j++) {
    if ($t<$S[$j]) $t=$S[$j];
    else if ($t%$F[$j]==0);
    else $t=$t+$F[$j]-$t%$F[$j];
    $t+=$C[$j];
  }
  printf("%d\n",$t);
}


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

int main() {
    int N;
    cin>>N;
    vector<int>arr(N);
    for(int i=0;i<N;i++)
        cin>>arr[i];
    int maxi=0;
    int curr=1;
    for(int i=0;i<N-1;i++){
        if(arr[i]>=arr[i+1]){
            curr++;
        }
        else{
            --curr;
            if(curr>maxi)
                maxi=curr;
            curr=1;    
        }
    }
    --curr;
    if(curr>maxi)
        maxi=curr;
    cout<<maxi;
	return 0;
}

Measured memory_bytes: 640
// Score: /200

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int N, M, X, Y;
	cin >> N >> M >> X >> Y;
	int Z = X+1;
	for (int i = 0; i < N; ++i)
	{
		int xi;
		cin >> xi;
		Z = max(xi+1, Z);
	}
	if(Z > Y){
		cout << "War";
		return 0;
	}
	for (int i = 0; i < M; ++i)
	{
		int yi;
		cin >> yi;
		if(yi< Z){
			cout << "War";
			return 0;
		}
	}
	cout << "No War";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define mat vector<vector<int>>
const int inf = 1 << 30;
const ll linf = 1e18;
const db EPS = 1e-7;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

ll N;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N;
    vector<int> ans;
    int end = 0;
    if(N >= 0){
        for(int i = 0; i <= 50; ++i){
            if(N >> i & 1){
                ans.emplace_back(1);
                end = i;
                if(i & 1) N += 1LL << i;
            }else{
                ans.emplace_back(0);
            }
        }
    }else{
        N = abs(N);
        for(int i = 0; i <= 50; ++i){
            if(N >> i & 1){
                ans.emplace_back(1);
                end = i;
                if(!(i & 1)) N += 1LL << i;
            }else{
                ans.emplace_back(0);
            }
        }
    }
    for(int i = end; i >= 0; --i){
        cout << ans[i];
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define se second
#define fi first
#define rep(i, l, r) for (ll i = (ll)(l); i < (ll)(r); i++)
#define print(v) for (const auto itr : v){cout << itr << ' ';} cout << endl;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define endl "\n"
#define inf 1e18
using namespace std;
const ll INF = 1e18L + 5;
const ll maxn = 1e5+5, maxn1=202;
ll ceel(ll a, ll b)
{
   if (a % b == 0)
       return a / b;
   return a / b + 1;
}
ll modneg(ll a,ll m)
{
    a = a % m;
    if(a<0)
        a=a+m;
    return a;
}
ll powermod(ll x, unsigned ll y, ll p){ll res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
ll lcm(ll a, ll b) { return (a * b) / __gcd(a, b); };
ll csb(ll n){ ll count = 0;while (n){ count += n & 1; n >>= 1; } return count;}


int main()
{

ll test,n,k,i,j,a,b,m,x,y,c,temp;
cin>>x>>y>>a>>b>>c;
vector<pair<ll,char>> v;
rep(i,0,a)
{
    cin>>temp;
    v.pb({temp,'r'});
}
rep(i,0,b)
{
    cin>>temp;
    v.pb({temp,'g'});
}
rep(i,0,c)
{
    cin>>temp;
    v.pb({temp,'c'});
}
sort(v.begin(),v.end(),greater<pair<ll,char>>());
// for(i=0;i<v.size();i++)
//     cout<<v[i].fi<<" "<<v[i].se<<endl;
ll t=x+y;
ll cntr=0,cntg=0,sum=0;
for(i=0;i<t;i++)
{
    if(v[i].se=='g')
        cntg++;
    if(v[i].se=='r')
        cntr++;
    sum+=v[i].fi;
}
// cout<<cntr<<" "<<cntg<<" "<<sum<<endl;
if(cntg<=y and cntr<=x)
{
    cout<<sum;    
    exit(0);
}
sum=0;
if(cntg>y)
{
    cntg=cntr=0;
    for(i=0;i<v.size();i++)
    {
        if(cntg==y and cntr==x)
            break;
        
        if( v[i].se=='g' and cntg<y)
        {
            sum+=v[i].fi;
            cntg++;
        }
        else if(v[i].se!='g')
        {
            sum+=v[i].fi;
            cntr++;
        }
        // cout << i << " " << v[i].fi << " " << cntg << " " << cntr << endl;
    }
    cout<<sum<<endl;
    exit(0);
}
else if(cntr>x)
{
    cntg=cntr=0;
    for(i=0;i<v.size();i++)
    {
        if (cntg == y and cntr == x)
            break;
        if(v[i].se=='r' and cntr<x)
        {
            sum+=v[i].fi;
            cntr++;
        }
        else if(v[i].se!='r')
        {
            sum+=v[i].fi;
            cntg++;
        }
        
    }
    cout << sum << endl;
    exit(0);
}
return 0;
}


Measured memory_bytes: 10348
#include<iostream>
#include<cstdio>
typedef long long ll;
using namespace std; 

int main(){
	ll n; cin>>n;
	ll hasil=1, mod=1000000007;
	for(int i=2;i<=n;i++){
		hasil=hasil*i% mod;
	}
	cout<<hasil;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)
typedef double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef vector<P> VP;
const D EPS = 1e-9;
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)
D dot(P a, P b) {return (conj(a)*b).X; }
D cross(P a, P b) {  return (conj(a)*b).Y;}
int ccw(P a, P b, P c) {
  b -= a;  c -= a;
  if (cross(b,c) >  EPS) return +1;
  if (cross(b,c) < -EPS) return -1;
  if (dot(b,c)   < -EPS) return +2;
  if (norm(b) < norm(c)) return -2;
  return 0;
}
namespace std {
  bool operator<(const P a, const P b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
}
VP convexHull(VP ps) {
  int n = ps.size(), k = 0;
  sort(ps.begin(), ps.end());
  VP ch(2*n);
  for (int i = 0; i < n; ch[k++] = ps[i++])
    while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--])
    while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  ch.resize(k-1);
  return ch;
}


int par[101];
int rank[101];
void init(int n){
  for(int i=0;i<n;i++){
    par[i]=i;
    rank[i]=1;
  }
}
int find(int x){
  if(par[x]==x){
    return x;
  }else{
    return par[x]=find(par[x]);
  }
}
void unit(int x,int y){
  x=find(x);
  y=find(y);
  if(x==y)return;
  if(rank[x]<rank[y]){
    par[x]=y;
  }else{
    par[y]=x;
    if(rank[x]==rank[y])rank[x]++;
  }
}
bool same(int x,int y){
  return find(x)==find(y);
}
struct edge{int u,v;double cost;};
bool comp(const edge& e1,const edge& e2){
  return e1.cost<e2.cost;
}
edge es[10001];
int V,E;
double kruskal(){
  sort(es,es+E,comp);
  double res=0;
  for(int i=0;i<E;i++){
    edge e=es[i];
    if(!same(e.u,e.v)){
      unit(e.u,e.v);
      res+=e.cost;
    }
  }
  return res;
}
double dis(P a,P b){
  return sqrt((a.X-b.X)*(a.X-b.X)+(a.Y-b.Y)*(a.Y-b.Y));
}
int main(){
  double q1,q2;
  int q,w;
  double ans=0;
  cin>>V>>E;
  VP v,t;
  init(V);
  rep(i,V){
    cin>>q1>>q2;
    v.push_back(P(q1,q2));
  }
  t=convexHull(v);
  rep(i,t.size()){
   ans+=dis(t[i],t[(i+1)%(int)t.size()]);
   int p1,p2;
   rep(j,v.size())if(t[i]==v[j])p1=j;
   rep(j,v.size())if(t[(i+1)%(int)t.size()]==v[j])p2=j;
   unit(p1,p2);
  }
  rep(i,E){
    cin>>q>>w;
    q--;w--;
    es[i].cost=dis(v[q],v[w]);
    es[i].u=q;
    es[i].v=w;
  }
  printf("%.9f\f",ans+kruskal());
}

Measured memory_bytes: 3328
#include <stdio.h>

int main()
{
	int N, Y, x, y,z;
	scanf("%d %d", &N, &Y);
		for (y = 0; y <= (Y / 5000); y++) {
			for (x = 0; x <= (Y / 10000); x++) {
				if (N - x - y > 0)
					z = N - x - y;
				else
					z = 0;
				if ((x + y + z) == N && Y - (10000 * x + 5000 * y + 1000 * z) == 0) {
					printf("%d\t%d\t%d\t\n", x, y, z);
					return 0;
				}
			}
		}
	printf("-1 -1 -1\n");
	return 0;
}


Measured memory_bytes: 128
#/Users/Shuhei_Nakano/Desktop/sprogram/PCC

N, M = map(int, input().split())
a=[];
b=[];

for i in range(M):
    c, d= map(int, input().split())
    a.append(c)
    b.append(d)
f=[]
f2=[]
for i in range(N):
    f=[]
    for j in range(M):
        if (a[j]==i+1):
            f.append(j+1)
        if (b[j]==i+1):
            f.append(j+1)
            f=list(set(f))
    dd=len(f)
    f2.append(dd)

#print(f2)
for i in f2:
    print(i)

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


int main() {
    string s; cin >> s;
    int m = (s.at(5)-'0') * 10 + (s.at(6)-'0');
    int d = (s.at(8)-'0') * 10 + (s.at(9)-'0');

    if(m < 4) {
        cout << "Heisei" << endl;
    } else if(m==4 && d <= 30) {
        cout << "Heisei" << endl;
    } else {
        cout << "TBD" << endl;
    }

    return 0;

}

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

int main()
{
    int red, green, numa, numb, numc;
    cin >> red >> green >> numa >> numb >> numc;
    vector<int> v_red;
    vector<int> v_green;
    vector<int> v_white;
    int current;
    for(int i=0;i<numa;i++){
        cin >> current;
        v_red.push_back(current);
    }
    for(int i=0;i<numb;i++){
        cin >> current;
        v_green.push_back(current);
    }
    for(int i=0;i<numc;i++){
        cin >> current;
        v_white.push_back(current);
    }
    sort(v_red.begin(),v_red.end(),greater<int>());
    sort(v_green.begin(),v_green.end(),greater<int>());
    sort(v_white.begin(),v_white.end(),greater<int>());
    long long ans = 0;
    vector<int> eat;
    for(int i=0;i<red;i++){
        ans += v_red[i];
        eat.push_back(v_red[i]);
    }
    for(int i=0;i<green;i++){
        ans += v_green[i];
        eat.push_back(v_green[i]);
    }
    sort(eat.begin(),eat.end());
    int index_eat = 0;
    int index_white = 0;
    while(eat[index_eat]<=v_white[index_white]){
        ans -= eat[index_eat];
        ans += v_white[index_white];
        index_eat ++;
        index_white ++;
        if(index_eat>=eat.size()){
            break;
        }
        if(index_white>=v_white.size()){
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2552
#include <stdio.h>
#include <stdlib.h>
#define NIL -1
typedef struct {
        int key,right,left;

} N;
void Insert(N *, int, int);
void Preorder(N *, int );
void Inorder(N *, int );
int main (){
        int i,n=0,key,j=0;
        char com[8];
        N *Tree;
        scanf("%d",&n);
        Tree = malloc(sizeof(N)*n);

        for(i=0; i<n; i++) {
                scanf("%s",com);
                if(com[0]=='i') {
                        scanf("%d",&key);
                        Insert(Tree,j,key);
                        j++;
                }
                else if(com[0]=='p') {
                        if(j>0) {
                                Inorder(Tree,0);
                                printf("\n");

                                Preorder(Tree,0);
                                printf("\n");

                        }
                }
        }
        free(Tree);
        return 0;
}
void Insert(N *Tree,int j,int key ){
        int x=0,y;
        Tree[j].key=key;
        Tree[j].left=NIL;
        Tree[j].right=NIL;
        if(j==0) {
                return;
        }
        while( x!= NIL) {
                y=x;
                if(key<Tree[x].key) {
                        x=Tree[x].left;

                }
                else{
                        x=Tree[x].right;
                }
        }
        if(key<Tree[y].key) {
                Tree[y].left=j;
        }
        else{
                Tree[y].right=j;
        }
}
void Preorder(N *Tree, int k){
        if(k==NIL) {
                return;
        }
        printf(" %d",Tree[k].key);
        Preorder(Tree,Tree[k].left);
        Preorder(Tree,Tree[k].right);

}
void Inorder(N *Tree, int k){
        if(k==NIL) {
                return;
        }
        Inorder(Tree,Tree[k].left);
        printf(" %d",Tree[k].key);

        Inorder(Tree,Tree[k].right);

}



Measured memory_bytes: 7240
// Problem : D - Div Game
// Contest : AtCoder - AtCoder Beginner Contest 169
// URL : https://atcoder.jp/contests/abc169/tasks/abc169_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include "bits/stdc++.h"
using namespace std;
#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define pb push_back
#define nl cout<<"\n"
#define endl "\n"
#define all(c) (c).begin(),(c).end()
#define trav(a,x) for(auto a = x.begin() ; a != x.end() ; a++)
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
typedef long long ll;
typedef unsigned long long ull ;
typedef long double ld;
inline ll max(ll a,ll b) {return ((a>b)?a:b);}
inline ll min(ll a,ll b) {return ((a>b)?b:a);}
inline ll gcd(ll a ,ll b) {if(b==0) return a;a%=b;return gcd(b,a);}
ll power(ll x, ll y) { if (y == 0) return 1;  ll a = power(x,y/2);if (y % 2 == 0) return a * a; else return x * a * a; }
ll powermod(ll x, ll ex , ll md) {ll ans = 1ll;while (ex > 0) {    if (ex & 1ll) ans = (ans * x) % md;    ex >>= 1ll;x = (x * x) % md;}return ans;}
const ll inf = 1e18 + 9;
const ll mod = 1e9 + 7;
const long double eps = 1e-9;
const ll N = 1e6 + 1;
ll n;
map<ll ,ll > m;
void solve(){
	cin >> n;
    ll x = n;
    ll temp= x;
    for(ll i = 2 ; i <= sqrt(x) ; i++){
       if(temp%i == 0){
            while(temp%i == 0){
            	temp/=i;
            	m[i]++;
            }
       }
    }
    if(temp != 1) m[temp]++;
    ll ans = 0;
    trav(it , m){
    	ll val = it->s;
    	ll ct = 0;
    	ll i = 1;
    	while(ct <= val){
    		ct += i;
    		i++;
    		if(ct <= val)ans++;
    	}
    }
    cout << ans << endl;
}
int main(){
    IOS;
    cout<<fixed<<setprecision(20);
    ll T=1;
    // cin>>T;
    ll t=0;
    while(t++<T){
        // cout<<"Case #"<<t<<":"<<' ';
        solve();
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


Measured memory_bytes: 3864
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#include <cmath>
#define SIZE 6005

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

string dp[SIZE];
char str[SIZE];
int pa[SIZE],pb[SIZE];
int pos[SIZE];
bool use[SIZE];

int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",&str);
	int sa=0,sb=0;
	for(int i=0;i<2*n;i++)
	{
		if(str[i]=='a')
		{
			pa[sa++]=i;
		}
		else
		{
			pb[sb++]=i;
		}
	}
	for(int i=0;i<n;i++)
	{
		pos[pa[i]]=pb[i];
		pos[pb[i]]=pa[i];
	}
	dp[2*n]="";
	for(int i=2*n-1;i>=0;i--)
	{
		dp[i]=dp[i+1];
		if(i<pos[i])
		{
			if(str[i]=='a')
			{
				string to="ab";
				to+=dp[pos[i]+1];
				dp[i]=max(dp[i],to);
			}
			else
			{
				int cnt=0;
				string now="";
				for(int j=i;j<2*n;j++)
				{
					if(pos[j]<i) continue;
					if(str[j]=='a')
					{
						if(pos[j]<j)
						{
							now+="a";
							cnt--;
						}
					}
					else
					{
						if(pos[j]>j)
						{
							now+="b";
							cnt++;
						}
					}
					if(cnt==0)
					{
						now+=dp[j+1];
						dp[i]=max(dp[i],now);
						break;
					}
				}
			}
		}
	}
	printf("%s\n",dp[0].c_str());
	return 0;
}


Measured memory_bytes: 14720
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, L = il()
    R = range(L, L+N)
    mi = float('inf')
    sm = 0
    for n in R:
        mi = min(mi, abs(n))
        sm += n
    print(sm - mi if sm > 0 else sm + mi)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3896
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE BangPatterns          #-}
{-# LANGUAGE CPP                   #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings     #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE TupleSections         #-}
{-# LANGUAGE TypeFamilies          #-}

import           Control.Applicative
import           Control.Monad
import           Control.Monad.Primitive
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Data.Bool
import qualified Data.ByteString.Char8       as B
import qualified Data.ByteString.Unsafe      as B
import           Data.Char
import           Data.Function
import qualified Data.IntMap.Strict          as IM
import qualified Data.IntSet                 as IS
import           Data.List
import qualified Data.Map.Strict             as M
import           Data.Monoid
import           Data.Ord
import           Data.Primitive.MutVar
import qualified Data.Set                    as S
import           Data.Tuple
import qualified Data.Vector                 as V
import qualified Data.Vector.Generic         as G
import qualified Data.Vector.Generic.Mutable as GM
import qualified Data.Vector.Unboxed         as U
import qualified Data.Vector.Unboxed.Mutable as UM
import           Debug.Trace
import           Foreign                     hiding (void)
import           Unsafe.Coerce

main :: IO ()
main = do
    !n <- readLn :: IO Int
    xs <- U.toList.U.unfoldrN n (B.readInt.B.dropWhile isSpace) <$> B.getLine
    print $ solve n xs

solve n xs = sum. map (\(i,x)->abs$x-(med + i)) $ zip [1..] xs
  where
    sorted = sort . map (\(x,i)->x-i)$ zip xs [1..]
    !med = sorted !! div n 2


Measured memory_bytes: 56700
#include <bits/stdc++.h>
#define int long long
using namespace std;

const long long MOD = 998244353;
int N, S;
int A[3005];
long long memo[3005][3005];

int POW(int X, int Y) {
  int res = 1;
  while(Y) {
    if(Y & 1) res = res * X % MOD;
    X = X * X % MOD;
    Y >>= 1;
  }
  return res;
}

long long dp(int now, int val) {
  if(val == S) return POW(2, N - now + 1);
  if(now > N || val > S) return 0;
  if(memo[now][val] != -1) return memo[now][val];
  return memo[now][val] = (2 * dp(now + 1, val) + dp(now + 1, val + A[now])) % MOD;
}

int32_t main() {
  memset(memo, -1, sizeof(memo));
  scanf("%lld %lld", &N, &S);
  for(int i = 1; i <= N; i++) {
    scanf("%lld", &A[i]);
  }
  long long ans = 0;
  ans = dp(1, 0) % MOD;
  printf("%lld\n", ans % MOD);
}


Measured memory_bytes: 74580
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int n,a,b;
		n=stdin.nextInt();
		a=stdin.nextInt();
		b=stdin.nextInt();
		if(n*a<b){
			System.out.println(a*n);
		}
		else{
			System.out.println(b);

		}
	}

}


Measured memory_bytes: 20820
#include <bits/stdc++.h>
using namespace std;
#define mid ((s + e) / 2)
#define makefast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define comp(x) (lower_bound(vec.begin(), vec.end(), x) - vec.begin())
#define lc (v * 2)
#define rc (v * 2 + 1)
long long M = 1e9 + 7;
//>>>>>>>>>>>>>>>>>>>>>>>
 
const int N = 2e4 + 7;
 
int n, x[N], plc[N], d, cl[N], cr[N];
vector < pair <int, int> > vec;
 
pair <int, int> close(int y) {
	int l = lower_bound(vec.begin(), vec.end(), make_pair(y - d, 0)) - vec.begin();
	int r = upper_bound(vec.begin(), vec.end(), make_pair(y + d, N)) - vec.begin();
	return {l, r};
}
bool mrk[N];
set < pair <int, int> > seg; 

void put(int p, int u, int tp) {
	if (tp == 1) 
		seg.insert({p, u});
	else
		seg.erase({p, u});
}
 
int get(int l, int r) {
	auto it = seg.lower_bound({l, 0});
	if (it == seg.end() || r <= it->first)
		return 0;
	return it->second;
}
vector <int> st;
 
void dfs(int v) {
	if (mrk[v])
		cout << 1 / 0 << endl;
	mrk[v] = 1;
	bool ok = 1;
	while (ok) {
		ok = 0;
		int u = get(cl[v], plc[v]);
		if (u) {
			put(plc[u ^ 1], u, -1);
			dfs(u);
			ok = 1;
			continue;
		}
		u = get(plc[v] + 1, cr[v]);
		if (u) {
			put(plc[u ^ 1], u, -1);
			dfs(u);
			ok = 1;
		}
	}
	st.push_back(v);
}
int com[N];
int cnt;
 
void rev(int v) {
	if (com[v])
		cout << 1 / 0 << endl;
	com[v] = cnt;
	bool ok = 1;
	while (ok) {
		ok = 0;
		int u = get(cl[v ^ 1], plc[v ^ 1]);
		if (u) {
			put(plc[u], u, -1);
			rev(u);
			ok = 1;
			continue;
		}
		u = get(plc[v ^ 1] + 1, cr[v ^ 1]);
		if (u) {
			put (plc[u], u, -1);
			rev(u);
			ok = 1;
			continue;
		}
	}
}
 
bool can() {
	cnt = 0;
	memset(mrk, 0, sizeof mrk);
	for (int i = 2; i <= 2 * n + 1; i++) {
		cl[i] = close(x[i]).first;
		cr[i] = close(x[i]).second;
	}
	for (int i = 2; i <= 2 * n + 1; i++)
		put(plc[i ^ 1], i, 1);	
	for (int i = 2; i <= 2 * n + 1; i++) 
		if (!mrk[i]) {
			put(plc[i ^ 1], i, -1);
			dfs(i);
		}
	memset(com, 0, sizeof com);
	for (int i = 2; i <= 2 * n + 1; i++)
		put(plc[i], i, 1);
	while (st.size()) {	
		int v = st.back();
		st.pop_back();
		if (com[v])
			continue;
		cnt++;
		put(plc[v], v, -1);
		rev(v);
	}
	for (int i = 2; i <= 2 * n + 1; i++) 
		if (com[i] == com[i ^ 1]) {
			return 0;
		}
	return 1;
}
 
int main() {
	makefast;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> x[2 * i] >> x[2 * i + 1];
		vec.push_back({x[2 * i], 2 * i});
		vec.push_back({x[2 * i + 1], 2 * i + 1});
	}
	sort (vec.begin(), vec.end());
	for (int i = 0; i < vec.size(); i++) {
		plc[vec[i].second] = i;
	}
	int l = -1, r = 1e9 + 1;
	while (r - l > 1) {
		d = (l + r) / 2;
		if (can())
			l = d;
		else
			r = d;
	}
	cout << l + 1;
}



Measured memory_bytes: 6672
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
    int A,B,C;
    cin>>A>>B>>C;
    if(A==5&&B==5&&C==7||
       A==7&&B==5&&C==5||
       A==5&&B==7&&C==5) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin >> S;
    vector<int> freq(3, 0);
    for (auto c : S){
        if (c == 'a') ++freq[0];
        if (c == 'b') ++freq[1];
        if (c == 'c') ++freq[2];
    }
    if (freq[0] == 1 and freq[1] == 1 and freq[2] == 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

int main() {
  int n,k;
  cin >> n >> k;
  int one = 0;
  for(int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if(a == 1) one = i;
  }

  double ans = 1e9;
  for(int i = 0; i < k; i++) {
    int l = one + i - k + 1;
    int r = one + i;
    if(l < 0) l = 0;
    if(r > n) r = n-1;
    //  cout << l <<"   "<<r<<endl;
    ans = min(ans,ceil(l / (double)(k-1)) + ceil((n - r - 1) / (double)(k-1))+(double)1);
  }
  cout << ans << endl;

  
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void)
{
  int apple       = 0;
  int apple_block = 0;
  int apple_pie   = 0;

  cin >> apple;
  cin >> apple_block;

  apple_pie = ((3 * apple) + apple_block) / 2;

  cout << apple_pie << endl;

  return 0;
}

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){fill((T*)array,(T*)(array+N),val);}

template<typename T>
T SUM(V<T> v, T init_val=0){return accumulate(ALL(v),T(init_val));}

int dp[10005];
int main(){
    int h,n;
    cin>>h>>n;
    Vi a(n),b(n);
    REP(i,n) cin>>a[i]>>b[i];

    FILL(dp,-1);
    dp[0] = 0;
    REP(i,h+1){
        if(dp[i]<0) continue;
        REP(j,n){
            int ind = min(h,i+a[j]);
            if(dp[ind]<0) dp[ind] = dp[i]+b[j];
            else dp[ind] = min(dp[ind],dp[i]+b[j]);
        }
    }

    cout<<dp[h]<<endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
double weight;
while((line=br.readLine())!=null){
weight=Double.parseDouble(line);
classOfBoxing(weight);
System.out.println("");
}
}
private static void classOfBoxing(double n){
if(n<=48.00){
System.out.print("light fly");
}
else if(n<=51.00){
System.out.print("fly");
}
else if(n<=54.00){
System.out.print("bantam");
}
else if(n<=57.00){
System.out.print("feather");
}
else if(n<=60.00){
System.out.print("light");
}
else if(n<=64.00){
System.out.print("light welter");
}
else if(n<=69.00){
System.out.print("welter");
}
else if(n<=75.00){
System.out.print("light middle");
}
else if(n<=81.00){
System.out.print("middle");
}
else if(n<=91.00){
System.out.print("light heavy");
}
else{
System.out.print("heavy");
}
}
}

Measured memory_bytes: 16900
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


ll calc(ll x,ll y){
	if(y == 0){
		return x;
	}else{
		return calc(y,x%y);
	}
}

int N;
ll day_len[100],now_t[100],access[100][24];
ll table1[60000],table2[100000];



void func(){



	ll cicle1 = 1,cicle2 = 1,common;

	for(int i = 0; i < N; i++){
		scanf("%lld %lld",&day_len[i],&now_t[i]);
		if(day_len[i] == 13 || day_len[i] == 17 || day_len[i] == 19 || day_len[i] == 23){
			if(cicle2 >= day_len[i]){
				common = calc(cicle2,day_len[i]);
			}else{
				common = calc(day_len[i],cicle2);
			}
			cicle2 = (cicle2*day_len[i])/common;
		}else{
			if(cicle1 >= day_len[i]){
				common = calc(cicle1,day_len[i]);
			}else{
				common = calc(day_len[i],cicle1);
			}
			cicle1 = (cicle1*day_len[i])/common;
		}

		for(int k = 0; k < day_len[i]; k++)scanf("%d",&access[i][k]);
	}

	for(int i = 0; i < cicle1; i++)table1[i] = 0;
	for(int i = 0; i < cicle2; i++)table2[i] = 0;

	for(int i = 0; i < N; i++){
		if(day_len[i] == 13 || day_len[i] == 17 || day_len[i] == 19 || day_len[i] == 23){
			for(int k = 0; k < cicle2; k++){
				table2[k] += access[i][(now_t[i]+k)%day_len[i]];
			}
		}else{
			for(int k = 0; k < cicle1; k++){
				table1[k] +=  access[i][(now_t[i]+k)%day_len[i]];
			}
		}
	}

	ll maximum1 = 0,maximum2 = 0;
	for(int k = 0; k < cicle1; k++)maximum1 = max(maximum1,table1[k]);
	for(int k = 0; k < cicle2; k++)maximum2 = max(maximum2,table2[k]);

	printf("%lld\n",maximum1+maximum2);

}


int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

Measured memory_bytes: 4312
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;

typedef long long ll;
typedef pair < ll , ll > ii;

ll a,b,c,d,tum,ci,art,son,ort;

ll gcd(ll x, ll y){
  if(!y)
    return x;
  return gcd(y, x % y);
}

ll lcm(ll a, ll b){
  return a / gcd(a,b) * b;
}


int main() {
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
	cin >> a >> b >> c >> d;

	tum = max(a,b);
	ll mn = min(a,b) - 1;
  ci += tum/c;
  ci += tum/d;

  art += mn/c;
  art += mn/d;

  ort = tum / lcm(c,d);
  ort -= mn / lcm(c,d);
	cout << (tum - mn) + art - ci + ort;
	return 0;
}


Measured memory_bytes: 256
L, R = map(int, input().split())
MOD = 2019

ld = L // MOD
rd = R // MOD

ans = 0
if ld != rd:
    ans = 0
else:
    ans = 100000000
    lm = L % MOD
    rm = R % MOD
    for i in range(lm, rm):
        for j in range(lm+1, rm+1):
            v = (i * j) % MOD
            if v < ans:
                ans = v

print(ans)

Measured memory_bytes: 3064
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    n: usize,
    c: Chars
    }
    let (mut s, mut t) = (0, n - 1);
    let mut ans = 0;
    while s < t {
        if c[s] == 'W' {
            if c[t] == 'R' {
                ans += 1;
                s += 1;
                t -= 1;
            }
            else {
                t -= 1;
            }
        } else {
            s += 1;
        }
    }
    println!("{}", ans);
}


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

using namespace std;
const char *s2 = "YAKI";
int _wno;

int main() {
	char s[20] = {0};
	_wno = scanf( "%s", s );
	bool flag = true;
	for( int i = 0; i < 4; ++i )
		if( s[i] != s2[i] ) flag = false;
	puts( flag ? "Yes" : "No" );
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
string s;
int a[2019],A,b[2019],ans;
int main(void){
    cin>>s;
    for(int i=0;i<s.size();i++){
        //cout<<i<<"I"<<endl;
        a[0]++;
        A=s[i]-'0';
        for(int j=0;j<2019;j++){
            if(a[j]>0){
                //cout<<j<<" "<<(j*10+A)<<" "<<ans<<endl;
                b[(j*10+A)%2019]+=a[j];
            }
        }
        for(int j=0;j<2019;j++){
            a[j]=b[j];
            b[j]=0;
        }
        ans+=a[0];
    }
    cout<<ans<<endl;
}


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

template<typename First, typename Second, typename Third>
struct triple {
   First first;
   Second second;
   Third third;
};
using namespace std;
void solve(){
    int b;
    cin>>b;
     int c=0;
     int mx=0;
    for(int i=0;i<b;i++){
       int u;
cin>>u;
    if(u>=mx){
      mx=u;
     }
    else 
        c++;
}
cout<<b-c;
}

int main(){
    std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include <map>  
#include <string.h>
#include <math.h>

using namespace std;

int n, m, t;

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

	t = 1900 * m + 100 * (n - m);

	cout << t*(1 / pow(0.5, m)) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int dp[105][100005],a[105],n,k;
const int MOD=1e9+7;
int main()
{
	cin>>n>>k;
	for(int i=0;i<n;i++)
		cin>>a[i];
	for(int i=0;i<=a[0];i++)
		dp[0][i]=1;
	for(int i=1;i<n;i++)
	{
		vector<int>vec(k+1);
		vec[0]=dp[i-1][0];
		for(int j=1;j<k+1;j++)
			vec[j]=(vec[j-1]+dp[i-1][j])%MOD;
		for(int j=0;j<k+1;j++)
		{
			if(j>a[i])
				dp[i][j]=(vec[j]+MOD-vec[j-a[i]-1])%MOD;
			else
				dp[i][j]=vec[j];
		}
	}
	cout<<dp[n-1][k];
	return 0;
}

Measured memory_bytes: 42948
N, K = map(int, input().split())

pow2 = [2**i for i in range(50)]
#print(pow2[-1])
ans = 0

for i in range(1,N+1):
    for j in range(len(pow2)):
        if K <= i*pow2[j]:
            #print(j)
            ans += 1/pow2[j]
            break
ans *= (1/N)
print(ans)


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

int main(void){
    int N,sum=0;
    cin>>N;
    int L[N];

    for(int i=0;i<N;i++)
        cin>>L[i];

    sort(L,L+N);
    for(int i=0;i<N-1;i++){
        sum+=L[i];
    }
    if(sum>L[N-1])
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


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

using namespace std;

int mp[400][400];
int vis[400];


int n, m;


int slove() {
    int cnt[350];
    memset(cnt, 0, sizeof(cnt));
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (!vis[mp[i][j]]) {
                cnt[mp[i][j]]++;
                break;
            }
        }
    }
    int maxx = 0, pos = 0;
    for (int i = 1; i <= m; i++) {
        if (cnt[i] > maxx) {
            maxx = cnt[i];
            pos = i;
        }
    }
    return pos;
}

int main() {
    int H, W, h, w;
    cin >> H >> W >> h >> w;
    int ans = H * W;
    ans -= h * W;
    ans -= w * H;
    ans += h * w;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using P     = pair<ll, ll>;
const ll mod= 1e9 + 7;
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for(ll(i)= 0; (i) < (n); (i)++)
#define REPS(i, n) for(ll(i)= 1; (i) <= (n); (i)++)
#define RREP(i, n) for(ll(i)= (n - 1); (i) >= 0; (i)--)
#define RREPS(i, n) for(ll(i)= (n); (i) > 0; (i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());

template <class T>
inline void chmin(T& a, T b) {
    if(a > b) { a= b; }
}

template <class T>
inline void chmax(T& a, T b) {
    if(a < b) { a= b; }
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    int A, B;
    cin >> A >> B;
    if(A == B) {
        cout << "Draw"
             << "\n";
    } else if(A == 1) {
        cout << "Alice"
             << "\n";
    } else if(B == 1) {
        cout << "Bob"
             << "\n";
    } else if(A > B) {
        cout << "Alice"
             << "\n";
    } else {
        cout << "Bob" << "\n";
    }
}

Measured memory_bytes: 3616
h,w,k=map(int,input().split());p=[sum(('11'in str(bin(j)))^1for j in range(1<<i))for i in range(8)];d=[w*[0]for _ in[0]*-~h];d[0][0]=1
for i in range(h):
 b=d[i]
 for j in range(w):
  t=u=D=0
  if j:t=p[max(0,j-2)]*p[max(0,w-j-2)];D=b[j-1]*t
  if j<w-1:u=p[max(0,j-1)]*p[max(0,w-j-3)];D+=b[j+1]*u
  d[i+1][j]=(b[j]*(p[w-1]-t-u)+D)%(10**9+7)
print(d[-1][k-1])

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

#define all(x) (x).begin(),(x).end()
#define fastio ios_base::sync_with_stdio(false)

typedef double db;
typedef long long ll;
typedef unsigned long long ull;

typedef long double ldb;
typedef pair <int,int> pii;
typedef pair <ll, ll> pll;

int main() {
	fastio;
	string s; cin >> s;
	if(s[0] == '7' or s[1] == '7' or s[2] == '7')
		cout << "Yes\n";
	else
		cout << "No\n";
	return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define F first
#define S second
//cout<<fixed<<setprecision(11);
const string nl="\n";
const ll MOD=1e9+7;
const ll ARR_MAX = 1e5+1;
const ll VAL_MAX = 1e5+1;
const ll INF=1e14;

void solve(){
    int x,y,z;cin>>x>>y>>z;
    if(x+y+z>=22){
    	cout<<"bust";
    }
    else{
    	cout<<"win";
    }
}

int main(){
    fastio();
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int c, i, y;
	
	while (scanf("%d", &c) != EOF){
		
		c = c % 39;
		
				
		for (i = 0; i < c; i++){
		}
		
		if (i == 0){
			i = 39;
		}
			
			
		if (i < 10){
			printf("3C0%d\n", i);
		}
		else{
			printf("3C%d\n", i);
		}
	}
	return (0);
}
			
			

Measured memory_bytes: 596
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 1
if 0 in a:
    print(0)
else:
    while ans<10**18 and i < len(a):
        ans*=a[i]
        i+=1
    if ans<=10**18:
        print(ans)
    else:
        print(-1)

Measured memory_bytes: 21652
a = input()
a1 = int(a[:2])
a2 = int(a[2:])

if a1 <= 12 and a2 <= 12 and a1 >= 1 and a2 >= 1:
    print('AMBIGUOUS')
elif a1 <= 12 and a1 >= 1:
    print('MMYY')
elif a2 <= 12 and a2 >= 1:
    print('YYMM')
else:
    print('NA')


Measured memory_bytes: 2940
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF (1LL<<60)
#define MOD 1000000007
#define double long double

int N;
long long X[100000], R[100000];

double f(double p) {
  double h = 1e20;
  rep(i, N) {
    double d = abs(X[i] - p);
    h = min(h, R[i]*R[i] - d*d);
  }
  return sqrt(h);
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  long long l = -INF, r = INF;
  rep(i, N) {
    cin >> X[i] >> R[i];
    l = max(l, 0LL+X[i]-R[i]);
    r = min(r, 0LL+X[i]+R[i]);
  }
  if (l >= r) {
    cout << "0.0" << "\n";
    return 0;
  }
  double lo = l, hi = r;
  rep(_, 300) {
    double a = (lo + lo + hi) / 3;
    double b = (lo + hi + hi) / 3;
    if (f(a) >= f(b)) hi = b;
    else lo = a;
  }
  cout << fixed << setprecision(20) << f(hi) << "\n";
  return 0;
}

Measured memory_bytes: 4812
#include<iostream>
#include<vector>

using namespace std;

void a(){
    int S,W;
    cin >> S >> W;
    if(W<S){
        cout << "safe"; 
    }
    else{
        cout << "unsafe";
    }
}

void b(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int T = a/d;
    if (a%d!=0)T++;
    int A = c/b;
    if (c%b!=0)A++;
    if(A>T)
    {
        cout << "No";
    }
    else cout << "Yes";
}
int main(void){
    a();
    //b();
}

Measured memory_bytes: 3624