akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
using namespace std;
const int oo=1000000007;
int n,m,o,c[110],a[110][110];
int b[110];
int cclt(int x){
	for(int i=1;i<=m;++i)  b[i]=0;
	int bwl=0;
	for(int i=1;x;x>>=1,++i)if(x&1){
		bwl+=c[i];
		for(int j=1;j<=m;++j)
			b[j]+=a[i][j];
	}
	for(int i=1;i<=m;++i)if(b[i]<o)
		return oo;
	return bwl;
}
int main(){
	cin>>n>>m>>o;
	for(int i=1;i<=n;++i){
		scanf("%d",&c[i]);
		for(int j=1;j<=m;++j)
			scanf("%d",&a[i][j]);
	}
	int ans=oo;
	for(int i=0;i<(1<<n);++i)
		ans=min(ans,cclt(i));
	cout<<(ans==oo ? -1 : ans)<<endl;
	return 0;
}




Measured memory_bytes: 3740
L=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())
print(L[K-1])

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define UM unordered_map
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const ll INF = 1LL << 58;
const ll MOD = 1000000007;
typedef vector<pii> vpii;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

signed main()
{
    int H, W, N;
    int r, c;
    string S, T;
    cin >> H >> W >> N;
    cin >> r >> c;
    cin >> S >> T;
    int tr, tc;
    tr = r;
    tc = c;
    r = tr;
    c = tc;
    REP(i, N)
    {
        if (S[i] == 'R')
            c++;
        if (c > W)
        {
            cout << "NO" << endl;
            return 0;
        }
        if (T[i] == 'L')
        {
            c--;
            c = max(1LL, c);
        }
    }
    r = tr;
    c = tc;
    REP(i, N)
    {
        if (S[i] == 'L')
            c--;
        if (c == 0)
        {
            cout << "NO" << endl;
            return 0;
        }
        if (T[i] == 'R')
        {
            c++;
            c = min(W, c);
        }
    }
    r = tr;
    c = tc;
    REP(i, N)
    {
        if (S[i] == 'D')
            r++;
        if (r > H)
        {
            cout << "NO" << endl;
            return 0;
        }
        if (T[i] == 'U')
        {
            r--;
            r = max(1LL, r);
        }
    }
    r = tr;
    c = tc;
    REP(i, N)
    {
        if (S[i] == 'U')
            r--;
        if (r == 0)
        {
            cout << "NO" << endl;
            return 0;
        }
        if (T[i] == 'D')
        {
            r++;
            r = min(H, r);
        }
    }
    cout << "YES" << endl;

    // system("pause");
}


Measured memory_bytes: 776
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, A, B = MI()
    X = LI()
    ans = 0
    for i in range(N-1):
        ans += min(A * (X[i+1]-X[i]), B)
    print(ans)

if __name__ == '__main__':
    solve()



Measured memory_bytes: 20040
function main (input) {
  var num = Number(input);//.split("\n").pop();
  var numofodd = getOddNumber(num);
      
  function getOddNumber(num) {
  	var isEven = num % 2 === 0 ? true : false;
    if(isEven) return Math.floor(num / 2);
    else return Math.floor(num / 2)+1;
  }
   var a = parseFloat(numofodd/num);
  console.log(a.toFixed(10));

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11468
#include<bits/stdc++.h>
#define endl "\n"

typedef long long ll;
using namespace std;

//ll const N = 32000;
int freq[26];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

    int N, D, cnt = 0;
    cin >> N >> D;

    while(N--)
    {
        ll X, Y;
        cin >> X >> Y;

        if(sqrt(X * X + Y * Y) <= D)cnt++;
    }

    cout << cnt;

    return 0;
}


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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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; }

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll n,k; cin>>n>>k;
  vll a(n); rep(i,n) cin>>a[i];
  
  rep(ki,k){
    vll s(n+1);
    rep(i,n){
      ll l=max(0LL, i-a[i]);
      ll r=min(n, i+a[i]);
      s[l]++;
      if(r+1<n) s[r+1]--;
    }
    rep(i,n) s[i+1]+=s[i];
    rep(i,n) a[i]=s[i];
    
    bool flg=false;
    rep(i,n) if(a[i]!=n) flg=true;
    if(!flg){
      rep(i,n) cout<<n<<' ';
      cout<<endl;
      return 0;
    }
  }
  
  rep(i,n) cout<<a[i]<<' ';
  cout<<endl;
  
}

Measured memory_bytes: 6340
/**
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;


using ll = long long;

#define int ll


const int N = 2e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);


template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n, k, h[N];
main() {
    file("time");
    ios;
    cin >> n >> k;
    fo(i, 1, n, 1) cin >> h[i];
    sort(h + 1, h + n + 1, greater <int> ());
    int ans = 0;
    fo(i, k + 1, n, 1) ans += h[i];
    cout << ans;
    cerr << "\nTime elapsed: " << (clock() + 0.0) / CLOCKS_PER_SEC;
    return 0;
}
/**

*/


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main() {
  string ns;
  getline(cin, ns);
  int a = 0, b = 1;
  for (auto c : ns) {
    int d = c - '0';
    int a_ = min(a + d, b + 10 - d);
    b = min(a + d + 1, b + 9 - d);
    a = a_;
  }
  cout << a << '\n';
}


