akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_imports)]
#![allow(unused_macros)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;


//
// Macro debug!
//

#[cfg(debug_assertions)]
include!{"./procon/debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}


//
// Macro input!
//

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


//
// IteratorExt
//

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}


//
// Main
//

fn main() {
    input! {
        a: i64,
        b: i64,
    }

    let x = (a + b) / 2;

    if (a - x).abs() == (b - x).abs() {
        println!("{}", x);
    } else {
        println!("IMPOSSIBLE");
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
#define abs(a) (a)>0 ?(a):-(a)
#define llong long long

int main(){
	int N,K; scanf("%d %d",&N,&K);
	int flag[N]; rep(i,0,N) flag[i]=1;
	rep(i,0,K){
		int d; scanf("%d",&d);
		rep(j,0,d){
			int k; scanf("%d",&k);
			k--;
			flag[k]=0;
		}
	}
	int ans=0;
	rep(i,0,N){
		if( flag[i] ) ans++;
	}
	printf("%d",ans);
	return 0;
}


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

int main() {
  int S;
  cin >> S;
  int front = S / 100;
  int back = S % 100;

  string ans;
  if (front > 12 || front == 0) {
    if (back >= 1 && back <= 12) {
      ans = "YYMM";
    } else ans = "NA";
  } else {
    if (back > 12 || back == 0) {
      ans = "MMYY";
    } else ans = "AMBIGUOUS";
  }

  cout << ans << endl;
};


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

int c[(int)2e5];
long long dp[(int)2e5];
long long c_dp[(int)2e5];

int main() {
  int n;
  cin>>n;
  for (int i=0; i<n; i++) {
    cin>>c[i];
    --c[i];
  }
  for (int i=0; i<n; i++) {
    dp[i] = 0;
    c_dp[i] = 0;
  }
  long long mod = 1e9 + 7;
  dp[0] = 1;
  c_dp[c[0]] = 1;
  for (int i=1; i<n; i++) {
    if (c[i] == c[i-1]) {
      dp[i] = dp[i-1];
    } else {
      dp[i] = dp[i-1] + c_dp[c[i]];
      c_dp[c[i]] += dp[i-1];
      dp[i] %= mod;
      c_dp[c[i]] %= mod;
    }
  }
  cout<<dp[n-1]<<endl;
}

Measured memory_bytes: 4096
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 1LL << 61;
const ll mod = 1000000007LL;
//const ll mod = 998244353LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,0,-1,0,1,1,-1,-1 }, dy[9] = { 0,0,1,0,-1,1,-1,1,-1 };
#define endl '\n'
#pragma endregion
#define MAX 222222






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



  cin >> n >> m;
  cin >> s;
  tmp = s[m - 1] - 'A';
  char c = 'a' + tmp;
  s[m - 1] = c;
  cout << s << endl;





  return 0;
}

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

int main(){
    string S;
    int N;
    cin >> N >> S;
    for(int i = 0; i < S.size(); i++){
        if(S.at(i) + N > 'Z'){
            S.at(i) = ((S.at(i) + N) - 'Z') + 'A' - 1;
        }
        else{
            S.at(i) += N;
        }
    }
    cout << S << endl;
    return 0;
}

Measured memory_bytes: 256
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))

a,b,c = inm()
print(c-min(c,a-b))


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD = 1000000007;
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 (b<a) {a=b; return 1;} return 0;}

#ifdef _DEBUG
#include "debug.h"
#else
#define debug(...)
#define print(...)
#endif

