akhauriyash/Code-Regression huggingface dataset:
#if defined(LOCAL)
#define PROBLEM_NAME "a"
const double _max_double_error = 1e-9;
#include "testutils.h"
#define L(x...) (debug(x, #x))
#define C(x...) CHECK(x)
#else
#define L(x, ...) (x)
#define C(x, ...) ;
#include <bits/stdc++.h>
#endif

using namespace std;
using vi = vector<int>; using vvi = vector<vi>;
using ii = pair<int,int>; using vii = vector<ii>;
using l = long long; using vl = vector<l>; using vvl = vector<vl>;
using ll = pair<l,l>; using vll = vector<ll>; using vvll = vector<vll>;
using lu = unsigned long long;
using vb = vector<bool>; using vvb = vector<vb>;
using vd = vector<double>; using vvd = vector<vd>;
using mll = unordered_map<l, l>;
const l INF = numeric_limits<l>::max();
const double EPS = 1e-10; static constexpr auto PI = acos(-1);
const l e0=1, e3=1000, e5=100000, e6=10*e5, e7=10*e6, e8=10*e7, e9=10*e8;
const char lf = '\n';
#define all(x) begin(x), end(x)
#define F(a,b,c) for (l a = l(b); a < l(c); a++)
#define B(a,b,c) for (l a = l(c) - 1; a >= l(b); a--)

void solve(istream& cin, ostream& cout) {
  l n; cin >> n;
  vl v(n); F(i, 0, n) cin >> v[i];
  mll c;
  l s = 0;
  l z = 0;
  F(i, 0, n) {
    c[s]++;
    l x = v[i];
    s += x;
    z += c[s];
  }
  cout << z << endl;
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout << fixed << setprecision(15);
#if defined(LOCAL)
  // _generate_random_test = generate_random;
  // _solve_brute = solve_brute;
  // _player_b = player_b;
  // _custom_solution_checker = solution_checker;
  maybe_run_tests(cin, cout);
#else
  solve(cin, cout);
#endif
}


Measured memory_bytes: 10056
while(1):
    [n,k]=[int(x) for x in raw_input().split()]
    if n==0: break
    clist=[]
    for i in range(n):
        clist.append(int(raw_input()))
    d1,d2=0,0
    for i in range(n-k+1):
        d1=max(reduce(lambda x,y:x*y,clist[i:i+k]),d1)
    for j in range(n-k+1):
        sect=sorted(clist[j:j+k])
        sect[0]=max(clist[:j]+clist[j+k:])
        d2=max(reduce(lambda x,y:x*y,sect),d2)
    print max(d2-d1,0)
    

Measured memory_bytes: 6428
void main() {
	auto N = ri;
	auto S = rs;
	int res, tmp;
	foreach(i; S) {
		if(i == 'I') tmp++;
		else tmp--;
		res = max(res, tmp);
	}
	res.writeln;
}

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

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lol long long
using namespace std;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >>n;
  vector<int> p(n),q(n),t(n);
  for(int i=0;i<n;i++) cin >>p[i],t[i]=p[i];
  for(int i=0;i<n;i++) cin >>q[i];
  sort(t.begin(),t.end());
  int P,Q;
  int i=0;
  do{
    i++;
    if(t==p) P=i;
    if(t==q) Q=i;
  }while(next_permutation(t.begin(),t.end()));
  cout <<abs(P-Q)<<'\n';
  return (0);
}

Measured memory_bytes: 3604
N = int(input())
S = list(input())

r = 0
g = 0
b = 0
for i in range(N):
  if S[i] == 'R':
    r += 1
  elif S[i] == 'G':
    g += 1
  else:
    b += 1

ans = r*g*b

for i in range(1,N-1):
  for j in range(1,min(i,N-i-1)+1):
    if S[i] != S[i-j] and S[i] != S[i+j] and S[i-j] != S[i+j]:
      ans -= 1
      
print(ans)

Measured memory_bytes: 9220
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

#[allow(unused_imports)]
use std::cmp::{min, max};
use std::collections::HashSet;