Measured memory_bytes: 1412
#include <stdio.h>

int main(int argc, char const *argv[]) {
  int n;//問題数
  int t[105];//解くのにかかる時間
  int m;//ドリンクの種類数
  int p[100];
  int x[100];//ドリンクを飲んだ時の問題を解く時間
  int i,j,sum=0;

  scanf("%d",&n );
  for(i=0;i<n;i++)scanf("%d", &t[i] );
  scanf("%d", &m);
  for(i=0;i<m;i++){
    scanf("%d %d", &p[i], &x[i] );
  }

  for(i=0;i<m;i++){
    sum = 0;
    for(j=0;j<n;j++){
      if(j == p[i] - 1){
        sum += x[i];
      }else{
        sum += t[j];
      }
    }
    printf("%d\n",sum );
  }

  return 0;
}


Measured memory_bytes: 128
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

L = [[x, i] for i, x in enumerate(A)]
L.sort()
dp = [[-1]*N for _ in range(N)]

def rec(l, r):
	if l > r:
		return 0
	if dp[l][r] >= 0:
		return dp[l][r]
	idx = r-l  # 次に選ぶ幼児
	val, i = L[idx]
	dp[l][r] = max(abs(i-l)*val + rec(l+1, r), abs(r-i)*val + rec(l, r-1))
	return dp[l][r]

print(rec(0, N-1))