int main() {
    int n, m, k; cin >> n >> m >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b(m);
    rep(i, m) cin >> b[i];
    vector<ll> sa(n+1, 0ll), sb(m+1, 0ll);
    rep(i, n) sa[i+1] = sa[i]+a[i];
    rep(i, m) sb[i+1] = sb[i]+b[i];
    debug(sa);
    debug(sb);
    int ans = 0;
    rep(i, n+1) {
        int a_cnt = i;
        ll now = sa[i], left = k-sa[i];
        debug(now, left);
        if (now>k) continue;
        int b_cnt = upper_bound(all(sb), left)-sb.begin()-1;
        debug(a_cnt, now, left, b_cnt);
        chmax(ans, a_cnt+b_cnt);
    }
    cout << ans << endl;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

int a[3];

int main(int argc, char **argv) {
	cin >> a[0] >> a[1] >> a[2];
	set<PP> s;
	sort(a, a + 3);
	PP p = MP(a[0], MP(a[1], a[2]));
	int res = 0;
	while (a[0] % 2 == 0 && a[1] % 2 == 0 && a[2] % 2 == 0 && s.count(p) == 0) {
		s.insert(p);
		++res;
		a[0] = (p.S.F + p.S.S) / 2;
		a[1] = (p.F + p.S.S) / 2;
		a[2] = (p.F + p.S.F) / 2;
		sort(a, a + 3);
		p = MP(a[0], MP(a[1], a[2]));
	}
	cout << (s.count(p) != 0 ? -1 : res) << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;



int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int32 sx, sy, tx, ty;
	std::cin >> sx >> sy >> tx >> ty;
	rep(i, 0, tx - sx) {
		std::cout << "R";
	}
	rep(i, 0, ty - sy) {
		std::cout << "U";
	}
	rep(i, 0, tx - sx) {
		std::cout << "L";
	}
	rep(i, 0, ty - sy+1) {
		std::cout << "D";
	}
	rep(i, 0, tx - sx+1) {
		std::cout << "R";
	}
	rep(i, 0, ty - sy+1) {
		std::cout << "U";
	}
	std::cout << "LU";
	rep(i, 0, tx - sx+1) {
		std::cout << "L";
	}
	rep(i, 0, ty - sy + 1) {
		std::cout << "D";
	}
	std::cout << "R";
	return 0;
}

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

using namespace std;

int main() {
    double n,d;
    cin >> n >> d;

    int count = 0;

    for (int i = 0; i < n; i++) {
        double x,y;
        cin >> x >> y;
        long long int asd = pow(x,2) + pow(y,2);
        long double distance = sqrt(asd);

        if (distance <= d) {
            count++;
        }
    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 3844
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int N;
ll data[530000],datb[530000]; // 0-indexed
void init(int n_){
	N = 1;
	while(N<=n_)N*=2;
}
void add(int a,int b, int x,int k,int l,int r){ // add x to [a,b) k=0, l=0, r=N
	if(a <= l && r<=b){
		data[k] += x;
	}
	else if( l<b && a<r ){
		datb[k] += (min(b,r)-max(a,l)) * x;
		add( a,b,x,k*2+1,l,(l+r)/2);
		add( a,b,x,k*2+2,(l+r)/2,r);
	}
}
ll sum(int a,int b,int k,int l,int r){ // sum of [a,b) k=0, l=0, r=N
	if(b<=l || r<=a){
		return 0;
	}
	else if(a<= l && r<=b){
		return data[k]*(r-l)+datb[k];
	}
	else{
		ll res = (min(b,r) -max(a,l)) * data[k];
		res += sum(a,b,k*2+1,l,(l+r)/2);
		res += sum(a,b,k*2+2,(l+r)/2,r);
		return res;
	}
}
signed main(){
	int n,d,a;
	cin>>n>>d>>a;
	vector< pair<int,int> > mons;
	for(int i=0;i<n;i++){
		int xx,hh;
		cin>>xx>>hh;
		mons.pb( mp( xx, hh ) );
	}
	sort( mons.begin(), mons.end() );
	vector<int> rig(n);
	for(int i=0;i<n;i++){
		auto it = upper_bound( mons.begin(), mons.end(), mp( mons[i].first + d * 2, LINF ) );
		rig[i] = it - mons.begin() ;
	}
	init( n+100 );
	for(int i=0;i<n;i++){
		add( i, i+1, mons[i].second, 0, 0, N );
	}
	int ans = 0;
	for(int i=0;i<n;i++){
		int cur = sum( i, i+1, 0, 0, N );
		if( cur > 0 ){
			int tms = cur / a;
			if( cur % a != 0 ) tms++;
			ans += tms;
			add( i, rig[i], -a*tms, 0, 0, N );
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 11116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    int a, b;
    cin >> a >> b;
    int ans = 0;
    bool flag = false;
    for (int i = 1; i <= 1000; i++) {
        double x = (i * 0.08);
        double y = (i * 0.10);
        if ((int)x == a && (int)y == b) {
            flag = true;
            ans = i;
            break;
        }
    }
    if (flag) cout << ans << endl;
    else cout << -1 << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int n,x,i,j,k;
  cin >> n >> x;
  int a[2*n]={},used[2*n]={};
  if(x==1 || x==2*n-1)cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    a[n]=x;
    a[n-1]=x-1;
    a[n+1]=x+1;
    used[x]=used[x-1]=used[x+1]=1;
    if(x+1==2*n-1 || x-1==1){
      k=1;
      for(i=1;i<2*n;i++){
        if(a[i]!=0)continue;
        while(used[k]==1){
          k++;
        }
        a[i]=k;
        used[k]=1;
      }
    }else{
      a[n+2]=x-2;
      a[n-2]=x+2;
      used[x-2]=used[x+2]=1;
      k=1;
      for(i=1;i<2*n;i++){
        if(a[i]!=0)continue;
        while(used[k]==1){
          k++;
        }
        a[i]=k;
        k++;
      }
    }
    for(i=1;i<2*n;i++)cout << a[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 3072
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const ll MOD = TEN(9) + 7;
int n;
string s1, s2;

int main() {
    fastio();

    cin >> n >> s1 >> s2;

    ll ans;
    if (s1[0] == s2[0]) {
        ans = 3;
    } else {
        ans = 3 * 2;
    }

    forn1(i, n - 1) {
        if (s1[i - 1] == s1[i]) {
            continue;
        }

        if (s1[i] == s2[i]) {
            if (s1[i - 1] == s2[i - 1]) {
                ans = ans * 2 % MOD;
            }
        } else {
            if (s1[i - 1] != s2[i - 1]) {
                ans = ans * 3 % MOD;
            } else {
                ans = ans * 2 % MOD;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
/*
String[]の初期化、整数の型がlongになっているか
関数（splitとかcontainsとか）内では"+"とかは正規表現となされるので"\\+"とする
配列のコピーはarr1=arr.clone()
HashSet<>[]はおのおの初期化した？？？？？
負の数の割り算は絶対値が小さいほうに切り捨てられるex.-1/2=0ので、ある値>kみたいな式だとバグらせやすいので注意
ある値>=kとして、切り上げた値をとるべき
toLowerCase()はアルファベット以外に対して行ってもエラーにはならない
ArrayDequeではpopとpushはStackと同じ操作になる
//import static java.lang.System.*; はしばらく使わなそう(使うとしてもexit(0)のためだけ)←return;でよさそう
最後にout.flush()またはout.close()をするのを忘れずに！
Point2D p2d=new Point2D.Double(d1,d2);
*/
//入力終了→Ctrl+D
import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.Point2D;
//import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        int n=sc.nextInt();
        int[] h=new int[n];
        for (int i = 0; i < n; i++) {
            h[i]=sc.nextInt();
        }
        int ans=0,c=0;
        for (int i = 0; i < n; i++) {
            c=0;
            for (int j = 0; j < i; j++) {
                if(h[j]<=h[i])c++;
            }
            if(c==i)ans++;
        }
        out.println(ans);
        out.close();
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc     {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static String nextLine() {
            return s.nextLine();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }

        static boolean hasNext() {
            return s.hasNext();
        }
    }
}

Measured memory_bytes: 23124
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

h = a.group_by(&:itself).map{ |key, value| [key, value.count] }.to_h

arr = []
h.each do |k, v|
  if v >= 4
    arr.push(k)
    arr.push(k)
  elsif v >= 2
    arr.push(k)
  end
end
arr.sort!.reverse!
if arr.size < 2
  p 0
else
  p arr[0] * arr[1]
end


Measured memory_bytes: 34308
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);(i)++)
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);(i)--)
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);(i)--)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }

vector<VI> g, re_g;
int num = 0;
vector<pair<int, int>> t;
vector<bool> ever;
void DFS(int now) {
    for (int to : g[now]) {
        if (ever[to])continue;
        ever[to] = true;
        DFS(to);
    }
    t[num++] = { num,now };
}

int main() {
    init();

    int n, m;
    cin >> n >> m;

    //正順、逆順のグラフを構成
    g.resize(n); re_g.resize(n);
    FOR(i, 0, m) {
        int s, t;
        cin >> s >> t;
        s--, t--;
        g[s].push_back(t);
        re_g[t].push_back(s);
    }

    //正順のグラフで行き詰った順に番号付け
    int num = 0;
    t.resize(n);
    ever.resize(n, false);
    FOR(i, 0, n)if (!ever[i]) {
        ever[i] = true;
        DFS(i);
    }

    rSORT(t, [](auto a, auto b) {return a.first > b.first; });

    //逆順のグラフでdfs、行き詰るまでに行った点が連結成分
    ever.clear(); ever.resize(n, false);
    vector<VI> ans;
    stack<int> dfs;
    for (auto i : t)if (!ever[i.second]) {
        dfs.push(i.second);
        ever[i.second] = true;
        VI link;
        while (!dfs.empty()) {
            int now = dfs.top(); dfs.pop();
            link.push_back(now);
            for (int to : re_g[now]) {
                if (ever[to])continue;
                ever[to] = true;
                dfs.push(to);
            }
        }
        ans.push_back(link);
    }

    //何番目の連結成分に属すか
    VI where(n);
    FOR(i, 0, ans.size()) {
        SORT(ans[i]);
        for (int j : ans[i])where[j] = i;
    }

    FOR(i, 0, n) {
        VI gh = ans[where[i]];
        FOR(j, 0, gh.size()) {
            cout << ans[where[i]][j] + 1 << (j == gh.size() - 1 ? "\n" : " ");
        }
    }
}


Measured memory_bytes: 4300
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int X, Y; cin >> X >> Y;
  cout << X + Y / 2 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include<atcoder/all>
// Begin Header {{{
//using namespace atcoder;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
template<class T, class S> inline bool chmax(T &a, const S &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T, class S> inline bool chmin(T &a, const S &b) { if (a>b) { a = b; return 1; } return 0; }
#define INT(...)                                                                                                                                               \
    int __VA_ARGS__;                                                                                                                                           \
    IN(__VA_ARGS__)
#define LL(...)                                                                                                                                                \
    ll __VA_ARGS__;                                                                                                                                            \
    IN(__VA_ARGS__)
#define STR(...)                                                                                                                                               \
    string __VA_ARGS__;                                                                                                                                        \
    IN(__VA_ARGS__)
#define CHR(...)                                                                                                                                               \
    char __VA_ARGS__;                                                                                                                                          \
    IN(__VA_ARGS__)
#define DBL(...)                                                                                                                                               \
    double __VA_ARGS__;                                                                                                                                        \
    IN(__VA_ARGS__)
template<class T> void scan(T &a) { cin >> a; }
void IN() {}
template<class Head, class... Tail> void IN(Head &head, Tail &... tail){ scan(head); IN(tail...); }
// }}} End Header



int main() {
	vector<int> t(4);
	LL(n);
	rep(i,n){
		ll a;
		cin >> a;
		t[a%4]++;
	}
	ll cash = t[1]+t[3];
	bool ok;
	if(t[2] > 0){
		if(t[0] >= cash) ok = true;
		else false;
	}else{
		if(t[0]+1 >= cash) ok = true;
		else ok = false;
	}
	if(ok) puts("Yes");
	else puts("No");
	return 0;
}


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

string s[] = { "AC", "WA", "TLE", "RE" };
map<string, int> m;

int main() {
	int n;
	cin >> n;
	m["AC"] = 0;
	m["WA"] = 0;
	m["TLE"] = 0;
	m["RE"] = 0;
	for (int i = 0; i < n; ++i) {
		string s;
		cin >> s;
		++m[s];
	}

	for (int i = 0; i < 4; ++i)
		cout << s[i] << " x " << m[s[i]] << endl;

}


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

int main(){
  long long n,t[50];

  t[0] = 0;
  for(int i=1;i<=30;i++)t[i] = t[i-1]*3+1LL;

  while(cin >> n){
    if(n<=0){
      cout << "0\n";
      continue;
    }
    if(n&1)cout << t[n/2]*4+1 << endl;
    else cout << t[n/2-1]*3+t[n/2]+1 << endl;
  }
}

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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n,dp[87]={2,1};

main() {
    cin >> n;
    repo(i,2,n+1) dp[i] = dp[i-1]+dp[i-2];
    ct(dp[n])
}







Measured memory_bytes: 256
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cost = [0] * M
for i in range(M) :
    x, y, c = map(int, input().split())
    cost[i] = a[x-1] + b[y-1] - c
a = sorted(a) ; b = sorted(b)
print(min(min(cost),a[0]+b[0]))


Measured memory_bytes: 24728
#include<iostream>
#include<vector>
#include<string>

int main(){
    int n;
    std::cin >> n;
    std::vector<int> a(n + 1), b(n);
    for(int i = 0; i < n + 1; i++) std::cin >> a[i];
    for(int i = 0; i < n; i++) std::cin >> b[i];

    long long sum = 0;
    for(int i = 0; i < n; i++){
        if(a[i] <= b[i]){
            sum += a[i];
            b[i] -= a[i];
            a[i] = 0;
            
            if(a[i + 1] >= b[i]){
                sum += b[i];
                a[i + 1] -= b[i];
                b[i] = 0;
            }else{
                sum += a[i + 1];
                b[i] -= a[i + 1];
                a[i + 1] = 0;
            }
        }else{
            sum += b[i];
            a[i] -= b[i];
            b[i] = 0;
        }
    }

    std::cout << sum << std::endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int ans=0;
    int r,g,b,n; cin>>r>>g>>b>>n;
    for(int i=0; i*r<=n; i++){
        for(int j=0; i*r+j*g<=n; j++){
            if((n-i*r-j*g)%b==0)ans++;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
def examD():
    N, Z, W = LI()
    A = LI()
    if N>=2:
        ans = max(abs(A[-2]-A[-1]),abs(A[-1]-W))
    else:
        ans = abs(A[0]-W)
    print(ans)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()


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

int main() {
  int N;
  cin >> N;
  int order;
  vector<int> orderlist(N);
  for (int i = 0; i < N; i++){
    cin >> order;
    orderlist[order - 1] = i + 1;
  }
  for (int i = 0; i < N - 1; i++){
    cout << orderlist[i] << " ";
  }
  cout << orderlist[N - 1] << endl;
}


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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

int A[100];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int N, M, sum=0, cnt=0;
	cin>>N>>M;
	for(int i=0;i<N;i++) cin>>A[i], sum+=A[i];
	for(int i=0;i<N;i++) cnt+=A[i]*4*M>=sum;
	cout<<(cnt>=M ? "Yes\n":"No\n");
	return 0;
}

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

ll solve() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> A[i];
    }
    ll INF = 1LL<<60;
    int d = 2;
    vector<ll> dp(N+2*d,-INF), prev(N+2*d, -1);
    dp[0] = dp[1] = 0;
    for ( int i = d; i < N+2*d; i++ ) {
        for ( int j = 2; i-j >= 0; j+=2 ) {
            ll a = i-d < N ? A[i-d] : 0;
            ll x = dp[i-j] + a;
            if ( dp[i] < x ) {
                dp[i] = x;
                prev[i] = i-j;
            }
        }
    }
    int ci = dp[N+d] > dp[N+d+1] ? N+d : N+d+1;
    ll mx = dp[ci];
    vector<int> sel;
    while ( ci >= 0 ) {
        if ( ci-d >= 0 && ci-d < N ) {
            sel.push_back(ci-d);
        }
        ci = prev[ci];
    }
    vector<int> ans;
    if ( sel.size() > 0 ) {
        for ( int i = N-1; i > sel[0]; i-- ) {
            ans.push_back(i);
        }
        for ( int i = 0; i < sel.size()-1; i++ ) {
            for ( int j = (sel[i]+sel[i+1])/2; j > sel[i+1]; j-- ) {
                ans.push_back(j);
            }
        }
        for ( int i = sel[sel.size()-1]-1; i >= 0; i-- ) {
            ans.push_back(0);
        }
    } else {
        mx = -INF;
        int mi = -1;
        for ( int i = 0; i < N; i++ ) {
            if ( mx < A[i] ) {
                mx = A[i];
                mi = i;
            }
        }
        for ( int i = N-1; i > mi; i-- ) {
            ans.push_back(i);
        }
        for ( int i = 0; i < mi; i++ ) {
            ans.push_back(0);
        }
    }

    cout << mx << "\n";
    cout << ans.size() << "\n";
    for ( int i = 0; i < ans.size(); i++ ) {
        cout << ans[i] + 1 << "\n";
    }
    return 0;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3660
n = int(input())
A = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    A[i].append(i)

B = [[j for j in i] for i in A]

A.sort()
B.sort(key=lambda x:x[1])

M = []
for i in range(n-1):
    M.append([A[i][2], A[i+1][2], A[i+1][0]-A[i][0]])
    M.append([B[i][2], B[i+1][2], B[i+1][1]-B[i][1]])

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def size(self, x):
        if self.parents[x] < 0:
            return -self.parents[x]
        else:
            self.parents[x] = self.size(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
# print(M)

M.sort(key=lambda x:x[2])
ans = 0
U = UnionFind(n+1)
e = 0
for i in range(len(M)):
    if e == n-1:
        break
    if U.find(M[i][0]) != U.find(M[i][1]):
        U.union(M[i][0], M[i][1])
        ans += M[i][2]
        e += 1
        # print(M[i])

print(ans)

Measured memory_bytes: 126680
using System;
using System.Linq;

namespace atcoderYahooPath
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] adj = new int[4, 4];
            string sp = null;
            int cnt = 3;
            while (cnt > 0 && (sp = Console.ReadLine())!= null)
            {
                --cnt;
                var _isp = sp.Split().Select(x => int.Parse(x) - 1).ToArray();
                adj[_isp[0], _isp[1]] = adj[_isp[1], _isp[0]] = 1;
            }
            Solution sol = new Solution();
            Console.WriteLine(sol.AllTownOnePath(adj) ? "YES" : "NO");

        }
    }
    public class Solution
    {

        public bool AllTownOnePath(int[,] adj)
        {
            int[] town = { 0, 1, 2, 3 };
            bool existPath = false;
            while(!existPath && NextPermutation(town))
            {
                existPath = true;
                for(int i = 0; i < 3; ++i)
                {
                    if (adj[town[i], town[i + 1]] == 1)
                        continue;
                    existPath = false;
                    break;
                }
            }
            return existPath;
        }

        private bool NextPermutation(int[] nums)
        {
            if (nums.Length == 1)
                return false;

            int k = -1;
            int l = -1;
            int tmp;

            for (int i = 0; i < nums.Length - 1; ++i)
                if (nums[i] < nums[i + 1])
                    k = i;

            if (k == -1)
                return false;
            
            for (int i = k + 1; i < nums.Length; ++i)
                if (nums[k] < nums[i])
                    l = i;

            tmp = nums[k];
            nums[k] = nums[l];
            nums[l] = tmp;
            ++k;


            int delta = (nums.Length - k + 1) / 2;
            for (int i = 0; i < delta; ++i)
            {
                tmp = nums[nums.Length - i - 1];
                nums[nums.Length - i - 1] = nums[i + k];
                nums[i + k] = tmp;
            }
            return true;
        }
    }
}


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

int main()
{
   int N;
    scanf("%d", &N);
    if (N==1)
    {
        printf("Hello World");
    }
    else if (N==2)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        printf("%d", a+b);
    }
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int w, h;
	char c;
	cin >> w >> h >> c;
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (i == 0 && j == 0 || i == 0 && j == w - 1 || i == h - 1 && j == 0 || i == h - 1 && j == w - 1) cout << "+";
			else if (i == h / 2 && j == w / 2) cout << c;
			else if (i == 0 || i == h - 1) cout << "-";
			else if (j == 0 || j == w - 1) cout << "|";
			else cout << ".";
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3108
$s = <STDIN>;
my ($N,$X,$Y) = split(/ /,$s);

my @data;
for(my$i=1;$i<$N;$i++){
  $data[$i] = 0;
}
for($i=1;$i<$N;$i++){
  for($j=($i+1);$j<=$N;$j++){
    $mindist = $j-$i;
    if( $i <$X){
      $A  = $X- $i +abs($Y-$j) +1;
    }else{
      $A  = $i- $X +abs($Y-$j) +1;
    }
    if($A <$mindist ){
      $mindist = $A;
    }
    $dist = $mindist;
    #print "$i $j $dist\n";
    $data[$dist]++;
  }
}

for(my$i=1;$i<$N;$i++){
  #print "i $i ";
  print "$data[$i]\n";
}

Measured memory_bytes: 640
N=int(input())
S=list(input())
numlist=range(1000)
ans=0

for i in numlist:
    num=str(i)
    if len(num)==1:
        num="00"+num
    if len(num)==2:
        num="0"+num
    if num[0] in S[:N-1]:
        num1=S.index(num[0])
        if num[1] in S[num1+1:N-1]:
            S2=S[num1+1:N-1]
            num2=S2.index(num[1])+num1+1
            if num[2] in S[num2+1:]:
                ans+=1
print(ans)

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

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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

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

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

Measured memory_bytes: 256
#include <iostream>

using namespace std;

typedef long long ll;

int main() {
	ll s;
	cin >> s;
	ll n = 1e9;
	ll h = s/n;
	if (s%n == 0) h--;
	s -= h*n;
	cout << 0 << " " << 0 << " " << n << " " << 1 << " " << (n-s) << " " << h+1 << "\n";
}


Measured memory_bytes: 256
import collections
N = int(input())
nums = list(map(int, input().split()))
Q = int(input())
nums_hash = collections.Counter(nums)
sum_point = sum(nums)
for _ in range(Q):
    # print(nums_hash)
    b, c = map(int, input().split())
    if b in nums_hash:
        sum_point = (sum_point - (b * nums_hash[b]) + (c * nums_hash[b]))
    print(sum_point)
    nums_hash[c] += nums_hash[b]
    nums_hash[b] = 0


Measured memory_bytes: 87620
#include<bits/stdc++.h>
#define pb push_back 
 #define fo(i,n) for(int i=0;i<n;i++)
#define ll long long 
#define int long long 
#define Mod 10000000000007 
#define maxn 200005
#define MAX 4294967296  // 2^32
const int M=1e9+7;
#define ip pair<int,int>
#define test(t) ll t;cin>>t;while(t--)
  
using namespace std;

long long power(int x,int y){
if(y==0)return 1;
long long t=power(x,y/2);
if(y%2==1)return (x*t*t)%Mod;
return (t*t)%Mod;

}
long long gcd(int x,int y){
    // if(y>x)swap(x,y);
    if(y==0)return x;
    return gcd(y,x%y);
}
void solve(){
int a,b,c,d;
cin>>a>>b>>c>>d;
int t=max(a*c,a*d);
int y=max(b*c,b*d);
cout<<max(t,y)<<endl;

}

signed main(){


    // std::string binary = std::bitset<8>(n).to_string();
    ios::sync_with_stdio(0);
    cin.tie(0);
  
// test(t)  
 solve();


  


}

Measured memory_bytes: 3652
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <tuple>
#include <climits>
#include <sstream>
using namespace std;

static const unsigned long long int MOD = 1000000007LL;

int main()
{
    int r;
    cin >> r;
    cout << 3 * r * r;
    return 0;
}

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

#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
void fst()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
}
int mod = 1e9 + 7;
int binpow(int a, int b)
{
    int res = 1;
    while (b > 0)
    {
        if (b & 1)
        {
            res = res * a;
            res %= mod;
        }
        a = a * a;
        a %= mod;
        b >>= 1;
        b %= mod;
    }
    return res;
}
#define Darr(x)           \
    cerr << #x << " = ";  \
    for (auto i : x)      \
        cerr << i << " "; \
    cerr << "\n";

#define all(a) a.begin(), a.end()
#define pb push_back
#define deb(x) cerr << #x << "=" << x << " ";
//#define int long long
#define R(n) for (int i = 0; i < n; i++)
#define Rj(n) for (int j = 0; j < n; j++)
#define F(i, a, n) for (int i = a; i <= n; i++)
#define MN(x, y) x = min(x, y);
#define MX(x, y) x = max(x, y);
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;

int32_t main()
{
    int n;
    cin>>n;
    if(n>=30)return cout<<"Yes",0;
    cout<<"No";


}


Measured memory_bytes: 3668
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

signed main(){
    int a,b;
    cin >> a >> b;
    cout << a*b << endl;
    



    return 0;
}

Measured memory_bytes: 3640
function Main(input) {
    var M = parseInt(input[0], 10);
    var N = parseInt(input[1], 10);

    var result = '';
    if (M > N) {
        for (var i = 0; i < M; i++) {
            result += N;
        }
    } else {
        for (var i = 0; i < N; i++) {
            result += M;
        }
    }

    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

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

int main() {
  
  string C;
  cin >> C;
  
  if (C == "a") {
    cout << "vowel" << endl;
  }
  else if (C == "e") {
    cout << "vowel" << endl;
  }
  else if (C == "i") {
    cout << "vowel" << endl;
  }
  else if (C == "u") {
    cout << "vowel" << endl;
  }
  else if (C == "o") {
    cout << "vowel" << endl;
  }
  
  else {
    cout << "consonant" << endl;
  }
  
}


Measured memory_bytes: 256
from collections import defaultdict,deque, Counter
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = inp()
Alist = inpl()
Blist = inpl()
ans = 0
for i in range(n):
    ApA = Alist[i]+Alist[i+1]
    if Blist[i] >= ApA:
        ans += ApA
        Alist[i+1] = 0
    elif Blist[i] >= Alist[i] and Blist[i] <ApA:
        ans += Blist[i]
        Alist[i+1] = ApA - Blist[i]
    elif Blist[i] < Alist[i]:
        ans += Blist[i]

print(ans)

Measured memory_bytes: 27576
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define Pll pair<llint,llint>
#define keta(a)  fixed << setprecision(a)
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
const llint INF = 100000000;
int main() {
	int n;
	cin >> n;
	hei(llint) a(n), b(n);
	rep(i, 0, n)cin >> a[i];
	rep(i, 0, n)cin >> b[i];
	llint m = 0;
	hei(llint) s;
	rep(i, 0, n) {
		if (b[i] < a[i])m += a[i] - b[i];
		else  s.push_back(b[i] - a[i]);
	}
	rep(i, 0, s.size()) {
		m-=(s[i] / 2);
	}
	Yes(m<=0)
	return 0;
}


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

int main() {
  int n,m;cin>>n>>m;
  int L=1,R=n;
  rep(i,m){
    int l,r;cin>>l>>r;
    L=max(L,l);R=min(R,r);
  }
  int ans=R-L+1;
  cout<<max(ans,0)<<endl;
}

Measured memory_bytes: 3524
#C - 4-adjacent
N = int(input())
A = list(map(int, input().split()))
tmp1 = 0
tmp2 = 0
tmp4 = 0

for i in range(N):
    if A[i] % 4 == 0:
        tmp4 += 1
    elif A[i] % 2 == 0:
        tmp2 += 1
    else:
        tmp1 += 1

if tmp2 == 0 and tmp4 >= tmp1-1:
    print("Yes")
elif tmp2 > 0 and tmp4 >= tmp1:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 62576
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<map>
#include<queue>
#include<set>

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

int main(){
  int n;
	cin>>n;
	int graph[n][n];
	for(int j=0;j<n;j++)
		for(int i=0;i<n;i++){
				graph[j][i] = 10000;
		}
	for(int i=0;i<n;i++){
		int k,m,l;
		cin>>k>>m;
		for(int j=0;j<m;j++){
			cin>>l;
			graph[k-1][l-1] = 1;
		}
	}
	
	for(int k=0;k<n;k++)
		for(int j = 0;j<n;j++)
			for(int i = 0;i<n;i++)
				if(graph[i][j]>graph[i][k]+graph[k][j])
					graph[i][j] = graph[i][k]+graph[k][j];
	int p;
	cin>>p;
	for(int i=0;i<p;i++){
		int s,d,v;
		cin>>s>>d>>v;
		if(graph[s-1][d-1]<v)
			cout<<graph[s-1][d-1]+1<<endl;
		else
			cout<<"NA"<<endl;
	}
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;
     
int main()
{
    int x,y;
    
    cin >> x;
  
    if((x >= 1) && (x <= 100)) {
       y = x * x * x;
       cout << y << endl;
    }
    else{
       cout << "error" << endl;
    };
  
}

Measured memory_bytes: 3088
def divisors(n):
   d=[]
   for i in range(1,int(n**0.5)+1):
       if n%i==0:
           d.append(i)
           if i!=n//i:
               d.append(n//i)
   d.sort()
   return d
n=int(input())
table=[0]*(n+1)
ball=[]
a=list(map(int,input().split()))[::-1]
for i in range(n):
    if table[n-i]!=a[i]:
        ball.append(n-i)
        for j in divisors(n-i):
            table[j]=1-table[j]
print(len(ball))
if len(ball)!=0:
    print(*ball)

Measured memory_bytes: 98624
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int a, b;
  cin >> a >> b;
  if (a <= 0 && b >= 0)
    cout << "Zero" << endl;
  else if (a >= 0 && b >= 0)
    cout << "Positive" << endl;
  else {
    int x = abs(a) - abs(b) + 1;
    if (x & 1)
      cout << "Negative" << endl;
    else
      cout << "Positive" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX/2+2],R[MAX/2+2];
int count;

void merge(int A[],int n,int left,int mid,int right){
  //int i,k;                                                                    
  int n1 = mid - left;
  int n2 = right - mid;
  for(int i=0;i < n1;i++)L[i]=A[left+i];
  for(int i=0;i < n2;i++)R[i]=A[mid+i];
  L[n1]=R[n2]=SENTINEL;
  int i=0;
  int j=0;
  for(int k=left;k<right;k++){
    count++;
    if(L[i] <= R[j]){
      A[k]=L[i++];
    }else{
      A[k]=R[j++];
    }
  }
}

void mergeSort(int A[],int n,int left,int right){
  if(left+1 < right){
    int mid = (left + right)/2;
    mergeSort(A,n,left,mid);
    mergeSort(A,n,mid,right);
    merge(A,n,left,mid,right);
  }
}


int main(){
  int A[MAX],n,i;
  count =0;

  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);


  mergeSort(A,n,0,n);

  for(i=0;i<n;i++){
    if(i)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n%d\n",count);
  return 0;
}




Measured memory_bytes: 5592
#include<cstdio>
using namespace std;
int n;
int pri[105];
int num_to_pri[105];
int cnt[105];
int tot=0;
void div(int x)
{
	if(x==1)
	{
		return;
	}
	for(int i=2;i*i<=x;i++)
	{
		if(x%i==0)
		{
			for(;x%i==0;)
			{
				cnt[num_to_pri[i]]++;
				x/=i;
			}
		}
	}
	if(x!=1)
	{
		cnt[num_to_pri[x]]++;
	}
}
void pretreat()
{
	for(int i=2;i<=100;i++)
	{
		bool flag=true;
		for(int j=2;j*j<=i;j++)
		{
			if(i%j==0)
			{
				flag=false;
				break;
			}
		}
		if(flag)
		{
			pri[++tot]=i;
			num_to_pri[i]=tot;
		}

	}
	for(int i=1;i<=n;i++)
	{
		div(i);
	}
}
long long dp[105][105];
void work()
{
	pretreat();
	dp[0][1]=1;
	for(int i=1;i<=tot;i++)
	{
		for(int j=0;j<=cnt[i];j++)
		{
			for(int k=1;(j+1)*k<=100;k++)
			{
				dp[i][(j+1)*k]+=dp[i-1][k];
			}
		}
	}
	printf("%d",dp[tot][75]);
}
int main()
{
	scanf("%d",&n);
	work();
	return 0;
}


Measured memory_bytes: 128