fn main() {
    input!{
        n: usize,
        v: [[usize1; n - 1]; n]
    }
    let mut idx = vec![0; n];
    let mut g = 0;
    let mut prev = HashSet::new();
    for i in 0..n {
        if v[i][0] > i && v[v[i][0]][0] == i {
            idx[i] += 1;
            idx[v[i][0]] += 1;
            g += 1;
            prev.insert(i);
            prev.insert(v[i][0]);
        }
    }
    let mut ans = 1;
    while g < n * (n - 1) / 2 {
        if prev.is_empty() {
            println!("-1");
            return;
        }
        let mut next = HashSet::new();
        for i in prev.iter().cloned() {
            let ii = idx[i];
            if ii == n - 1 {
                continue;
            }
            let j = v[i][ii];
            let jj = idx[j];
            if v[j][jj] == i && !next.contains(&i) && !next.contains(&j) {
                idx[i] += 1;
                idx[j] += 1;
                g += 1;
                next.insert(i);
                next.insert(j);
            }
        }
        prev = next;
        ans += 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 12540
from fractions import gcd
N=int(input())
A=list(map(int,input().split()))

L=[0]*(N+2)
R=[0]*(N+2)

for i in range(1,N+1):
	L[i]=gcd(L[i-1],A[i-1])

for i in range(N)[::-1]:
	R[i]=gcd(R[i+1],A[i])

A=[gcd(L[i],R[i+1]) for i in range(N+1)]

print(max(A))

Measured memory_bytes: 16612
N = int(input())
ans = 0

for i in range(1,N+1):
    li= []
    for j in range(1,i+1):
        if i % j == 0 and(i%2 != 0):
            li.append(i)
        else:pass
    if len(li) == 8:ans+=1
print(ans)

Measured memory_bytes: 3060
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int l = H[0] - 1;
		
		for(int i=1;i<N;i++){
			if(H[i] - 1 >= l){
				l = H[i] - 1;
			} else if(H[i] >= l){
				l = H[i];
			} else {
				Console.WriteLine("No");
				return;
			}
			
		}
		
		
		
		
		Console.WriteLine("Yes");
		
	}
	int N;
	int[] H;
	public Sol(){
		N = ri();
		H = ria();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 27100
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';


using namespace std;

int main(void){
    string S, T;
    cin>>S>>T;
    if(T==S+T[T.size()-1]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3600
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc *bufio.Scanner
var out *bufio.Writer

func main() {
	sc = bufio.NewScanner(os.Stdin)
	//bytes, _ := ioutil.ReadFile("./stdin.txt")
	//sc = bufio.NewScanner(strings.NewReader(string(bytes)))
	out = bufio.NewWriter(os.Stdout)
	buf := make([]byte, 1<<20)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()

	n := nextInt()
	idx := make([]int, n)
	x, y := make([]int, n), make([]int, n)
	for i := 0; i < n; i++ {
		idx[i] = i
		x[i], y[i] = nextInt(), nextInt()
	}
	perm := permute(idx)
	sum := 0.0
	for _, p := range perm {
		for i := 1; i < n; i++ {
			xd := x[p[i]] - x[p[i-1]]
			yd := y[p[i]] - y[p[i-1]]
			d2 := xd*xd + yd*yd
			sum += math.Sqrt(float64(d2))
		}
	}
	avg := sum / float64(len(perm))

	fmt.Fprintln(out, avg)
}

func permute(nums []int) [][]int {
	ret := make([][]int, 0, factorial(len(nums)))
	ret = append(ret, append([]int{}, nums...))

	n := len(nums)
	p := make([]int, n+1)
	for i := 0; i < n+1; i++ {
		p[i] = i
	}
	for i := 1; i < n; {
		p[i]--
		j := 0
		if i%2 == 1 {
			j = p[i]
		}

		nums[i], nums[j] = nums[j], nums[i]
		ret = append(ret, append([]int{}, nums...))
		for i = 1; p[i] == 0; i++ {
			p[i] = i
		}
	}
	return ret
}

func factorial(n int) int {
	ret := 1
	for i := 2; i <= n; i++ {
		ret *= i
	}
	return ret
}

func next() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}
func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func intMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}
func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}


Measured memory_bytes: 5508
//
// Created by yjq on 2019/10/23.
//

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long
#define __ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int N = 2010;
const int maxn = 2e5 + 10;
const ll mod = 1e9 + 7;
ll f[N * 3][N * 3], a[maxn], b[maxn], jie[maxn], ni[maxn];

ll pow_mod(ll a, ll b, ll m) {
    ll ans = 1;
    while (b) {
        if (b & 1)ans = ans * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return ans;
}

int main() {
    __;
    jie[0] = 1;
    for (int i = 1; i < maxn; ++i) {
        jie[i] = jie[i - 1] * (ll) i;
        jie[i] %= mod;
    }
    ni[maxn - 10] = pow_mod(jie[maxn - 10], mod - 2, mod);
    for (int i = maxn - 11; i >= 0; --i) {
        ni[i] = ni[i + 1] * (ll) (i + 1) % mod;
    }
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i] >> b[i];
        f[N - a[i]][N - b[i]]++;
    }
    for (int i = 1; i <= N * 2; ++i) {
        for (int j = 1; j <= N * 2; ++j) {
            f[i][j] += f[i - 1][j] + f[i][j - 1];
            f[i][j] %= mod;
        }
    }
    ll ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += f[a[i] + N][b[i] + N];
        ans = (ans - ((jie[a[i] * 2 + b[i] * 2] * ni[a[i] * 2]) % mod * ni[b[i] * 2]) % mod + mod + mod) % mod;
    }
    cout << (ans * ni[2]) % mod << endl;
    return 0;
}

Measured memory_bytes: 196864
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    int n;cin >> n;
    vi a(n);
    int ma = -1;
    rep(i, n) {
        cin >> a[i];
        // chmax(ma,a[i]);
    }
    sort(all(a));
    vi rui(n+1);
    rui[0] = 0;
    rep(i, n) {
        rui[i+1]+=rui[i]+a[i];
    }
    int count = 1;
    rep1(i, n-1) {
        if(rui[i]*2>=rui[i+1]-rui[i]) count++;
        else count = 1;
    }
    // for(auto p:rui)cout << p << ' ';
    // cout << endl;
    cout << count << endl;
    /*int count = 0;
    rep(i, n) {
        if(a[i]*2>=ma) count++;
    }
    cout << count << endl;*/
    return 0;
}

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