Measured memory_bytes: 138736
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h=new int[n];
    for(int i=0;i<n;i++){
      h[i]=sc.nextInt();
    }
    int ans=0;
    for(int i=100;i>0;i--){
      boolean living=false;
      for(int j=0;j<n;j++){
        if(h[j]>=i){
          if(!living){
            living=true;
            ans++;
          }
        }else{
          living=false;
        }
      }
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 23508
(defn input []
  (list
    (->> (clojure.string/split (read-line) #"\s")
      (map #(Integer/parseInt %)))
    (->> (clojure.string/split (read-line) #"\s")
      (map #(Integer/parseInt %)))))

(defn TollGates [[[N M X] As]]
  (->> As
    (split-with #(< % X))
    (map count)
    (apply min)))

(->> (input)
  TollGates
  println)

Measured memory_bytes: 65072
#include <stdio.h>
int main(void) {
	int n,num,max;
	long long count;
	count = 0;

	scanf("%d",&n);
	for (int i = 0;i < n;i++) {
		scanf("%d", &num);

		if (i == 0) {
			max = num;
		}
		else if (max > num) {
			count = count + (max - num);
		}
		else if (max < num) {
			max = num;
		}
	}
	
	printf("%lld\n", count);
	return 0;
}

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

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

    int n;
    cin >> n;
    
    int a[n+2], dp[2][n+2];

    a[0] = 0;
    a[n+1] = 0;
    dp[0][0] = 0;
    dp[1][0] = 0;
    dp[1][1] = 0;

    rep1(i, n+2){
        if(i<n+1) cin >> a[i];

        dp[0][i] = dp[0][i-1] + abs(a[i] - a[i-1]);
        if(i>1) dp[1][i] = dp[0][i-2] + abs(a[i] - a[i-2]);
    }

    for (int i = 2; i < n+2; ++i){
        cout << dp[0][n+1] - (dp[0][i] - dp[1][i]) << endl;
    }
}

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

using namespace std;

// MACROS

#define ll long long
#define ull unsigned long long
#define ld long double

#define vi vector<int>
#define vll vector<ll>
#define vld vector<ld>
#define u_s unordered_set

#define pii pair<int,int>
#define pll pair<ll,ll>

#define FOR(i, n) for (ll (i) = 0; i < n; i++)
#define FORN(i, a, b) for (ll (i) = a; i < b; i++)
#define FORE(i, l) for (auto (i) : l)

#define pb push_back
#define pob pop_back
#define emp emplace

#define in(n) cin >> (n);
#define debug(n) cout << #n << ": " << n << '\n';

// FUNCTIONS

template< typename T >
inline T gcd(T a, T b) { if (b) return gcd(b, a % b); return a; }

template< typename T >
inline T ext_gcd(T a, T b, T & x, T & y) { if (a == 0) { x = 0; y = 1; return b; } T x1, y1; T g = ext_gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return g; }

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    ll a, b;	
    cin >> a >> b;
    cout << a * b / gcd(a,b) << '\n';
}



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

typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define max3(x, y, z) max(x, max(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif
using namespace std;
int main() {
  ll N;
  cin >> N;
  ll min = 99999999999999;
  for (ll i = 1; i < sqrt(N) + 5; i++) {
    if (N % i == 0) {
      if (N / i + i < min) {
        min = N / i + i;
      }
    }
  }
  cout << min-2;
  return 0;
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
for (int i = 0; i < N; i++) {
  cin >> list[i];
}
// for文
for (int i = 0; i < N; i++) {
}
//配列
vector<int> vec;
vec.at(i)
vector<vector<int>> vec(10, vector<int>(10));
sort(all(vec));
sort(all(vec), greater<int>());
    //配列の内容表示
dout << "====vecの内容====\n";
for (int i = 0; i < N; i++) dout << vec[i] << endl;
dout << "====ここまで====\n";
*/

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

int main() {
  int x,k,ans;
  cin >> k >> x;
  
  if(x+k-1 > 10000){
    for(int i = x-k+1; i <= 10000; i++) cout << i << " ";
  }
  else if(x-k+1 < -10000){
    for(int i = -10000; i < x+k; i++) cout << i << " ";
  }
  else{
    for(int i = x-k+1; i < x+k; i++) cout << i << " ";
  }
  cout << endl;
}

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

using namespace std;

int main() {
  int N; 
  cin >> N;
  vector<long long> L(N + 1);
  L[0] = 2;
  L[1] = 1;
  for (int i = 2; i < N + 1; ++i) {
    L[i] = L[i - 1] + L[i - 2];
  }
  cout << L[N] << endl;
}

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

#define rep(i,n) for(int i = 0;i < n;++i)
#define rep2(i,n,m) for(int i = n;i < m;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = 1001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    ll n,w;
    cin >> n >> w;
    if( n >= w){
        rep(i,n) cout << w;
    }else{
        rep(i,w) cout << n;
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
use std::collections::HashMap;
use std::io::stdin;

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let n: usize = s.trim().parse().unwrap();
    let mut total = 0;
    s.clear();
    stdin().read_line(&mut s).ok();
    let v: Vec<i64> = s.split_whitespace().map(|e| e.parse().unwrap()).collect();
    let mut a = HashMap::new();

    for i in v.iter() {
        *a.entry(i).or_insert(0) += 1 as i64;
    }

    for i in 1..n as i64 + 1 {
        total += comb(*a.get(&i).unwrap_or(&0));
    }

    for i in 0..n {
        let t = comb(*a.get(&v[i]).unwrap()) - comb(*a.get(&v[i]).unwrap() - 1);

        println!("{}", total - t);
    }
}

fn comb(n: i64) -> i64 {
    (n - 1) * n / 2
}


Measured memory_bytes: 18380
n,m,k = map(int,input().split())
import numpy as np
pr = []
score = []

for i in range(n):
    li = list(map(int,input().split()))
    pr.append(li[0])
    score.append(li[1:])

cnt =0
ans = 10**10
for i in range(1<<n):
    tot = np.array([0]*m)
    pr_all = 0
    for j in range(n):
        if i>>j&1:
            score[j] = np.array(score[j])
            tot +=np.array(score[j])
            pr_all +=pr[j]

    if np.all(tot >=k):
        ans = min(ans,pr_all)
        
print(ans if ans <10**10 else -1)

Measured memory_bytes: 27340
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

ll pos[200010];

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

    rep(i, n){
        ll p;
        cin >> p;
        pos[p] = i+1;
    }

    multiset<ll> st = {0, n+1};
    ll ans = 0;

    for(int i = 1; i <= n; i++){
        st.insert(pos[i]);
        auto it = st.lower_bound(pos[i]);
        auto l = prev(it);
        auto r = next(it);
        ans += i * (*it - *l) * (*r - *it);
    }

    cout << ans << endl;

    return 0;
}


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

vector<vector<int>> G;
vector<int> c;
vector<int> num;
queue<pair<int, int>> q;
int idx = 1;
int sum = 0;

void bfs(int current, int parent) {
  for (int nx : G.at(current)) {
    if (nx == parent) continue;
    num.at(nx) = c.at(idx);
    idx++;
    sum += min(num.at(current), num.at(nx));
    q.push(make_pair(nx, current));
  }
}

int main() {
  int N; cin >> N;
  G.resize(N);
  c.resize(N);
  num.resize(N);
  for (int i = 0; i < N-1; i++) {
    int a, b; cin >> a >> b;
    a--; b--;
    G.at(a).push_back(b);
    G.at(b).push_back(a);
  }
  for (int i = 0; i < N; i++) cin >> c.at(i);
  sort(c.begin(), c.end(), greater<int>());
  num.at(0) = c.at(0);
  q.push(make_pair(0, -1));
  while (!q.empty()) {
    bfs(q.front().first, q.front().second);
    q.pop();
  }
  cout << sum << endl;
  for (int i = 0; i < N-1; i++) cout << num.at(i) << " ";
  cout << num.at(N-1) << endl;
}

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

int main() {
  int h,w;
  int bH,bW;
  int sum;
  
  cin >> h >> w >> bH >> bW;
  
  sum = h * w;
  
  // 総和 - (塗る列 + 塗る行 - 重複)
  cout << sum - (h * bW + w * bH - bH * bW);
}


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

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    int A,B,C;
    cin>>A>>B>>C;
    int ans;
    if (A==B) ans = C;
    else if (B == C) ans = A;
    else ans = B;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <random>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef complex<ld> compd;
#define rep(i,n)	for(int i=0;i<n;i++)
#define srep(i,a,n)	for(int i=a;i<n;i++)
#define REP(i,n)	for(int i=0;i<=n;i++)
#define SREP(i,a,n)	for(int i=a;i<=n;i++)
#define rrep(i,n)	for(int i=n-1;i>=0;i--)
#define RREP(i,n)	for(int i=n;i>=0;i--)
#define all(a)	(a).begin(),(a).end()
#define mp(a,b)	make_pair(a,b)
#define mt	make_tuple
#define pb	push_back
#define fst	first
#define scn second
#define bicnt(x)	__buildin__popcount(x)
#define debug(x)	cout<<"debug: "<<x<<endl
#define DEBUG 0

const ll inf = (ll)1e18;
const ll mod = 1e9 + 7;
const ld eps = 1e-9;
const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };

int cnt[1 << 26];

int main() {
	string s;	cin >> s;
	int n = s.size();
	rep(i, 1 << 26)	cnt[i] = mod;
	cnt[0] = 0;
	int ret = 0;
	int id = 0;
	rep(i, n) {
		id ^= (1 << (s[i] - 'a'));
		ret = cnt[id] + 1;
		rep(j, 26) {
			int from = id ^ (1 << j);
			ret = min(ret, cnt[from] + 1);
		}
		cnt[id] = min(cnt[id], ret);
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 262788
def main():
    l = list(map(int,input().split(" ")))
    N = l[0]
    H = l[1]
    damage = []
    throwDamage = []
    for i in range(N):
        temp = list(map(int,input().split(" ")))
        damage.append(temp[0])
        throwDamage.append(temp[1])
    damage = sorted(damage,reverse=True)
    throwDamage = sorted(throwDamage,reverse=True)
    temp = 0
    count = 0
    for d in throwDamage:
        if d>damage[0]:
            temp+=d
            count+=1
            if temp>=H:
                print(count)
                exit()
    tar = H-temp
    count+=int(tar/damage[0])
    if tar%damage[0]:
        print(count+1)
    else:
        print(count)

if __name__=="__main__":
    main()

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

#define cnd(c, a, b) (c ? a : b);
#define fl(x,y,z) for(int x=y;x<z;x++)
#define fe(x,y,z) for(int x=y;x<=z;x++)
#define fge(x,y,z) for(int x=y;x>=z;x--)

#define debug(x) std::cerr << #x << " --> " << x << "\n";
#define fastIO std::ios_base::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0);
#define pb push_back
#define pob pop_back
 
#define ln '\n'
typedef long long int ll;

ll mod=1e9+7;

void decrypt() {
	int n;
  cin>>n;
  cout<<1-n<<ln;
  return;
}

int main() {
    fastIO
    int t = 1;
    // cin >> t;
    fl(i,0,t) {
    	// cout << "Case #"<< i+1 <<": ";
    	decrypt();
    }
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <list>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define p(x) cout << x << endl;
#define all(v) (v).begin(), (v).end()

#define MOD 1000000007
#define PI 3.14159265359

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

    int n, m, c;
    cin >> n >> m >> c;
    int a[n][m];
    int b[m];

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

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

    int cnt = 0;
    int num = 0;

    for (int i = 0; i < n; i++){
        num = 0;
        for (int j = 0; j < m; j++){
            num += a[i][j] * b[j];
        }
        num = num + c;
        if (num > 0){
            cnt++;
        }
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mod ((ll)1e9+7)
#define inf 0x3f3f3f3f
#define infl 0x3f3f3f3f3f3f3f3f
#define Ninf -0x3e3e3e3f
#define Ninfl -0x3e3e3e3e3e3e3e3f
#define maxx ((ll)1e5+5)
#define endl "\n"
#define time(i) cout<<"\nTime Elapsed "<<i<<" : " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
#define usefile freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define test ll t; cin>>t; while(t--)
ll exp(ll x,ll y,ll p){ ll res=1; while(y) {if(y%2) res=(res*x%p)%p; x=(x*x)%p; y/=2; } return res;}
ll expm(ll x,ll y){ ll res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}
ll add(ll x, ll y) { x += y; if (x >= mod) return x-mod; return x;}
ll sub(ll x, ll y) { x -= y; if (x < 0) return x + mod; return x;}
ll mult(ll x, ll y) { return (x * y) % mod;}
ll rev(ll x) { return expm(x, mod - 2);}
/*
bool sv[maxx]={0};    // returns 0 if a num is prime
int sp[maxx]={0};     // gives smallest prime factor of the number
void Sieve() {for(int i= 2; i< maxx; i+= 2) sv[i]=1,sp[i] = 2;sv[2]=0;for(ll i = 3; i < maxx; i += 2){if (!sv[i]){sp[i] = i;for (ll j = i; (j*i) < maxx; j += 2){if (!sv[j*i])sv[j*i] = true, sp[j*i] = i;}}}}
ll fact[maxx]={0}; // returns factorial of that number
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<maxx;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncrm(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expm(fact[r],mod-2)))%mod; res=(res*(expm(fact[n-r],mod-2)))%mod; return res;}
ll inv[maxx];   // returns the modular inverse of number
void inversify( ll m){inv[1]=1;for(int i=2;i<maxx;i++){inv[i]= m- m/i*inv[m%i]%m;}}
ll ncr(ll n,ll r,ll m){int ans=1;for (int i = 0; i < r; i++){ans=ans*(n-i)%m*inv[i+1]%m;}return ans;}
*/
signed main(){
  fast;
  //test
  {
    string str;
    cin>>str;
    int n=str.length();
    map<int,int> fre;
    fre[0]++;
    int rem=0;
    int pro=1;
    int ans=0;
    for(int i=n-1;i>=0;i--){
      int d=str[i]-'0';
      rem=d*pro+rem;
      rem%=2019;
      ans+=fre[rem]++;
      pro*=10;
      pro%=2019;
    }
    cout<<ans;
  }
  return 0;
}

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

int gcd(int a, int b) {
  int r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  int w, h, c;
  cin >> w >> h >> c;
  int g = gcd(w, h);
  cout << (w / g) * (h / g) * c << "\n";
}


Measured memory_bytes: 3104
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

int main(void) {
    ll H, W;
    cin >> H >> W;

    if (H == 1 || W == 1) {
        cout << 1 << endl;
    } else {
        cout << H * W - (H * W / 2) << endl;
    }

    return 0;
}


Measured memory_bytes: 3632
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int N;
int A[200001];
int E[400001], ne[400001], he[200001];
int V[200001], v;
void dfs(int p, int mae) {
	if (V[v - 1] < A[p]) {
		V[v++] = A[p];
		for (auto to = he[p]; to; to = ne[to]) {
			if (E[to] != mae) {
				dfs(E[to], p);
			}
		}
		he[p] = v--;
	}
	else {
		int itr = lower_bound(V, V + v, A[p]) - V;
		swap(V[itr], A[p]);
		for (auto to = he[p]; to; to = ne[to]) {
			if (E[to] != mae) {
				dfs(E[to], p);
			}
		}
		he[p] = v;
		V[itr] = A[p];
	}
}

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += 72 - dig >> 3;
	return tmp;
}
inline int getintA() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = ((tmp & ma0) ^ ma0) ? 68 - __builtin_ctzll((tmp & ma0) ^ ma0) : 0;
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += (64 - dig >> 3);
	while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
	return tmp;
}
char dn[1300000], *di = dn;
inline void putint(int X) {
	int keta = 0;
	char C[10];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}

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

	N = getint();
	rep1(i, N) A[i] = getintA();
	int k = 1;
	rep(i, N - 1) {
		int u = getint(), v = getint();
		E[k] = v;
		ne[k] = he[u];
		he[u] = k++;
		E[k] = u;
		ne[k] = he[v];
		he[v] = k++;
	}

	V[v++] = 2000000000;
	dfs(1, -1);

	rep1(i, N) putint(he[i]);
	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

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

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

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

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))
#define ALL(v) (v).begin(), (v).end()

#define DEBUG(x) cerr << #x << ": " << (x) << endl
#define DEBUG_VEC(v)                               \
  cerr << #v << ": ";                              \
  REP(__i, (v).size()) cerr << ((v)[__i]) << ", "; \
  cerr << endl

const ll MOD = 1000000007ll;

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

  int res = 0;
  REP(i, n) {
    int k = i + 1;
    string s = to_string(k);
    if (s.size() % 2 != 0) {
      res++;
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

count = 0
for b in range(len(A)-1):
    for a in range(0,len(A)-1-b):
        if A[-a-1] < A[-a-2]:
            A[-a-1],A[-a-2] = A[-a-2],A[-a-1]
            count += 1

print(' '.join(list(map(str,A))))
print(count)



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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;cin>>n>>m;
  priority_queue<int,vector<int>,greater<int>> pq;
  rep(i,n){
      int s;cin>>s;
      pq.push(s);
  }
  priority_queue<P> a;   
  rep(i,m){
      int s,t;cin>>t>>s;
      a.push(make_pair(s,t));
  }
  while(!a.empty()){
      P k=a.top();a.pop();
      while(k.second>0){
          int j=pq.top();pq.pop();
          if(j>=k.first){
              pq.push(j);
              break;
          }
          j=k.first;
          k.second--;
          pq.push(j);
      }
  }
  ll tot=0;
  while(!pq.empty()){
       tot+=pq.top();pq.pop();
  }
  cout<<tot<<endl;
  return 0;
  }


Measured memory_bytes: 1784
using System;
using System.Collections.Generic;

namespace Ex160424_1{
    public class Program{
        public static void Main(string[] args){
            var input = Console.ReadLine().Split();
            var stack = new Stack<int>();

            foreach(var s in input){
                if(s.Equals("+")) stack.Push(+ stack.Pop() + stack.Pop());
                else
                if(s.Equals("-")) stack.Push(- stack.Pop() + stack.Pop());
                else
                if(s.Equals("*")) stack.Push(+ stack.Pop() * stack.Pop());
                else
                    stack.Push(int.Parse(s));
            }

            Console.WriteLine(stack.Pop());
        }
    }
}

Measured memory_bytes: 9988
#include<bits/stdc++.h>
#include <algorithm> 
#define pb push_back
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
#define skip continue
#define NAME "code"

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef long double ld;

void faster(){
  	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
	cout.tie(NULL);
}

const int MAXN = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

ll n, a[MAXN], sum;

int main(){
	faster();

	cin >> n;

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

	if(sum % 2 == 0) cout << "YES";
	else cout << "NO";

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>
#include <chrono>
#include <stack>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 &y) {if (x < y) x = y;}


#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e15;
    // const int mod = 2600000069;
    // const int p = 10;
    // const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e15;
    // const int mod = 2600000069;
    // const int p = 179;
    // const ld PI = 3.1415926535;
#endif

// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,sse3,sse4")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("fast-math")
// #pragma GCC target("avx2")
// #pragma GCC optimize("section-anchors")
// #pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
// #pragma GCC optimize("vpt")
// #pragma GCC optimize("rename-registers")
// #pragma GCC optimize("move-loop-invariants")
// #pragma GCC optimize("unswitch-loops")
// #pragma GCC optimize("function-sections")
// #pragma GCC optimize("data-sections")

mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for (int i = 0; i < n + 1; i++) {
        cin >> a[i];
    }
    vector<int> suf(n + 1, 0);
    suf[n] = a[n];
    for (int i = n - 1; i >= 0; i--) {
        suf[i] = suf[i + 1] + a[i];
    }
    dbg(suf)
    int cur = 0;
    vector<int> b(n + 1), c(n + 1);
    for (int i = n; i >= 0; i--) {
        b[i] = cur;
        cur += a[i];
        c[i] = cur;
        dbg(cur)
        cur = (cur + 1) / 2;
    }
    int ans = 0;
    int mx = 1;
    for (int i = 0; i <= n; i++) {
        if (mx < c[i]) {
            cout << "-1\n";
            return 0;
        }
        chkmin(suf[i], mx);
        if (i) chkmin(suf[i], b[i - 1] * 2);
        chkmax(b[i], suf[i]);
        ans += b[i];
        b[i] -= a[i];
        mx *= 2;
        chkmin(mx, INF);
    }
    dbg(b)
    dbg(c)
    cout << ans;
}
/*

*/  

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

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

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

signed main() {
    char a;
    cin >> a;
    if(a == 'A'){
        cout << 'T';
    }else if(a == 'T'){
        cout << 'A';
    }else if(a == 'G'){
        cout << 'C';
    }else if(a == 'C'){
        cout << 'G';
    }
}



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

int main(){
	int N;
	cin >> N;
	int l[N], r[N], ans=N, i;
	for(i=0; i<N; i++){
		cin >> l[i] >> r[i];
		ans += (r[i]-l[i]);
	}
	
	cout << ans << endl;
	return 0;
}


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

using namespace std;

int main(){
	int n,w;
	cin>>n>>w;
	vector<int>weights(n,0);
	vector<int>values(n,0);
	for(int i=0;i<n;i++){
		cin>>weights[i]>>values[i];
	}
	long long int dp[n+1][w+1];
	for(int i=0;i<=n;i++){
		for(int j=0;j<=w;j++){
			dp[i][j] = 0;
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=w;j++){
			if(weights[i-1] <= j){
				dp[i][j] = max(dp[i-1][j],values[i-1]+dp[i-1][j-weights[i-1]]);
			}
			else{
				dp[i][j] = dp[i-1][j];
			}
		//	cout<<dp[i][j]<<" ";
		}
	//	cout<<endl;
	}
	cout<<dp[n][w];
}


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

int main() {
  int x, a, b;
  cin >> x >> a >> b;
  if (a >= b) cout << "delicious" << endl;
  else if (b - a <= x) cout << "safe" << endl;
  else cout << "dangerous" << endl;
}


Measured memory_bytes: 256
N,M=list(map(int,input().split()))
def div(N):
   l=[]
   for i in range(1,int(N**0.5)+1):
      if N%i==0:
         l.append(i)
         if i != N//i:
            l.append(N//i)
   l.sort()
   return l
l = div(M)
ans=-1
for i in l:
   if M//i>=N:
      ans+=1
   else:
      break
print(l[ans])

Measured memory_bytes: 3064
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val Array(a, b, c) = sc.nextLine.split(" ").map(_.toInt)
    if (b - a == c - b) println("YES")
    else println("NO")
  }
}


Measured memory_bytes: 25664
#include <bits/stdc++.h>
#include <time.h>
#include <assert.h>


using namespace std;



#define For(i,x,n)  for(long long i=x;i<n;i++)
#define rFor(i,x,n) for(long long i=x;i>=n;i--)
#define itFor(it,st)   for(auto it=st.begin() ; it!=st.end() ; it++)
#define MOD 1000000007
#define PI 3.141592653589793
#define INF 999999999999999999
#define N 1000005
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sp " "
#define cont continue
#define brk break

#define deb1(x)                cout<<#x<<": "<<x<<endl
#define deb2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define deb3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define deb4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define deb5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define deb6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

using namespace std;

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed;
    cout<<setprecision(3);
    srand(time(NULL));

    string s;
    cin>>s;
    bool ca=false,cb=false;
    For(i,0,3)
    	if(s[i]=='A')
    		ca = true;
    	else
    		cb = true;
    if(ca and cb)
    	cout<<"Yes";
    else
    	cout<<"No";

    //cout<<"\nTime used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case
    return 0;
}

//s1.substr(1,3) - return 3 characters starting from position 1 as substring of string sz1. eg sz1="shreynumh" sz1.substr(2,5)="reyan"
//num = atoi(s.c_str()); //convert string s to integer num
//n.erase(i,std::string::npos); //erase i th position in string n , decreasing string size
//s.find(b)!= std::string::npos - finds string b in string a - true if found
//cout<<"Time used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case                


Measured memory_bytes: 256
'use strict'

function main(input) {

  const N = Number(input);

  const divisor = (n) => {
    const res = [];
    for (let i = 1; i <= n; i++) {
      if(n % i === 0) res.push(i);
    }
    return res;
  }

  let ans = 0;

  for (let i = 1; i <= N; i++) {
    if (i % 2 === 0) continue;

    if (divisor(i).length === 8) {
      ans++;
    }
  }

  console.log(ans);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21192
k = int(input())

n = 50

a = [0] * n

cnt = k // n
rest = k % n


for i in range(n):
	a[i] = cnt + i


for i in range(rest):
	for j in range(n):
		if i == j:
			a[j] += n
		else:
			a[j] -= 1

print(50)
print(*a)

Measured memory_bytes: 3064
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
while (true) {
   var n = arr.shift() - 0;
   if (n == 0) break;
   var Arr = arr.splice(0,n);
   var obj = {};
   var max = 0;
   Arr.forEach(function(v){
      var str = v;
      var s = str[0];
      var flag = false;
      for (var i = 0; i < str.length; i++) {
         if (flag) s += str[i];
         flag = (/[aiueo]/.test(str[i])) ? true : false;
      }
      obj[s] = true;
      max = Math.max(max, s.length);
   });
   for (var i = 1; i <= max; i++) {
      var Obj = {};
      for (var key in obj) {
         Obj[key.slice(0, i)] = true;
      }
      if (Object.keys(Obj).length == n) {
         console.log(i);
         break;
      }
      if (i == max) console.log(-1);
   }
}

Measured memory_bytes: 21532
#include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e,max;
	cin>>a>>b>>c>>d>>e;
	max=a*e;
	if(c>=e) {
		if(max>b) max=b;
	}
	if(c<e && max>b+(e-c)*d) max=b+(e-c)*d;
	cout<<max<<endl;
	return 0;
}

Measured memory_bytes: 3080
#include<bits/stdc++.h>
#define ri register int
#define pb push_back
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
char buf[rlen],*ib=buf,*ob=buf;
#define gc() (((ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin)),ib==ob)?-1:*ib++)
typedef long long ll;
typedef pair<int,int> pii;
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
inline int Read(char*s){
	int top=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))s[++top]=ch,ch=gc();
	return top;
}
const int mod=998244353;
inline int add(int a,int b){return (a+=b)<mod?a:a-mod;}
inline void Add(int&a,int b){a=add(a,b);}
inline int dec(int a,int b){return (a-=b)<0?a+mod:a;}
inline void Dec(int&a,int b){a=dec(a,b);}
inline int mul(int a,int b){return (ll)a*b%mod;}
inline void Mul(int&a,int b){a=(ll)a*b%mod;}
inline int ksm(int a,int p){int ret=1;for(;p;p>>=1,Mul(a,a))(p&1)&&(Mul(ret,a),1);return ret;}
const int N=2e5+5;
char s[N],t[N];
int n;
int pre[N],f[N];
inline int solve(int len){
	int res=pre[len];
	for(ri i=1;i<=len;++i)t[i]=s[i];
	for(ri l=len+1,r=len<<1;l<=n;l+=len,r+=len){
		for(ri i=l;i<=r;++i){
			t[i]=t[i-len]^1;
			if(s[i]>t[i])return res+1;
			if(s[i]<t[i])return res;
		}
	}
	return res+1;
}
int pri[N],tot=0;
bool vs[N];
inline void init(){
	for(ri i=2;i<=n;++i){
		if(!vs[i])pri[++tot]=i;
		for(ri j=1,up=n/i;j<=tot&&pri[j]<=up;++j){
			vs[i*pri[j]]=1;
			if(i==i/pri[j]*pri[j])break;
		}
	}
}
int a[N],b[N],top;
vector<int>divv;
void dfs(int ps,int mt){
	divv.pb(mt);
	for(ri mlt=a[ps],i=ps;i<=top;++i,mlt=a[i])for(ri j=1;j<=b[i];++j,mlt*=a[i])dfs(i+1,mt*mlt);
}
inline int calc(int lm){
	int x=lm;
	top=0;
	for(ri i=1,up=sqrt(lm);i<=tot&&pri[i]<=up&&lm!=1;++i){
		if(lm!=lm/pri[i]*pri[i])continue;
		++top,a[top]=pri[i],b[top]=0;
		while(lm==lm/pri[i]*pri[i])lm/=pri[i],++b[top];
	}
	if(lm^1)a[++top]=lm,b[top]=1;
	divv.clear();
	dfs(1,1);
	int res=0;
	for(ri i=divv.size()-1;~i;--i)if(divv[i]!=1)if((n/(x/divv[i]))&1)Add(res,f[x/divv[i]]);
	return res;
}
int main(){
	#ifdef ldxcaicai
	freopen("lx.in","r",stdin);
	#endif
	n=read(),Read(s);
	init();
	int res=0;
	for(ri i=1;i<=n;++i)pre[i]=add(add(pre[i-1],pre[i-1]),s[i]-'0');
	res=add(pre[n],1);
	Mul(res,n*2);
	for(ri tp,i=1;i*3<=n;++i){
		if(n%i)continue;
		if(!((n/i)&1))continue;
		f[i]=dec(solve(i),calc(i));
		Dec(res,mul(2*(n-i),f[i]));
	}
	cout<<res;
	return 0;
}

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

int main() {
  long long A, B;
  long long C, D;
  cin >> A >> B >> C >> D;
  long long a, b, c, d, e, f, g, h;
  a = (A-1) / C;
  b = (A-1) / D;
  c = (A-1) / (C * D / __gcd(C,D));
  d = (B) / C;
  e = (B) / D;
  f = (B) / (C * D / __gcd(C,D));
  g = (A-1) - a - b + c;
  h = B - d - e + f;
  cout << h - g << endl;
}


Measured memory_bytes: 256
N = int(input())
monsters = list(map(int, input().split()))
heroes = list(map(int, input().split()))

damage = 0

for i in range(N):
    if monsters[i] + monsters[i + 1] <= heroes[i]:
        damage += monsters[i] + monsters[i + 1]
        monsters[i + 1] = 0
    elif monsters[i] < heroes[i]:
        damage += heroes[i]
        monsters[i + 1] -= heroes[i] - monsters[i]
    else:
        damage += heroes[i]

print(damage)


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

int main(){
  char x,a='a',A='A';
  cin >> x;
  if(x== 'a') cout << a;
  else if (x=='b') cout << a;
  else if (x=='c') cout << a;
  else if (x=='d') cout << a;
  else if (x=='e') cout << a;
  else if (x=='f') cout << a;
  else if (x=='g') cout << a;
  else if (x=='h') cout << a;
  else if (x=='i') cout << a;
  else if (x=='j') cout << a;
  else if (x=='k') cout << a;
  else if (x=='l') cout << a;
  else if (x=='m') cout << a;
  else if (x=='n') cout << a;
  else if (x=='o') cout << a;
  else if (x=='p') cout << a;
  else if (x=='q') cout << a;
  else if (x=='r') cout << a;
  else if (x=='s') cout << a;
  else if (x=='t') cout << a;
  else if (x=='u') cout << a;
  else if (x=='v') cout << a;
  else if (x=='w') cout << a;
  else if(x=='x') cout << a;
  else if (x=='y') cout << a;
  else if (x=='z') cout << a;
  else cout << A;
}

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

using namespace std;
using ll = long long;

int main() {
	ll n;
	cin >> n;
	vector<ll> x(n), y(n);
	for (int i = 0; i < n; i++) {
		cin >> x[i];
		y[i] = x[i];
	}
	sort(y.begin(), y.end());
	for (int i = 0; i < n; i++) {
		if (x[i] <= y[n / 2 - 1]) {
			cout << y[n / 2] << endl;
		}
		else {
			cout << y[n / 2 - 1] << endl;
		}
	}
	return 0;
}

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

int main(void) {
  int N, K;
  cin >> N >> K;
  string s;
  cin >> s;

  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }

  vector<int> vec, sta;
  int cnt = 1;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] != s[i - 1]) {
      vec.push_back(cnt);
      sta.push_back(s[i - 1] - '0');
      cnt = 1;
    } else {
      cnt++;
    }
  }
  vec.push_back(cnt);
  sta.push_back(s[s.size() - 1] - '0');

  int k = 0, sum = 0;
  int ret = 0;
  int j = 0;
  for (int i = 0; i < vec.size(); i++) {
    // cerr << i << " : " << vec[i] << endl;
    // cerr << "sum : " << sum << endl;
    if (sta[i] == 0) k++;
    while (K + 1 == k && j < vec.size()) {
      if (sta[j] == 0) k--;
      sum -= vec[j];
      j++;
    }

    sum += vec[i];
    ret = max(ret, sum);
  }
  cout << ret << endl;

  return 0;
}

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

string X;

int main(){
  cin >> X;
  int cnt = 0;
  int px = 0;
  for(char c : X ){
    if( px == 0 && c == 'T' ) cnt++;
    else if( c == 'S' ) px++;
    else  px--;
  }
  cout << cnt + px << endl;
}


Measured memory_bytes: 640