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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

int main(){
#define int ll
  int a,b; cin >> a >> b;
  if(a+b==15) cout << "+";
  else if(a*b==15) cout << "*";
  else cout << "x";
  cout << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
        int N;
        int j1, j2;

        scanf("%d", &N);
        j1 = (int)(N / 10);
        j2 = (int)(N - j1 * 10);
        if(j1 == 9)
                printf("Yes");
        else if(j2 == 9)
                printf("Yes");
        else
                printf("No");

        return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define bra(first, second) '(' << first << ',' << second << ')'
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 1001001001001001001;
long double EPS = 1e-9;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index)
{
   vector.erase(vector.begin() + index);
}

using Graph = vector<vector<tuple<ll, ll, ll>>>;

// MOD確認

int main(){
   ll N;
   cin >> N;
   rep(i,11){
      if(i * 1000 >= N){
         cout << i * 1000 - N << endl;
         return 0;
      }
   } 
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
vector<pii> vp;
bool cmp(pii a, pii b)
{
    return a.first > b.first;
}
int main()
{
    int x, y, a, b, c, t;
    scanf("%d%d%d%d%d", &x, &y, &a, &b, &c);
    for (int i = 1; i <= a; ++i)
    {
        scanf("%d", &t);
        vp.push_back(make_pair(t, 1));
    }
    for (int i = 1; i <= b; ++i)
    {
        scanf("%d", &t);
        vp.push_back(make_pair(t, 2));
    }
    for (int i = 1; i <= c; ++i)
    {
        scanf("%d", &t);
        vp.push_back(make_pair(t, 3));
    }
    sort(vp.begin(), vp.end(), cmp);
    ull ans = 0;
    int cnta = 0, cntb = 0, cnt = 0;
    for (int i = 0; i < a + b + c; ++i)
    {
        if (vp[i].second == 1)
        {
            if (cnta >= x)
                continue;
            cnta++;
        }
        if (vp[i].second == 2)
        {
            if (cntb >= y)
                continue;
            cntb++;
        }
        cnt++;
        ans += vp[i].first;
        if (cnt == x + y)
            break;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6000
#include<iostream>
#include<algorithm>

using namespace std;

int c[1000100];

int main()
{
  int n;
  
  cin >> n;
  
  int a[n];

      for(int i=0;i<n;i++) cin >> a[i]; 
  for(int i=0;i<n;i++)
  {
          if(c[a[i]])
      {
        c[a[i]]=2;
            continue;
      }
    
    for(int j = a[i];j<=1000000; j+=a[i])
    {

      c[j]++;
    }
  }

  int ans = 0;
  
  for(int i=0;i<n;i++)
  {
    if(c[a[i]] <= 1) ans++;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 8236
#include <iostream>
#include <string>
#include <vector>
typedef unsigned int UINT;
using namespace std;

bool isEverNumber(int  number)
{
    if (number % 2 == 0)
        return true;
    else
        return false;
}

//積が奇数なら Odd と、 偶数なら Even と出力せよ。
int main(void) {
    int A, B;
    cin >> A >>B;

    if (isEverNumber(A*B))
        cout << "Even" << endl;
    else
        cout << "Odd\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		int t=a[0];
		long sum=0;
		for(int i=1;i<n;i++){
			if(t>a[i])
				sum=sum+(t-a[i]);
			else {
				t=a[i];
				continue;
			}
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 60224
#include<stdio.h>
#define N 200000 

int main(void){
int Rt[N], RMAX = 0, RANS = 0, R;
int n, s;
int i, j, k = -1;

scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d", &s);
Rt[i] = s;
}	
	RANS = Rt[1] - Rt[0];
for( i = 0; i < n-1; i++){
	RMAX = Rt[i + 1];
		if (k < i){
for( j = i + 1; j < n; j++){
	if( Rt[j] > RMAX) {
		RMAX = Rt[j];
		k = j;
}
		}
		}
			else RMAX = Rt[k];
	R = RMAX - Rt[i] ;
	if(RANS < R)RANS = R;
}
printf("%d\n", RANS);



return 0;
}

Measured memory_bytes: 2492
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());;
        int answer = a-2*b;
        if (answer >= 0) {
            System.out.println(answer);
        } else {
            System.out.println(0);
        } 

    }
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X,i) ((X>>i)&1)
#define REP(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define r_all(a) (a).rbegin(), (a).rend()
#define ina(x,n) rep(x_i,n) cin>>x[x_i]
#define outa(x,n) rep(x_i,n) cerr<<x[x_i]<<" \n"[x_i==n-1]

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vll;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = (1<<28);
const ll INFL = (1LL<<61);

int main() {
  int n; cin >> n;
  vl a(n); ina(a,n);
  bool ok = false;

  int ans = 0, now = 1;
  rep(i,n) {
    if (a[i] == 1) ok = true;
    if (a[i] != now) {
      ans++;
    } else {
      now++;
    }
  }
  if (ok) {
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }

  return 0;
}


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

using namespace std;

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

	int H, W;
	int result;

	cin >> H >> W;

	int h, w;

	cin >> h >> w;

	H -= h;
	W -= w;

	cout << H * W;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int k;
	cin >> k;
	int64_t ans = 0;
	for (int a = 1; a <= k; a++) {
		for (int b = 1; b <= k; b++) {
			for (int c = 1; c <= k; c++) {
				int start = min({a,b,c});
				int gcd = 1;
				for (int i = start; i > 0; i--) {
					if (a % i == 0 && b % i == 0 && c % i == 0) {
						gcd = i;
						break;
					}
				}
				ans += gcd;
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const int maxn=1e5+100;
int r;
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0);
    cin>>r;
    if(r<1200)cout<<"ABC\n";
    else if(r<2800)cout<<"ARC\n";
    else cout<<"AGC\n";
    return 0;
}


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

int main() {
	long long  a, b, x;
	cin >> a >> b >> x;
	
	long long A, B, ans;
	A = a / x;
	B = b / x;
	ans = B - A;
	if (a%x == 0) {
		ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  int a,b,c,x,y,cnt=0,tmp;
  cin >> a >> b >> c >> x >> y;
  c*=2;
  if(a+b>c){
    cnt+=min(x,y)*c;
    tmp=min(x,y);
    x-=tmp;
    y-=tmp;
    if(x){
      cnt+=min(a,c)*x;
    }
    else cnt+=min(b,c)*y;
  }
  else{
    cnt+=a*x+b*y;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int W , H , x , y;
  scanf("%d%d%d%d",&W,&H,&x,&y);
  printf("%.10f ",1LL*W*1.0*H/2.0);
  if(W/2.0 == x && H/2.0 == y)
  {
    puts("1");
  }
  else puts("0");
}

Measured memory_bytes: 256
#[doc = " https://github.com/hatoo/competitive-rust-snippets"]
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ;; ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( $ t : ty ;; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ;; ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
fn solve() {
    let k = get!(usize);
    println!("{}", k / 2 * (k / 2 + k % 2));
}


Measured memory_bytes: 8572
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <cassert>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;

    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;

    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

void solve() {
    int64_t n, k;
    cin >> n >> k;
    vector<int64_t> vec(n);
    for (int i = 0; i < n; ++i) {
        cin >> vec[i];
    }
    sort(vec.begin(), vec.end());
    int64_t left = -LINF, right = LINF;
    while (right - left > 1) {
     //   cerr << left << ' ' << right << '\n';
        int64_t mid = (left + right) / 2;
        int64_t cnt = 0;
        for (int i = 0; i < n; ++i) {
            int64_t el = vec[i];
            if (el == 0) {
                cnt += (mid >= 0) * (n - 1);
                continue;
            }
            int64_t bnd;
            int els;
            if (mid < 0 && el < 0) {
                bnd = (mid + el + 1) / el;
                auto it = lower_bound(vec.begin(), vec.end(), bnd);
                els = vec.end() - it;
            } else if (mid < 0 && el > 0) {
                bnd = (mid - el + 1) / el;
                auto it = upper_bound(vec.begin(), vec.end(), bnd);
                els = it - vec.begin();
            } else if (mid >= 0 && el < 0) {
                bnd = mid / el;
                auto it = lower_bound(vec.begin(), vec.end(), bnd);
                els = vec.end() - it;
            } else if (mid >= 0 && el > 0) {
                bnd = mid / el;
                auto it = upper_bound(vec.begin(), vec.end(), bnd);
                els = it - vec.begin();
            }
            els -= (el * el <= mid);
            cnt += els;
        }
     //   cerr << mid << ' ' << cnt << '\n';
        assert(cnt % 2 == 0);
        cnt /= 2;
        if (cnt >= k) {
            right = mid;
        } else {
            left = mid;
        }
    }
    cout << right << '\n';
}

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

    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define rep(i,n) for(int i=0;i<(int)(n);i++)
static const int mod = 1e9+7;
static const long long INF = 1LL << 60;
typedef long long ll;
int main(){
    int N;
    cin >> N;
    vector<ll> h(N);
    rep(i,N) cin >> h[i];
    vector<ll> dp(100010);
    rep(i,100010){
        dp[i] = INF;
    }
    dp[0] = 0;
    for(int i = 1; i < N; i++){
        chmin(dp[i], dp[i-1]+abs(h[i]- h[i-1]));
        if(i > 1){
            chmin(dp[i], dp[i-2]+abs(h[i]-h[i-2]));
        }
    }
    cout << dp[N-1] << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF int(1e9+1)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define F(n) FOR(i,0,n)
#define FF(n) FOR(j,0,n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define MX (1<<17)
#define IS(A) ((cn[A>>6]>>(A&63))&1)
#define ST(A) (cn[A>>6]|=1ULL<<((A&63)))
ll P[MX>>1]={2},L(1),cn[1+(MX>>6)];
void gen(){
    ST(0),ST(1);
    int Q(1+sqrt(MX));
    for(ll i(4);i<MX;i+=2)ST(i);
    for(int k(3);k<=Q;k+=2)if(!IS(k))
        for(ll h(k<<1),j(k*k);j<MX;j+=h)ST(j);
    for(int i(3);i<MX;i+=2)if(!IS(i))P[L++]=i;
}
int S[MX],a,b;
int main(void){
    gen();
    F(MX)if(!IS(i)&&!IS(((i+1)/2)))S[i]=1;
    FT(1,MX)S[k]+=S[k-1];
    IN(_)F(_)scanf("%d%d",&a,&b),printf("%d\n",S[b]-S[--a]);
    return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
int arr[1000004];
void sieve()
{

    for(int i=1;i<=1000000;i++)
        arr[i]=i;
        for(int i=2;i<=1000000;i+=2)
        arr[i]=2;
        arr[1]=1;
    for(int i=3;i*i<=1000000;i+=2)
    {
        if(arr[i]==i)
        {
            arr[i]=i;
            for(int j=i*i;j<=1000000;j+=i)
            {
                arr[j]=i;
            }
        }
    }



}

int get_divisor(int x)
{
    map<int,int>mp;
    int mul=1;
    while(x!=1)
    {
        int l=arr[x];
        while(x%l==0)
        {

          x/=l;
           mp[l]++;
            if(x==1)
                break;


        }



    }
    for(auto it=mp.begin();it!=mp.end();it++)
    {

       if(it->first!=1)
    mul=mul*(it->second+1);
    }
    return mul;





}


int main()
{
    int a,b,c,d,e;
    cin >> a;
    sieve();
    long long sum=0;
    for(int i=2;i<a;i++)
    {

        sum+=(get_divisor(i));
    }
    sum++;
    cout << sum << endl;




}


Measured memory_bytes: 7488
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REPR(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define FOR(i, n, m) for (ll i = (n); i < (m); ++i)
#define FORR(i, n, m) for (ll i = (m) - 1; i >= (n); --i) 
#define FORE(x, xs) for (auto &x: (xs))
#define ALL(v) v.begin(), v.end()
#define ZERO(a) memset(a,0,sizeof(a))

const int INF = 1000000009;
const int MOD = 1000000007;
const double EPS = 1e-14;
const double PI = acos(-1);

const int MAX = 2e5;

ll N;

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

  REP (i, N) cin >> a[i];

  ll ans = 0;
  REP (i, N-1) {
    ans += a[i]/2;
    a[i] %= 2;
    if (a[i] > 0 && a[i+1] > 0) {
      ans += 1;
      a[i+1]--;
    }
  }
  ans += a[N-1]/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
const int maxn = 10000;
const int INF32 = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7 = 1'000'000'007;
const int MOD9 = 1'000'000'009;
const int mod = MOD7;

void ERROR(int num) { printf("ERROR%d!\n",num); }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};


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

    int N, K;
    cin >> N >> K;
    vector<ll> H;
    H.resize(N);
    rep(i,N) cin >> H[i];

    sort(H.begin(), H.end(), greater<ll>());
    if(K >= N) cout << 0 << endl;
    else{
      ll total = 0;
      for(int i = K; i < N; i++) total += H[i];
      cout << total << endl;
    } 
}

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

flg = 0
for i in range(n):
    if a[i - 1] % 2 == 0:
        if (a[i - 1] % 3 == 0) or (a[i - 1] % 5 == 0):
            continue
        else:
            flg += 1
if flg > 0:
    print("DENIED")
else:
    print("APPROVED")


Measured memory_bytes: 38256
/**
 *      purpose : 
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <fstream>
#include <iostream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstring>
#include <chrono>
#include <functional>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = long long;
using uint64 = unsigned long long;
using vi = std::vector<int>;
using vl = std::vector<int64>;
using pii = std::pair<int, int>;
using pii = std::pair<int, int>;
using pll = std::pair<int64, int64>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(_) (_).begin(), (_).end()
#define rall(_) (_).rbegin(), (_).rend()
#define print(_) std::cout << (_) << '\n'
#define debug(_) std::cerr << #_ << ": " << (_) << '\n'
#define dbg(vec) for (size_t _ = 0; _ < vec.size(); ++_){std::cerr << #vec << "[" << _ << "] : " << vec[_] << '\n';}
// variadic template
template<typename T> inline void chmin(T &a, T b) {if (a > b) a = b; return;}
template<typename T> inline void chmax(T &a, T b) {if (a < b) a = b; return;}
// constant
const int INF = (1<<30) - 1;  // 1.073741823e9
const int64 INF64 = (1LL<<62) - 1;  // 4.611686018427387903e18
const int MOD = 1000000007;

const double pi = 3.141592653589793;
vector<double> x(101), y(101);
int n; 

inline double naiseki(const double& x1, const double& y1, const double& x2, const double& y2) {
  return x1 * x2 + y1 * y2;
}

// 角度 theta の方向を最終的に向くとして計算
// theta は radian
double calc(const double& theta) {
  double res = 0.0;
  double dx = cos(theta), dy = sin(theta);
  for (int i = 0; i < n; ++i) {
    res += max(0.0, naiseki(dx, dy, x[i], y[i]));
  }
  return res;
}

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

  auto start = chrono::system_clock::now();

  cin >> n;
  rep(i, n) cin >> x[i] >> y[i];

  int step = 777777;

  double ans = 0.0;

  random_device rnd;
  mt19937 mt(rnd());
  uniform_int_distribution<> r(0, step);

  auto msec = 0.0;

  do {
    double theta = 2.0 * pi * r(mt) / step;
    chmax(ans, calc(theta));
    auto end = chrono::system_clock::now();
    auto dur = end - start;
    msec = chrono::duration_cast<chrono::milliseconds>(dur).count();
  } while (msec <= 998);

  cout << setprecision(15) << ans << '\n';

  return 0;
}


Measured memory_bytes: 384
#include <iostream>

using namespace std;

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

    int N, sum = 0;
    cin >> N;
    int V[20], C[20];

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

    for (int i = 0; i < N; i++) {
        int X_Y = V[i] - C[i];
        if (X_Y > 0) sum += X_Y;
    }

    cout << sum << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  string S;
  cin >> S;

  int ans = 0;
  int N = S.size();
  rep(i,N){
    if (S.at(i) != S.at(N - 1 - i)){
      ans++;
      S.at(i) = S.at(N - 1 - i);
    }
  }
  cout << ans << endl;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> maze(n);
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    maze.at(a).push_back(b);
    maze.at(b).push_back(a);
  }

  // 幅優先探索
  // 道標の記録も必要
  queue<int> q;
  vector<int> sign(n, -1);

  q.push(0);
  sign.at(0) = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int u : maze.at(x)) {
      if (sign.at(u) != -1) continue;
      q.push(u);
      sign.at(u) = x;
    }
  }

  cout << "Yes" << endl;
  for (int i = 1; i < n; i++) {
    cout << sign.at(i) + 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 10176
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define ll long long

int main() {
	int n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	string s;
	cin >> s;
	a--;
	b--;
	c--;
	d--;
	if (s[c] == '#' || s[d] == '#')
		return cout << "No", 0;
	if (c == d)
		return cout << "No", 0;
	if (d > c) {
		for (int i = a; i < d; i++) {
			if (s[i] == '#' && s[i + 1] == '#')
				return cout << "No", 0;
		}
		cout << "Yes\n";
	} else if (d < c) {
		for (int i = a; i < c; i++) {
			if (s[i] == '#' && s[i + 1] == '#')
				return cout << "No", 0;
		}
		for (int i = b-1; i < d; i++) {
			if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.') {
				return cout << "Yes", 0;
			}
		}
		cout << "No";
	}
}


Measured memory_bytes: 3760
# https://atcoder.jp/contests/abc099/tasks/abc099_c

def main():
    max_val = 10**5 + 1
    dp = [i for i in range(max_val)]

    for i in range(max_val):
        p = 1
        while p < max_val:
            dp[i] = min(dp[i], dp[i - p] + 1)
            p *= 6
        p = 1
        while p < max_val:
            dp[i] = min(dp[i], dp[i - p] + 1)
            p *= 9

    N = int(input())
    print(dp[N])


if __name__ == '__main__':
    main()


Measured memory_bytes: 7064
#include<iostream>
#include<algorithm>
using namespace std;
using ll = long long;

int main() {
    ll n,x,a,l,r,cost = 0; 
    cin >> n >> x;
    r = x;
    for (int i=0;i<n;i++) {
        cin >> a;
        l = min(r,a);
        cost+=a-l;
        r = x-l;
    }
    cout << cost << endl;
    return 0;
}

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

using namespace std;

#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<ll, ll>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for(auto &z: v)
#define sps << ' '
#define sp << ' ' << 
# define M_PI   3.14159265358979323846
#define nl "\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353
ll u, r, l, d;

bool check(ll x, ll y){
  if(x >= l and x <= r and y >= u and y <= d) return false;
  else return true;
}

int main()
{
  boost;
  ll tt = 1, n, k, i, j, a;

  // cin >> tt;

  for(int _ = 1; _ <= tt; _++){
    // cout << "Case #" << _ << ": ";
    cin >> n >> k;
    
    vi pref(n + 2, 0);
    for(i = 0; i <= n; i++){
      pref[i + 1] = (pref[i] + i);
    }

    ll ans = 0LL;
    for(i = k; i <= n + 1; i++){
      ll total = (pref[n + 1] - pref[n - i + 1]) - pref[i] + 1;
      ans = (ans + total)%fat;
    }
    cout << ans << nl;
  }

  return 0;
}

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

#define NREP() for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
using ll = long long;
const static ll MOD = 1e9 + 7;

int main(int argc, char *argv[]){
    ll k, x;
    cin >> k >> x;

    for (ll i = x-k+1; i<= x+k-1; i++) {
        cout << i << " ";
    }
    cout << endl;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using PLL = pair<LL,LL>;
using VPI = vector<PII>;
using VPL = vector<PLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
	//i=m -> n-1(昇順)
#define RREP(i,m,n) for(int i=(m);i>=(n);i--)
	//i=m -> n(降順)

int main(){
  string s;
  cin >> s;
  VI a(4);
  REP(i,0,4){
    a[i] = s[i] - '0';
  }
  
  if(a[0]+a[1]+a[2]+a[3] == 7){
    cout << a[0] << "+" << a[1] << "+" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]+a[2]-a[3] == 7){
    cout << a[0] << "+" << a[1] << "+" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]-a[2]+a[3] == 7){
    cout << a[0] << "+" << a[1] << "-" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]-a[2]-a[3] == 7){
    cout << a[0] << "+" << a[1] << "-" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]+a[2]+a[3] == 7){
    cout << a[0] << "-" << a[1] << "+" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]+a[2]-a[3] == 7){
    cout << a[0] << "-" << a[1] << "+" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]-a[2]+a[3] == 7){
    cout << a[0] << "-" << a[1] << "-" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  
  return 0;
}


Measured memory_bytes: 3636
x,y = map(int,input().split())
ans = []
blank = ['#' for _ in range(y+2)]

ans.append(blank)
for _ in range(x):
    l =['#'] + list(input()) +['#']
    ans.append(l)
ans.append(blank)

for x in ans:
    for y in x:
        print(y,end='')
    print()


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

void print(const vector<int> &A) {
    for (int i = 0; i < (int)A.size(); i++) {
        cout << A[i] << ((i+1==A.size())?"\n":" ");
    }
}

void insertionSort (vector<int> &A) {
    int N = A.size();
    for (int i = 1; i < N; i++) {
        print(A);
        int v = A[i], j = i-1;
        while (j >= 0 && A[j] > v) {
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
    }
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    insertionSort(A);
    print(A);
}
    


Measured memory_bytes: 3100
# -*- coding: utf-8 -*-
import math
a, b, x = map(int, input().split())
if x <= a*a*b/2: print(90 - math.degrees(math.atan(2*x/(a*b*b))))
elif x == a*a*b: print('0')
else: print(90 - math.degrees(math.atan(a**3/(2*(a*a*b-x)))))

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

int N;
long long W, weight[110], value[110];

long long dp[110][100010] = {0};

int main(){
    int N,W; cin >> N >> W;
    for (int i = 0; i < N; i++) cin >> weight[i] >> value[i];

    for (int i = 0; i < N; i++){
        for (int sum = 0; sum <= W; sum++){
            if(sum - weight[i] >= 0){
                dp[i+1][sum] = 
                    (dp[i+1][sum] > dp[i][sum - weight[i]]+ value[i])?
                        dp[i+1][sum]: 
                        dp[i][sum - weight[i]]+ value[i];
            }
            dp[i+1][sum] = 
                (dp[i+1][sum] > dp[i][sum])?
                    dp[i+1][sum]:
                    dp[i][sum];
        }
    }

    cout << dp[N][W] << endl;
    return 0;
}


Measured memory_bytes: 79360
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){

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

  double ans = 0;
  rep(i,N) ans += 1.0/a[i];
  ans = 1.0/ans;
  cout<<ans<<setprecision(15)<<endl;
}


Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = Integer.parseInt(sc.next());
        int h = Integer.parseInt(sc.next());
        int n = Integer.parseInt(sc.next());
        int x[] = new int[n];
        int y[] = new int[n];
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(sc.next());
            y[i] = Integer.parseInt(sc.next());
            a[i] = Integer.parseInt(sc.next());
        }
        sc.close();
        int w0 = 0, h0 = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] == 1 && w0 < x[i]) {
                w0 = x[i];
            } else if (a[i] == 2 && w > x[i]) {
                w = x[i];
            } else if (a[i] == 3 && h0 < y[i]) {
                h0 = y[i];
            } else if (a[i] == 4 && h > y[i]) {
                h = y[i];
            }
        }
        if (w - w0 <= 0 || h - h0 <= 0) {
            System.out.println(0);
        } else {
            System.out.println((w - w0) * (h - h0));
        }
    }
}

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

int main() {
	string s;
	cin >> s;
	for (int i = 0;i < 4;i ++) cout << s[i];
	cout << ' ';
	for (int i = 4;i < 12;i ++) cout << s[i];
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())

def get_val(a, b):
    for i in range(10):
        x = (a >> i) % 2
        y = (b >> i) % 2
        if x != y:
            return (i + 1)

for i in range(1, n):
    print(*[get_val(i,j) for j in range(i + 1, n + 1)])


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

namespace HABIT{
    #define f(a,b,c,d) for(register int a=b,c=d;a<=c;a++)
    #define g(a,b,c,d) for(register int a=b,c=d;a>=c;a--)
    #define LOCAL
    typedef int i32;
    typedef unsigned int u32;
    typedef long long int i64;
    typedef unsigned long long int u64;
    typedef pair<i32,i32> pii;
    const i32 MAXN=1e5+10;
    typedef i64 ar[MAXN];
    
    template<typename T> inline T Max(T a) { return a; }
    template<typename T,typename... Args> inline T Max(T a,Args... args){
        T b=Max(args...);
        return (a>b)?a:b;
    }
    template<typename T> inline T Min(T a) { return a; }
    template<typename T,typename... Args> inline T Min(T a,Args... args){
        T b=Min(args...);
        return (a<b)?a:b;
    }

    #ifdef LOCAL
        inline char gc() { return getchar(); }
    #else
        inline char gc() {
            static char s[1<<20|1]={0},*p1=s,*p2=s;
            return (p1==p2)&&(p2=(p1=s)+fread(s,1,1<<20,stdin),p1==p2)?EOF:*(p1++);
        }
    #endif
    inline i64 read(){
        register i64 ans=0;register char c=gc();register bool neg=0;
        while(c<48||c>57) neg^=!(c^'-'),c=gc();
        while(c>=48&&c<=57) ans=(ans<<3)+(ans<<1)+(c^48),c=gc();
        return neg?-ans:ans;
    }

    char Output_Ans[1<<20|1],*Output_Cur=Output_Ans;
    inline void output() { Output_Cur-=fwrite(Output_Ans,1,Output_Cur-Output_Ans,stdout); }
    inline void print(char c){
        if(Output_Cur-Output_Ans+1>>20) output();
        *(Output_Cur++)=c;
    }
    inline void print(char *s) { while(*s) print( *(s++) ); }
    inline void print(u64 x){
        if(!x) { print('0'); return ; }
        char buf[30]={0},*p=buf+28;
        while(x) *(p--)=x%10+48,x/=10;
        print(p+1);
    }
    inline void print(u32 x) { print( (u64)x ); }
    inline void print(i64 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
    inline void print(i32 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
}
using namespace HABIT;

i64 N;
ar A;

inline i64 ans(){
    if(N==0){
        if(A[0]==1)
            return 1;
        return -1;
    }
    else{
        if(A[0]==1)
            return -1;
    }

    i64 Sum=1,Now=1,Add=0;
    f(i,1,I,N) Add+=A[i];
    f(i,1,I,N){
        Now=Min(Now<<1,Add);
        Sum+=Now;
        Now-=A[i];
        Add-=A[i];
        if(Now<0)
            return -1;
    }
    if(Now==0) return Sum;
    return -1;
}

int main(){
    N=read();
    f(i,0,I,N) A[i]=read();
    print( ans() );
    output();
    return 0;
}

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

const int MAX_N = (int)1e5 + 5;

std::vector<bool> isPrime;

void sieve(int max){
  if(max + 1 > isPrime.size()) {     // resizeで要素数が減らないように
      isPrime.resize(max + 1, true); // isPrimeに必要な要素数を確保
  }
  isPrime[0] = false; // 0は素数ではない
  isPrime[1] = false; // 1は素数ではない

  for(int i = 2; i * i <= max; ++i) {
    if(isPrime[i]) {
      for(int j = 2; i * j <= max; ++j) {
        isPrime[i * j] = false;
      }
    }
  }
}

int accumedNumOfPrime[MAX_N];

int q;
int l[MAX_N], r[MAX_N];

int main(void){
  // Here your code !
  scanf("%d\n", &q);
  for (int i = 0; i < q; ++i) {
    scanf("%d %d", &l[i], &r[i]);
  }

  sieve(MAX_N);

  for (int i = 1; i < MAX_N; ++i) {
    if (isPrime[i] && isPrime[((i + 1) / 2)]) {
      accumedNumOfPrime[i] += 1;
    }
  }

  for (int i = 1; i < MAX_N; ++i) {
    accumedNumOfPrime[i] += accumedNumOfPrime[i - 1];
  }

  for (int i = 0; i < q; ++i) {
    printf("%d\n", accumedNumOfPrime[r[i]] - accumedNumOfPrime[l[i] - 1]);
    scanf("%d %d", &l[i], &r[i]);
  }

  return 0;
}

Measured memory_bytes: 1792
line = gets.split(' ').map(&:to_f)

A = line[0]
B = line[1]
H = line[2]
M = line[3]

pi = Math::PI
angle = 2 * pi * (((60 * H + M)/720) - M / 60)

print (A ** 2 + B ** 2 - 2 * A * B * Math.cos(angle)) ** 0.5

Measured memory_bytes: 14868
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a;i < b;i++)
#define rrep(i,a,b) for(int i = a;i >= b;i--)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << #x << ": " << x << endl;
typedef long long ll;
using namespace std;

//---------------------------------------------------------------------------------------------------

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

   int n,k;
   cin >> n >> k;
   cout << (n % k != 0 ? 1 : 0) << endl;

   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>

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

using ll = long long;
using namespace std;

constexpr int INF = 2147483647; // 2 * 1e9
constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	int ans = 0;
	REP(i, n){
		int l, r;
		cin >> l >> r;
		ans += r - l + 1;
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            foreach (var s in EnumerateInput()
                .Select(s => s.Split(' ')
                    .Select(int.Parse).Sum()
                    .ToString()
                    .Length))
            {
                Console.WriteLine(s);
            }
        }

        static IEnumerable<string> EnumerateInput()
        {
            var s = "";
            while ((s = Console.ReadLine()) != null)
            {
                yield return s;
            }
        }
    }
}

Measured memory_bytes: 5904
#pragma GCC optimize("O3")
    #pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize("Ofast")
    #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #include<bits/stdc++.h>
    #define int long long
    # define mo 1000000007
    using namespace std;
    #define goku ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    signed main(){
        goku
      int n,m;
      cin>>n>>m;
      int a[n];

      for(int i=0;i<n;i++)
      {
          cin>>a[i];
          a[i]/=2;
      }
      int gg = a[0],pp=a[0];
      for(int i=1;i<n;i++)
      {
          gg = __gcd(pp,a[i]);
          pp*=a[i];
          pp/=gg;
        //  cout<<pp<<" ";
          if(pp>m)
            break;
      }
   //   cout<<pp<<endl;
      if(pp>m)
        cout<<0;
      else
        {
            for(int i=0;i<n;i++)
            {
                int xx = pp/a[i];
                if(xx%2==0)
                {
                    cout<<0;
                    return 0;
                }
            }
            int zz = m/pp;
            zz = (zz+1)/2;
            cout<<zz;
        }
       return 0;
    }


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

int main(){
    string s;
    cin >> s;
    string ans;
    for (int i = 0; i<s.size();i++){
        if(s.at(i) == '0') ans += '0';
        if(s.at(i) == '1') ans += '1';
        if(s.at(i) == 'B' && ans.size() != 0) ans.erase(ans.size()-1);         
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import math
taxA, taxB= map(int,input().split())

minPriceA = math.ceil(taxA / 0.08)
maxPriceA = math.ceil((taxA + 1) / 0.08) 

minPriceB = math.ceil(taxB / 0.1)
maxPriceB = math.ceil((taxB + 1) / 0.1) 

minPrice = None
finish = False
for a in range(minPriceA, maxPriceA):
	for b in range(minPriceB, maxPriceB):
		if (a == b):
			minPrice = a
			finish = True
			break
	if (finish):
		break
if minPrice == None:
	print(-1)
else:
	print(minPrice)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#include <cctype>
#include <locale>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<long long,long long> Pll;
#define fout(num) cout << fixed << setprecision(20) << (num) << endl
//s[i]=tolower(s[i]); islower(s[i]); cout << tolower(s[i])はバグ
//vector<vector<ll>> dp(n,vector<ll>(n))
//exist x map o setconst ll MOD = 1e9+7;return fac[n]*(finv[k]*finv[n-k] % MOD) % MOD;

const ll MOD = 1e9+7;
const int MAX = 1001001;
ll fac[MAX],finv[MAX],inv[MAX];
void COMinit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i % MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i) % MOD;
        finv[i]=finv[i-1]*inv[i] % MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0 || k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k] % MOD) % MOD;
}
ll powmod(ll x, ll n){
    ll ret=1;
    while(n>0){
        if(n&1){
            ret*=x;
            ret%=MOD;
            n-=1;
        }
        else{
            x*=x;
            x%=MOD;
            n>>=1;
        }
    }
    return ret;
}
signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    COMinit();
    ll n,a,b,c; cin >> n >> a >> b >> c;
    ll ans=0;
    for(ll m=n;m<=2*n-1;m++){
        ll P=COM(m-1,n-1);
        P*=100; P%=MOD; P*=m; P%=MOD;
        P*=powmod(a,n); P%=MOD; P*=powmod(b,m-n); P%=MOD;
        ll Q=powmod(a+b,m+1); Q%=MOD;
        ll res=P*powmod(Q,MOD-2); res%=MOD;
        ans+=res; ans%=MOD;
        
        P=COM(m-1,n-1);
        P*=100; P%=MOD; P*=m; P%=MOD;
        P*=powmod(b,n); P%=MOD; P*=powmod(a,m-n); P%=MOD;
        Q=powmod(a+b,m+1); Q%=MOD;
        res=P*powmod(Q,MOD-2); res%=MOD;
        ans+=res; ans%=MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 27124
#include <iostream>
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
using namespace std;

#define int long long
#define endl "\n"
#define fir first
#define sec second
#define fro front
#define m_p make_pair
#define mod 1000000007
#define all(v)  v.begin(),v.end()
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define all(v)  v.begin(),v.end()
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}

int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res* a% mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}



signed main() {
	int n;
	double a,t=0;
	string b;
	cin >> n;
	rep(i, n) {
		cin >> a >> b;
		if (b == "JPY") {
			t += a;
		}
		if (b == "BTC") {
			t += 380000 * a;
		}
	}
	printf("%.10lf", t);
}


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

int main() {
    ll n;
    int m;
    cin >> n >> m;
    vector<int> a(m);
    rep(i,m) cin >> a.at(i);
    ll sum = 0;
    rep(i,m) sum += a.at(i);
    if(sum <= n) cout << n-sum << endl;
    else cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 3672
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <string>
#include <cmath>
#include <cassert>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;

int main ()
{
    int N;
    vector<int> L;
    cin >> N;
    int temp;
    int sum=0;
    for(int i=0;i<2*N;i++){
        cin >> temp;
        L.push_back(temp);
    }
    sort(L.begin(),L.end());
    for(int i=0;i<N;i++){
        sum+=L[2*i];
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	/*
	 * 問題文 競プロ幼稚園にはN人の子供がいます。
	 * えび先生は、子供たちを一列に並べ、 一人目にはキャンディーを1個,二人目には2個,...,
	 * N人目にはN個あげることにしました。 必要なキャンディーの個数の合計は何個でしょう
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;

		for (int i = 0; i < N; i++) {
			sum += +(i + 1);
		}
		System.out.println(sum);
	}

}

Measured memory_bytes: 9684