int main(){
  ll n;cin >> n;
  
  vector<ll> a(n);//要素nの配列
  for(ll i=0;i<n;++i) cin >> a.at(i);
  sort(a.begin(),a.end());//小さい順にソート
  reverse(a.begin(),a.end());//配列逆順にする

  ll ans = 0;
  ll cnt = 1;
  for(ll i=0;i<n;++i){
    if( i == 0 ){
      ans += a.at(i);
      cnt++;
      if( cnt == n ) break;
      continue;
    }

    ans += a.at(i);
    cnt++;
    if( cnt == n ) break;

    ans += a.at(i);
    cnt++;
    if( cnt == n ) break;
  }

  cout << ans << endl;
  
  return 0;
}



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

v = list(map(int, input().split()))
v.append(0)

def dfs(l, r):
  #print(l, r)
  if l == r:
    return 0

  for i in range(l, r):
    v[i] = max(0, v[i] - 1)

  last = l
  res = 1
  for i in range(l, r):
    if v[i] == 0:
      res += dfs(last, i)
      last = i + 1
  res += dfs(last, r)
  return res

last = 0
res = 0
for i in range(0, n + 1):
  if v[i] == 0:
    res += dfs(last, i)
    last = i + 1
#print(v)
print(res)


Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int a,b;
char ch;
int main()
{
    cin>>a>>ch>>b;
    switch(ch)
    {
        case'+':
        {
            cout<<a+b<<endl;
            break;
        }
        case'-':
        {
            cout<<a-b<<endl;
            break;
        }
        default:
        {
            cout<<"??ASASADSSDDSDSD";
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;
using static System.Array;

class MainClass : Scanner
{
    static void Main()
    {
        string S = RString();
        string T = RString();
        int N = S.Length;
        int M = T.Length;
        var ans = 10000;
        for (int i = 0; i < N-M+1; i++)
        {
            int cnt = 0;
            for (int j = 0; j < M; j++)
            {
                if (S[i + j] != T[j]) cnt++;
            }
            ans = Min(ans, cnt);
        }
        WriteLine(ans);
    }
}

class Scanner
{
    public static int RInt() => int.Parse(Console.ReadLine());
    public static long RLong() => long.Parse(Console.ReadLine());
    public static string RString() => Console.ReadLine();
    public static double RDouble() => double.Parse(Console.ReadLine());

    public static int[] RInts() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
    public static int[] RInts(Func<string, int> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static long[] RLongs() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
    public static long[] RLongs(Func<string, long> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static double[] RDoubles() => Array.ConvertAll(Console.ReadLine().Split(), double.Parse);
    public static double[] RDoubles(Func<string, double> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static string[] RStrings() => Console.ReadLine().Split();
    //public static string[] RStrings(Func<string, string> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static T1 ReadStream<T1>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        return r1;
    }
    public static (T1, T2) ReadStream<T1, T2>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        return (r1, r2);
    }
    public static (T1, T2, T3) ReadStream<T1, T2, T3>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        return (r1, r2, r3);
    }
    public static (T1, T2, T3, T4) ReadStream<T1, T2, T3, T4>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        var r4 = (T4)Convert.ChangeType(r[3], typeof(T4));
        return (r1, r2, r3, r4);
    }
}

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

int main() {
  int w, n;
  int x[30];
  int a, b, tmp;

  cin >> w;
  cin >> n;
  for (int i=0; i<w; i++) {
    x[i] = i+1;
  }
  for (int i=0; i<n; i++) {
    scanf("%d,%d", &a, &b);
    --a; --b;
    tmp = x[a];
    x[a] = x[b];
    x[b] = tmp;
  }
  for (int i=0; i<w; i++) {
    cout << x[i] << endl;
  }
}

Measured memory_bytes: 1240
#include <stdio.h>

int main()
{
    char c, res;

    scanf("%c", &c);

    switch (c) {
        case 'A':
            res = 'T';
            break;
        case 'T':
            res = 'A';
            break;
        case 'C':
            res = 'G';
            break;
        case 'G':
            res = 'C';
            break;
    }

    printf("%c\n", res);

    return 0;
}


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

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

    bool flag = true;
    for (int i = A; i < B+1; i++) {
        if (i % K == 0) {
            cout << "OK" << endl;
            flag = false;
        }
        if (flag == false) break;
    }
    if (flag) cout << "NG" << endl;
}

Measured memory_bytes: 3636
import Control.Monad
import Control.Applicative

solve :: [String] -> [String]
solve [] = []
solve (line:lines) =
    let [a,op,b] = words line in
    case (go (read a) op (read b)) of
    Just x -> show x : solve lines
    Nothing -> []
    where
    go :: Int -> String -> Int -> Maybe Int
    go a "+" b = Just $ a + b
    go a "-" b = Just $ a - b
    go a "*" b = Just $ a * b
    go a "/" b = Just $ a `div` b
    go _ _ _ = Nothing

main = 
    mapM_ putStrLn =<< solve . lines <$> getContents 


Measured memory_bytes: 3960
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int r = sc.nextInt();
		int u = x - r;
		int e = x + r;
		int f = y - r;
		int l = y + r;
		if (r <= x && r <= y && e <= W && l <= H) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}



Measured memory_bytes: 26320
use std::io::stdin;

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let mut itr = s.split_whitespace().map(|e| e.parse::<i64>().unwrap());
    let a: i64 = itr.next().unwrap();
    let b: i64 = itr.next().unwrap();
    let c: i64 = itr.next().unwrap();
    let d: i64 = itr.next().unwrap();

    let t = (c + b - 1) / b;
    let u = (a + d - 1) / d;

    println!("{}", if u >= t { "Yes" } else { "No" });
}


Measured memory_bytes: 2168
#include <stdio.h>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <queue>
#include <array>
#include <bitset>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<pii> vii;
typedef vector<string> vs;

int main() {
  string s;
  cin >> s;
  cout << s.substr(0, 4) << " " << s.substr(4) << endl; 
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
#define int int64_t
const int M = 1e4 + 5;
int n, m, a[M], dp[M];
int d[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
vector <int> ans;

int32_t main() 
{ 
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n >> m;
    	int curr = 0;
    	for(int i = 1; i <= m; i++)	cin >> a[i];
    	for(int i = 1; i <= n; i++)	dp[i] = -1e9;
    	for(int i = 2; i <= n; i++)
    	{
    		for(int j = 1; j <= m; j++)
    		{
    			if(d[a[j]] <= i)
    				dp[i] = max(dp[i], 1 + dp[i - d[a[j]]]);
    		}
    	}
    	sort(a + 1, a + m + 1, greater <int> ());
    	int rem = n;
    	for(int i = 1; i <= dp[n]; i++)
    	{
    		for(int j = 1; j <= m; j++)
    		{
    			if(rem >= d[a[j]] && dp[rem] == 1 + dp[rem - d[a[j]]])
    			{
    				rem -= d[a[j]];
    				cout << a[j];
    				break;
    			}
    		}
    	}
	return 0; 
} 									

Measured memory_bytes: 384
p = 'ACGT'
s = input()
l = len(s)
r = 0
i = -1
while i < l:
 i = next((i for i in range(i + 1, l) if s[i] in p), l)
 j = next((i for i in range(i + 1, l) if s[i] not in p), l)
 r = max(r, j - i)
 i = j
print(r)


Measured memory_bytes: 3064
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
a = set(blue)
ans = []
for i in a:
  b = 0
  for j in range(n):
    if blue[j] == i:
      b += 1
  for j in range(m):
    if red[j] == i:
      b -= 1
  ans.append(b)
print(max(0, max(ans)))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<int, int>
#define F first
#define S second
#define mod 1000000007
#define MOD 998244353
#define INF 40000000000000000
int dx8[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int dy8[8] = {1, 1, 1, 0, -1, -1, -1, 0};
int dx4[4] = {-1, 0, 1, 0};
int dy4[4] = {0, -1, 0, 1};
template <class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
int gcd(int a, int b) {
    if(b == 0) return a;
    return gcd(b, a % b);
}
signed main() {
    int K;
    cin >> K;
    int ans = 0;
    rep(i, K) rep(j, K) rep(k, K) {
        ans += gcd(i + 1, gcd(j + 1, k + 1));
    }
    cout << ans << endl;
}


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

int main()
{
  ll n, a, b;
  cin >> n >> a >> b;
  ll amari = (n % (a + b));
  ll ans = (n / (a + b)) * a;
  if (amari > a)
  {
    ans += a;
  }
  else
  {
    ans += amari;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3624
n = int(input())
a_s = [int(input()) for _ in range(n)]


a_max = max(a_s)
i_max_arg = a_s.index(a_max)
del a_s[i_max_arg]

#2番目に大きい値
a_max2 = max(a_s)    

for i in range(n):
  if i != i_max_arg:
    ans = a_max
  else:
    ans = a_max2
  print(ans)

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

int main(){
    int n; cin >> n;
    int a[2][n];
    for(int i=0; i<2; i++){
        rep(j, n) cin >> a[i][j];
    }
    int ans = 0;
    for(int i=0; i<n; i++){
        int tmp = 0;
        for(int j=0; j<=i; j++) tmp += a[0][j];
        for(int j=i; j<n; j++) tmp += a[1][j];
        ans = max(ans, tmp);
    }
    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
typedef long long ll;
typedef long double ld;
using namespace std;

pair<ll, ll> xd[200010];
int nx[200010];
ll dp[200010], mod=998244353;

const int SIZE=(1<<20);
struct RMQ{
	int data[SIZE*2]={};
	void update(int n, int x){
		n += SIZE-1;
		data[n]=x;
		while(n>0){
			n=(n-1)/2;
			data[n]=max(data[n*2+1], data[n*2+2]);
		}
	}
	int query(int a, int b, int k, int l, int r){
		if(b<=l || r<=a) return -1;
		if(a<=l && r<=b) return data[k];
		else return max(query(a, b, k*2+1, l, (l+r)/2), query(a, b, k*2+2, (l+r)/2, r));
	}
};


int main() {
	int N;
	cin >> N;
	for(int i=0; i<N; ++i) cin >> xd[i].first >> xd[i].second;
	sort(xd, xd+N);
	xd[N]=make_pair(1e18, 0);
	RMQ segt;
	for(int i=0; i<N; ++i) segt.update(i, i);
	for(int i=N-1; i>=0; --i){
		int ok=i, ng=N;
		while(ok+1<ng){
			int mid=(ok+ng)/2;
			if(xd[mid].first<xd[i].first+xd[i].second) ok=mid;
			else ng=mid;
		}
		nx[i]=segt.query(i, ng, 0, 0, SIZE);
		segt.update(i, nx[i]);
	}
	dp[N]=1;
	for(int i=N-1; i>=0; --i){
		dp[i]=(dp[i+1]+dp[nx[i]+1])%mod;
	}
	cout << dp[0] << endl;
	return 0;
}

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

int main(int argc, char *argv[]) {
  int n, k;
  std::cin >> n >> k;
  std::vector<int> p(n);
  for (int i = 0; i < n; ++i)
    std::cin >> p.at(i);

  std::sort(p.begin(), p.end());

  int sum = 0;
  for (int i = 0; i < k; ++i)
    sum += p.at(i);
  std::cout << sum << std::endl;
}


Measured memory_bytes: 3160
s=list(input())
booler=True
while s!=[] and booler==True:
  if s[-5]=="d" and s[-4]=="r" and s[-3]=="e" and s[-2]=="a" and s[-1]=="m":
    for i in range(5):
      del s[-1]
  elif s[-5]=="e" and s[-4]=="r" and s[-3]=="a" and s[-2]=="s" and s[-1]=="e":
    for i in range(5):
      del s[-1]
  elif s[-6]=="e" and s[-5]=="r" and s[-4]=="a" and s[-3]=="s" and s[-2]=="e" and s[-1]=="r":
    for i in range(6):
      del s[-1]
  elif s[-7]=="d" and s[-6]=="r" and s[-5]=="e" and s[-4]=="a" and s[-3]=="m" and s[-2]=="e" and s[-1]=="r":
    for i in range(7):
      del s[-1]
  else:
    booler=False
if booler:
  print("YES")
else:
  print("NO")

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

long long power(int m, int n) { // m^n
    if (n == 0) return 1;
    if (n % 2 == 1) return m * power(m, n - 1) % mod;
    long long r = power(m, n / 2);
    return r * r % mod;
}
long long inv(int a, int b) { // a/b(mod)
    return a * power(b, mod-2) % mod;
}
struct combination {
    int MAX;
    vector<long long> fact;
    combination(int _n) {
        MAX = _n;
        fact.resize(MAX + 1, 0); // 階乗
        for (int i = 0; i <= MAX; i++) {
            if (i == 0) fact[i] = 1;
            else fact[i] = i * fact[i-1] % mod;
        }
    }
    long long perm(int n, int r) { // nPr
        if (n < r) return 0;
        return inv(fact[n], fact[n-r]);
    }
    long long comb(int n, int r) { // nCr
        if (n < r) return 0;
        return inv(perm(n, r), fact[r]);
    }
    long long pie(int n, int k) { // 包除原理
        long long s = 0;
        for (int i = 0; i < k; i++) {
            s += power(-1, i) * comb(k, i) * power(k-i, n);
            s %= mod;
            if (s < 0) s += mod;
        }
        return s;
    }
};

int main() {
    combination c((int)1e5);
    int n, m;
    cin >> n >> m;
    if (abs(n - m) > 1) {
        cout << 0 << endl;
        return 0;
    }
    ll r = (c.fact[n] * c.fact[m]) % mod;
    if (n == m) {
        r *= 2;
        r %= mod;
    }
    cout << r << endl;
}

Measured memory_bytes: 3872
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>

#define N_MAX 100000

using namespace std;

typedef pair<int, int> P;

struct edge{
    int to;
    int len;
};
//s:グラフの頂点数
//1から始める
long prim(vector<edge> G[], bool appended[], int s){
    priority_queue<P, vector<P>, greater<P>> que;
    long ans = 0;
    //init tree
    for(int i = 1; i <= s; i++){
        appended[i] = false;
    }
    appended[1] = true;
    for(int i = 0; i < G[1].size(); i++){
        que.push(P(G[1][i].len, G[1][i].to));
        //cout << G[1][i].len << ' ' << G[1][i].to << endl;
    }
    
    while(!que.empty()){
        P top = que.top();
        que.pop();
        //cout << top.second << endl;
        if(!appended[top.second]){
            //cout << top.first << ' ' << top.second << endl;
            ans += top.first;
            appended[top.second] = true;
            
            for(int i = 0; i < G[top.second].size(); i++){
                que.push(P(G[top.second][i].len, G[top.second][i].to));
                //cout << G[top.second][i].len << ' ' <<  G[top.second][i].to << endl;
            }
        }
    }
    return ans;
}

int main(){
    int N;
    //long ans;
    vector<edge> G[N_MAX+1];
    cin >> N;
    P X[N_MAX+1], Y[N_MAX+1];
    bool appended[N_MAX+1];
    for(int i = 1; i <= N; i++){
        int x, y;
        cin >> x >> y;
        X[i] = P(x, i);
        Y[i] = P(y, i);
    }
    sort(X+1, X+N+1);
    sort(Y+1, Y+N+1);
    //init graph
    for(int i = 1; i <= N-1; i++){
        edge edge1, edge2;
        edge1.to = X[i+1].second;
        edge1.len = X[i+1].first - X[i].first;
        edge2.to = Y[i+1].second;
        edge2.len = Y[i+1].first - Y[i].first;
        G[X[i].second].push_back(edge1);
        G[Y[i].second].push_back(edge2);
        //逆の辺
        edge1.to = X[i].second;
        edge1.len = X[i+1].first - X[i].first;
        edge2.to = Y[i].second;
        edge2.len = Y[i+1].first - Y[i].first;
        G[X[i+1].second].push_back(edge1);
        G[Y[i+1].second].push_back(edge2);
    }
    
    cout << prim(G, appended, N) << endl;
}

Measured memory_bytes: 11636
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
typedef vector<int> Node;
typedef vector<Node> Graph;
typedef pair<int, int> P;
P dfs(int u, int c, Graph& G, vector<int>& color){
  P res;
  if(color[u] != -1){
    if(color[u] == c) return P(0, 0);
    else return P(INF, INF);
  }else{
    color[u] = c;
    if(c == 0) res.first ++;
    else res.second ++;
  }
  REP(i, G[u].size()){
    int v = G[u][i];
    P p = dfs(v, c ^ 1, G, color);
    if(p.first >= INF) return P(INF, INF);
    res = P(res.first + p.first, res.second + p.second);
  }
  return res;
}

int main(){
  int V, E;
  while(cin >> V >> E && V){
    Graph G(V);
    REP(i, E){
      int a, b;
      scanf("%d %d", &a, &b);
      a--; b--;
      G[a].push_back(b);
      G[b].push_back(a);
    }
    vector<int> color(V, -1);
    vector<P> ps;
    int ans = 0;
    REP(i, V) if(color[i] == -1){
      P p = dfs(i, 0, G, color);
      if(p.first >= INF) ans = -1;
      ps.push_back(p);
    }
    if(ans == -1){
      cout << ans << endl;
      continue;
    }
    map<int, int> cnt;
    int sum = 0;
    REP(i, ps.size()){
      int a = min(ps[i].first, ps[i].second);
      int b = max(ps[i].first, ps[i].second);
      sum += a;
      if(b - a > 0) cnt[b - a]++;
    }
    vector<P> goods;
    FORIT(it, cnt) goods.push_back(P(it->first, it->second));
    vector<bool> dp(V / 2 - sum + 1, false);
    dp[0] = true;
    int max_c = 0;
    REP(i, goods.size()){
      int num = goods[i].second;
      for(int k = 1; num > 0; k <<= 1) {
        int s = min(num, k);
        num -= s;
        for(int j = dp.size() - 1; j >= 0; j--)if(dp[j]){
          int nj = j + goods[i].first * s;
          if(nj < dp.size()){
            max_c = max(max_c, nj);
            dp[nj] = true;
          }
        }
      }
    }
    max_c += sum;
    cout << (ll)max_c * (V - max_c) - E << endl;
  }
  return 0;
}

Measured memory_bytes: 7728
#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
#include <cassert>
#include <unordered_map>
#include <chrono>
#include <random>
#include <ctime>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ld PI = 3.14159265358979323846;
const ll MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	srand(time(0));
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n + 1, 1);
	ll ans = 1;
	for (int i = 2; i <= n; i++) {
		for (int j = i; j <= n; j += i) {
			a[j]++;
		}
		ans += 1LL * i * a[i];
	}
	cout << ans;
}

Measured memory_bytes: 42260
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#define LL long long
#define Set(s,v) memset(s,v,sizeof(s))
using namespace std;
inline LL read(){
    LL ans=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-'){f=-1;}ch=getchar();}
    while(ch>='0'&&ch<='9'){ans=(ans<<3)+(ans<<1)+(ch^48);ch=getchar();}
    return ans*f;
}
void write(LL x){
    if(x<0){putchar('-');x=-x;}
    if(x>9){write(x/10);}
    putchar(x%10|48);
}
int n;
int main(){
    n=read();
    if(n-(n&-n)==0){
        printf("No\n");
        return 0;
    }
    printf("Yes\n");
    if(n&1){
        for (int i=2;i<=n;i++){
            printf("%d %d\n",1,i);
            printf("%d %d\n",i,(i^1)+n);
            if(i==2){
                printf("%d %d\n",(i^1)+n,n+1);
            }
        }
    }else{
        int temp=n;
        while(temp-(temp&-temp)!=0) temp-=(temp&-temp);
        for (int i=2;i<n;i++){
            printf("%d %d\n",1,i);
            printf("%d %d\n",i,(i^1)+n);
            if(i==2){
                printf("%d %d\n",(i^1)+n,n+1);
            }
            if(i==temp+1){
                printf("%d %d\n",i,n);
            }
            if(i==(n^temp)){
                printf("%d %d\n",i,n+n);
            }
        }
    }
    return 0;
}

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

using ll = long long;
using namespace std;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
ll MOD=1e9+7;


int main(){
  int X,N;
  cin>>X>>N;
  vector<int> p(N);
  for(int i(0);i<N;i++){
    cin>>p[i];
  }
  int ans(0), sa(1e9);
  for(int i(-100);i<130;i++){
    bool flag(false);
    for(int j(0);j<N;j++){
      if(i == p[j]) flag = true;
    }
    if(flag == false){
      if(abs(X-i) < sa){
        sa = abs(X-i);
        ans = i;
      }
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long INF = 1LL << 60;
template <class T> bool chmin(T& a, T b){if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b){if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}

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

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);
            int count = 0;
            for(int i = a;i <= b;i++)
            {
                if(c%i == 0)
                {
                    count++;
                }
            }
            Console.WriteLine(count);

        }
    }
}


Measured memory_bytes: 17932
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    // 左右それぞれの自分より大きいもの2つ
    // 大きいものから順にsetに入れていく
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    rep(i, N) A[i]--;
    vector<int> idx(N);
    rep(i, N) idx[A[i]] = i;
    ll ans = 0;
    set<int> st;
    for (int x = N-1; x >= 0; x--) {
        int i = idx[x];
        st.insert(i);
        vector<int> lpos(2, -1);
        vector<int> rpos(2, N);
        {
            auto it = st.find(i);
            rep(j, 2) {
                if (it == st.begin()) break;
                it--;
                lpos[j] = *it;
            }
        }
        {
            auto it = st.find(i);
            rep(j, 2) {
                it++;
                if (it == st.end()) break;
                rpos[j] = *it;
            }
        }
        vector<int> Llen(2);
        vector<int> Rlen(2);
        Llen[0] = i - lpos[0]; Llen[1] = lpos[0] - lpos[1];
        Rlen[0] = rpos[0] - i; Rlen[1] = rpos[1] - rpos[0];
        ll coef = (ll)Llen[0] * Rlen[1] + (ll)Llen[1] * Rlen[0];
        ans += coef * (x+1);
    }
    cout << ans << '\n';
    return 0;
    // ll, 0, -, 1i, for s&g, debug
}

Measured memory_bytes: 8620
// AtCoder ABC126: B - YYMM or MMYY
// 2019.9.8 bal4u

#include <stdio.h>

int main()
{
	int a, b;
	char S[10];
	
	scanf("%s", S);
	a = (S[0] & 0xf)*10 + (S[1] & 0xf);
	b = (S[2] & 0xf)*10 + (S[3] & 0xf);
	if (a >= 1 && a <= 12 && b >= 1 && b <= 12) puts("AMBIGUOUS");
	else if (a >= 1 && a <= 12 && b >= 0 && b <= 99) puts("MMYY");
	else if (a >= 0 && a <= 99 && b >= 1 && b <= 12) puts("YYMM");
	else puts("NA");
	return 0;
}


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

typedef long long ll;

ll calc(ll A) {
    if (A <= 0) {
        return 0;
    }

    A++;
    long long res = 0;
    for (int i = 0; i < 40; i++) {
        ll loop = 1LL << (i + 1);
        ll cnt = (A / loop) * (loop / 2);
        cnt += max(0LL, (A % loop) - (loop / 2));

        if (cnt % 2 == 1) {
            res += 1LL << i;
        }
    }

    return res;
}

int main() {
    ll A, B;
    cin >> A >> B;
    ll res = calc(B) ^ calc(A - 1);
    cout << res << endl;
}

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

int main(){
  int a,b; cin>>a>>b;
  
  int c=a+b;
  int d=a-b;
  int e=a*b;
  
  int res=max(c,d);
  res=max(res,e);
  
  cout<<res<<endl;
}

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> a(n);

  priority_queue<int> q;
  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
    q.push(a[i]);
  }

  for (int i = 0; i < m; i++)
  {
    int s = q.top();
    q.pop();
    q.push(s/2);
  }

  long long ans = 0;
  for (int i = 0; i < n; i++)
  {
    int s = q.top();
    q.pop();
    ans+=(long long) s;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 1276
//     **********            ***       ***         ************     ***    ***
//     **********          *     *   *     *       ************     ***   ***
//        ***             *        *        *          ***          ***  ***
//        ***            *                   *         ***          *** ***
//        ***            *                   *         ***          ******
//        ***            *                   *         ***          ******
//        ***             *                 *          ***          *** ***
//        ***              *               *           ***          ***  ***
//     **********           *             *            ***          ***   ***
//     **********             *          *             ***          ***    ***
//                              *       *
//                                *   *
//                                  *
//
#include <iostream>
using namespace std;
#include<bits/stdc++.h> 
#define ll long long int
#define read(a) long long int a; cin>>a;
#define readstr(s) string s; cin>>s;
#define readarr(a,l) long long int a[l]={0}; for(ll i=0;i<l;i++) cin>>a[i];
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define ff first
#define ss second
#define readmtrx(i,j,a,b) ll arr[a][b]={0};for(ll i=0;i<a;i++)for(ll j=0;j<b;j++) cin>>arr[i][j];
#define v(pi) vector<ll>pi
#define vp(pi) vector<pair<ll,ll>>pi
#define fast ios_base::sync_with_stdio(false);cin.tie(0);
#define pb(p) push_back(p)
#define mp make_pair
#include <cmath>
int main() {
	fast;read(a);
	cout<<pow(a,3)<<endl;
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MAX=1e9;
ll mod=998244353 ;
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
//#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define se second
#define fi first
#define maxe max_element
#define mine min_element
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define boost  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//#define SIZE 5000 + 1

long long expo(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return expo((x*x)%M,n/2,M)%M;
    else                             //n is odd
        return (x*expo((x*x)%M,(n-1)/2,M))%M;

}
bool is_pali(string s)
{
    int n=s.length();
    for(int i=0;i<(s.length()/2);i++)
    {
        if(s[i]!=s[n-1-i])return false;
    }
    return true;
}

void solve()
{
ll n;
cin>>n;
vector<ll> a(n);
map<ll,ll> mp;
for(int  i=0;i<n;i++){cin>>a[i];mp[a[i]]++;}
ll ans=0;
set<ll> st;
for(int i=0;i<n;i++)
{
    if(st.find(a[i])==st.end())
        ans=ans+(mp[a[i]]*(mp[a[i]]-1))/2;
    st.insert(a[i]);
}
//debug(ans);
for(int i=0;i<n;i++)
{
    ll tt=mp[a[i]];
    ll temp=ans-((tt*(tt-1))/2)+(((tt-1)*(tt-2))/2);
    cout<<temp<<endl;
}
}

int main(){
    boost;
  solve();
}


Measured memory_bytes: 17024
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define INF 999999999
using namespace std;

int main(){
    int n; cin >> n;
    cout << (24 - n) + 24 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
        int i,j;
        for(i = 1; i <= 9 ; i++){
                for(j = 1; j<= 9 ; j++){
                        printf("%dx%d=%d\n", i, j, i*j);
                }   
        }   
        return 0;
}

Measured memory_bytes: 0
using System;
 
class Program
{
  static void Main(string[] args)
  {
    string[] input = Console.ReadLine().Split(' ');
    int x = int.Parse(input[0]);
    int y = int.Parse(input[1]);
    
    if(x == 4 || x == 6 || x == 9 || x == 11) x = 1;
    else if(x == 2) x = 2;
    else x = 3;
    
    if(y == 4 || y == 6 || y == 9 || y == 11) y = 1;
    else if(y == 2) y = 2;
    else y = 3;
    
    if(x == y) Console.WriteLine("Yes");
    else Console.WriteLine("No");
  }
}

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

int SumOfEveryone(int n){
    int sum = 0;
    while(n>0){
        sum += (n % 10);
        n /= 10;
    }
    return sum;
}

int main(){
    int N;
    cin >> N;
    int min_sum = 99999;
        for(int i=1; i < N; ++i){
            min_sum = min(min_sum, SumOfEveryone(i) + SumOfEveryone(N-i));
        }
    cout << min_sum << endl;
    }

Measured memory_bytes: 256
#include <stdio.h>
int main(){
int a,b,c,i,num;
num=0;
scanf("%d %d %d\n",&a,&b,&c);
for (i=a;i<=b;i++){
if (c%i==0){num=num+1;}}
printf("%d\n",num);
return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;
typedef long long ll;

int main(){

    int n; cin >> n;

    int s[n];
    for(int i=0; i<n; i++){
        cin >> s[i];
    }

    sort(s, s+n);

    int sum = accumulate(s, s+n, 0);

    vector<int> not10m;

    if(sum % 10 == 0){
        for(int i=0; i<n; i++){
            if(s[i] % 10 != 0){
                not10m.push_back(s[i]);
            }
        }
        if(not10m.size() != 0){
            sum -= not10m[0];
        }
        else{
            sum = 0;
        }
    }

    

    cout << sum;

    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
m = int(input())
b = list(map(int,input().split()))
ans = 0
for i in range(min(n,m)):
    if a[i] < b[i]:
        ans = 1
        break
    elif a[i] > b[i]:
        break
else:
    if n < m:
        ans = 1

print(ans)


Measured memory_bytes: 5628
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	string s1[7] = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
	string s2;
	cin >> s2;
	if (s2 == s1[0])
		cout << "7";
	else 
		if (s2 == s1[1])
			cout << "6";
		else if (s2 == s1[2])
			cout << "5";
		else if(s2==s1[3])
			cout<<"4";
		else if(s2==s1[4])
			cout<<"3";
		else if (s2 == s1[5])
			cout << "2";
		else if (s2 == s1[6])
			cout << "1";
		
	
		
}

Measured memory_bytes: 256