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

#define mainspring cout<<"mainspring\n";
#define barrel cout<<"barrel\n";
#define escapement cout<<"escapement\n";

#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end() 
#define sz(v) (int)((v).size())
#define fs first
#define sd second
#define tik(i,a,b) for(int i = a; i < b; i++)
#define tok(i,a,b) for(int i = a; i >= b; i--)
#define error(args...) {string _s = #args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it,args);}


typedef long long ll;
typedef unsigned long long ull;

typedef pair < int, int > pi;
typedef pair < pi, int > ppi;

typedef vector < int > vi;
typedef vector < vector < int > > vvi;
typedef vector < pi > vpi;
typedef vector < vpi > vvpi;
typedef vector < ppi > vppi;

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

void err(istream_iterator<string> it) {cout << endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << " ";
    err(++it, args...);
}

ll pow(ll x, ll y) {
	if(y == 0)
	return 1;
	ll temp = pow(x, y/2);
	temp = (temp*temp);
	if(y%2 == 1)
		temp *= x;
	return temp;
}

int main() {
	int n, m;
	cin >> n >> m;
	int a[n];
	int tot = 0;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		tot += a[i];
	}
	sort(a, a + n, greater<int>());
	if(a[m - 1] < (tot + 4*m - 1)/(4*m))
		cout << "No";
	else
		cout << "Yes";	
}

Measured memory_bytes: 256
N,K = map(int,input().split())
sunuke = [0 for _ in range(N)]
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        sunuke[a-1] += 1

count = 0
for j in sunuke:
    if j == 0:
        count += 1

print(count)

Measured memory_bytes: 67696
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) {}
  bool unionSet(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }
  bool findSet(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
};

int main() {
  int N, M;
  while (cin >> N >> M) {
    vector<int> p(N);
    for (int i = 0; i < N; i++) {
      cin >> p[i];
      --p[i];
    }
    UnionFind uf(N);
    for (int i = 0; i < M; i++) {
      int x, y;
      cin >> x >> y;
      --x;
      --y;
      uf.unionSet(x, y);
    }
    int res = 0;
    for (int i = 0; i < N; i++) {
      if (uf.findSet(p[i], i)) {
        ++res;
      }
    }
    cout << res << endl;
  }
  return 0;
}


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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;

  int hm1 = H1*60 + M1;
  int hm2 = H2*60 + M2;

  int hm3 = hm2-K;

  if (hm3 <= hm1) {
    cout << 0 << endl;
    return 0;
  } else {
    cout << hm3 - hm1 << endl;
  }

  return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
const int maxn=200000+10;
int n;
int a[maxn];
long long sum[maxn];
inline void init()
{
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        sum[i]=sum[i-1]+a[i];
    }
}
inline long long check(int mid)
{
    int L1=1,R1=mid;
    while (L1+1<R1)
    {
        int M=(L1+R1)>>1;
        if (sum[M]<=sum[mid]-sum[M])
            L1=M;
        else
            R1=M;
    }
    int L2=mid+1,R2=n;
    while (L2+1<R2)
    {
        int M=(L2+R2)>>1;
        if (sum[M]-sum[mid]<=sum[n]-sum[M])
            L2=M;
        else
            R2=M;
    }
    long long res=1e18;
    for (int i=L1;i<=R1;i++)
        for (int j=L2;j<=R2;j++)
        {
            long long s1=sum[i],s2=sum[mid]-sum[i],s3=sum[j]-sum[mid],s4=sum[n]-sum[j];
            long long maxx=max(max(s1,s2),max(s3,s4));
            long long minn=min(min(s1,s2),min(s3,s4));
            res=min(res,maxx-minn);
        }
    return res;
}
inline void exec()
{
    long long ans=1e18;
    for (int mid=2;mid<n-1;mid++)
        ans=min(ans,check(mid));
    printf("%lld\n",ans);
}
int main()
{
    init();
    exec();
    return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(){
	vector<double> yama;
	double j;
	while(cin>>j)yama.push_back(j);
	sort(yama.begin(),yama.end());
	//cout.precision(1);
	j = yama[yama.size()-1]-yama[0];
	printf("%.1f\n",j);
}

Measured memory_bytes: 1260
fun main() {
    val k = nextInt()
    var cnt = 0

    fun gcd(a: Int, b: Int): Int {
        return if (a % b == 0) b else gcd(b, a % b)
    }

    for (a in 1..k) {
        for (b in 1..k) {
            for (c in 1..k) {
                cnt += gcd(gcd(a, b), c)
            }
        }
    }

    println(cnt)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(' ')
fun nextIntList() = nextList().map { it.toInt() }
fun nextLongList() = nextList().map { it.toLong() }
fun nextDoubleList() = nextList().map { it.toDouble() }


Measured memory_bytes: 34952
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::setprecision(15);}}fIO;
template<typename T> using V = std::vector<T>;
template<typename T> void fill(V<T>&v) { for(T&e:v) std::cin >> e; }
/*-*/

lnt ipow(lnt v,lnt k) { lnt r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }


void prime_factorize(lnt n, std::map<lnt,lnt>& prime_factors) {
	for(lnt i=2;i*i<=n;i++) {
		while(n%i==0) {
			prime_factors[i]++;
			n/=i;
		}
	}
	if(n!=1) prime_factors[n]++;
}


lnt solve(lnt n) {
	n*=2;
	std::map<lnt,lnt> pf;
	prime_factorize(n,pf);
	V<std::pair<lnt,lnt> > v;
	for(auto e:pf) v.emplace_back(e);
	int m=v.size();
	lnt min=2*n;
	rep(s,1<<m) {
		lnt a=1,b=1;
		rep(j,m) {
			if(s>>j&1) a*=ipow(v[j].first,v[j].second);
			else b*=ipow(v[j].first,v[j].second);
		}
		if(a<b) std::swap(a,b);
		lnt ta=a,tb=b;
		std::pair<lnt,lnt> A={1,0},B={0,1};
		if(b==1) {
			B={1,-a+1};
		}
		while(a%b) {
			// A-=a/b*B;
			A.first-=a/b*B.first;
			A.second-=a/b*B.second;
			a%=b;
			std::swap(a,b);
			std::swap(A,B);
		}
		min=std::min({min,std::abs(ta*B.first),std::abs(tb*B.second)});
	}
	return min;
}

lnt checker(lnt n) {
	for(lnt k=1;;k++) {
		if(((k+1)*k/2)%n==0) return k;
	}
	return 0;
}

int main() {
	lnt n;
	std::cin >> n;
	print(solve(n));
}


Measured memory_bytes: 3660
process.stdin.resume();
process.stdin.setEncoding('utf8');
// 自分の得意な言語で
// Let's チャレンジ！！

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const N = lines[0]-0;
  let ans = 0;
  for(let i=1;i<=N;i++){
      const cnt = (~~(N/i));
      ans += cnt*(cnt+1)/2*i;
  }
  console.log(ans.toString());
  
});


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

int main(void){
    string s; cin >> s;
    int n = s.length();
    rep(i,n) if(i%2==0) cout << s[i];
    cout << endl;
    
    return 0;
}


Measured memory_bytes: 512
def main():
    H, W = map(int, input().split())
    a = [input() for _ in range(H)]
    print('#' * (W + 2))
    for i in range(H):
        print('#' + a[i] + '#')
    print('#' * (W + 2))


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x;
  cin >> x;
  for(int i=x; i<1000000; i++){
    int y = i;
    bool sosu = true;
    for(int j=2; j*j<=y; j++){
      if(y %j == 0){
        sosu = false;
        break;
      }
    }
    if(sosu){
      cout << y << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
n = gets.chomp.to_i
k = gets.chomp.to_i
x = gets.chomp.split(" ").map(&:to_i)
ans = 0

x.each do |a|
  if (k - a) < a
    ans += (k - a) * 2
  else
    ans += a * 2
  end
end

puts ans


Measured memory_bytes: 1788
#include<bits/stdc++.h>
#include<vector>
using namespace std;
#define MAX 1000005
#define MAX_NIGHTS 301
#define MOD 998244353
int main()
{
    int arr[32]={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};
    int k;
    scanf("%d",&k);
    k--;
    printf("%d",arr[k]);
    return 0;
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

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

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

int selention_sort(vector< int > &a) {
	int cnt = 0;
	for (int i = 0; i < (int)a.size(); i++) {
		int min_index = i;
		for (int j = min_index; j < (int)a.size(); j++) {
			if (a[j] < a[min_index]) {
				min_index = j;
			}
		}
		if (i != min_index) cnt++;
		swap(a[i], a[min_index]);
	}
	return cnt;
}

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

    int n;
    cin>>n;
    vector< int > a(n);
    REP(i, n) cin >> a[i];
    int cnt = selention_sort(a);
    REP(i, n) cout << a[i] << (i == n - 1 ? '\n' : ' ');
    cout << cnt << endl;


	return 0;
}



Measured memory_bytes: 3228
#include <complex>
#include <vector>
#include <cmath>
using namespace std;

const double EPS = 1e-8;
typedef complex<double> P;

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

struct L : public vector<P> {
  L(){}
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectSP(const L &s, const P &p) {
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}

bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
    ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}

double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}

double distanceSS(const L &s, const L &t) {
  if (intersectSS(s, t)) return 0;
  return min(min(distanceSP(s, t[0]), distanceSP(s, t[1])),
             min(distanceSP(t, s[0]), distanceSP(t, s[1])));
}

const double PI = 3.14159265358979323846264;

double deg2rad(double deg) {
  return deg*PI/180;
}

P rotate(P p, P c, double d) {
  return c+(p-c)*P(cos(d),sin(d));
}


#include <cstdio>

const int INF = 1000000000;
L star[200][5];
double d[200][200];

double diststar(int i,int j){
  double ans = 1000000;
  for (int ii=0; ii<5; ii++)
    for (int ji=0; ji<5; ji++)
      ans = min(ans,distanceSS(star[i][ii],star[j][ji]));
  return ans;
}

int main() {
  int n,m,l;
  while(scanf("%d %d %d",&n,&m,&l),n) {
    for(int i=0; i<n; i++) {
      double x,y,a,r;
      scanf("%lf %lf %lf %lf",&x,&y,&a,&r);
      P c(x,y),up(x,y+r);
      for (int j=0; j<5; j++) {
	P f = rotate(up,c,deg2rad(j*144+a));
	P t = rotate(up,c,deg2rad(((j+1)%5)*144+a));
	star[i][j] = L(f,t);
      }
    }

    for (int i=0; i<n; i++)
      for (int j=0; j<n; j++)
	d[i][j] = (i==j?0:diststar(i,j));

    for (int k=0; k<n; k++)
      for (int i=0; i<n; i++)
	for (int j=0; j<n; j++)
	  d[i][j] = min(d[i][j],d[i][k]+d[k][j]);

    printf("%.15f\n",d[m-1][l-1]);
  }
}

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

int main(){
    int W, H, x, y, r;
    cin >> W >> H >> x >> y >> r;
    
    if (x >= r && r <= y){
        if ( (x + r) <= W && (y + r) <= H ){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }    
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
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; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

vp prime_factorize(int n){
    vp ret;
    for(int p=2; p*p<=n; p++){
        if(n%p!=0) continue;
        int num=0;
        while(n%p==0){
            num++;
            n/=p;
        }
        ret.PB(MP(p,num));
    }
    if(n!=1) ret.PB(MP(n,1));
    return ret;
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    
    vint ex(n+1,0);

    for(int i=1; i<=n; i++){
        vp tmp=prime_factorize(i);
        for(auto t:tmp){
            ex[t.F]+=t.S;
        }
    }
    int res=1;
    for(int i=2; i<=n; i++){
        res*=ex[i]+1;
        res%=MOD;
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3636
n, x = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)

res = 0
0.step(n - 1) do |i|
  if i == 0
    next
  elsif a[i] + a[i - 1] > x
    eat = [a[i] + a[i - 1] - x, a[i]].min
    a[i] -= eat
    res += eat
  end
end

if a[0] > x
  res += a[0] - x
  a[0] = x
end
puts res

Measured memory_bytes: 21848
/*
  coded by: mi_ni_
  "LIVE LONG AND PROSPER"
*/
 
#include <bits/stdc++.h>
using namespace std;

#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define newl '\n'
#define TEST_CASE(fun) int tc; cin>>tc; while(tc--){ fun(); }
#define TEST_CASE_2 int tc; cin>>tc; for(int i=1;i<=tc;i++)
#define TEST_CASE_3(fun) int tc; cin>>tc; for(int i=1;i<=tc;i++){ cout<<"Case #"<<i<<": "; fun(); }
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define forab(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define forabr(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define all(x) x.begin(),x.end()
#define trav(i,x) for(auto& i:x)

using ll=long long int;
using ull=unsigned long long int;
using ld=long double;
using pii=pair<int, int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vl=vector<ll>;
using vii=vector<pii>;
using vll=vector<pll>;

const ld pi=acosl(-1);
const int inf=(int)1e9+7;
const ll INF=(ll)1e18+7;

//other
template<typename T> inline bool powerof2(T a){ return (a&&(!(a&(a-1)))); }
template<typename T> inline T log_2(T a){ T res=-1; while(a){ a/=2; res++; } return res; }

//make sure to choose TEST_CASE in main for multiple test cases
void solve(){
    int x;
	cin>>x;
	cout<<((1999-x)/200)+1<<newl;
}

int main(){
    FAST_IO
    cout<<fixed<<setprecision(10);
    //init_fact();
    //TEST_CASE(solve)
    //TEST_CASE_2{}
    //TEST_CASE_3(solve)
    solve();
    return 0;
}

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

const int MN = 200010;

int N, Q;
vector<int> B;
vector<vector<int> > query;

struct BIT {
    vector<int> tree;
    void init() {
        tree = vector<int>(4*MN, 1e9);
    }
    void upd(int idx, int val, int l, int r, int n) {
        if(idx < l || r < idx) return;
        if(l == r) {
            tree[n] = min(tree[n], val);
            return;
        }
        int m = (l + r)>>1;
        upd(idx, val, l, m, 2*n);
        upd(idx, val, m + 1, r, 2*n + 1);
        tree[n] = min(tree[2*n], tree[2*n + 1]);
    }
    int quer(int a, int b, int l, int r, int n) {
        if(b < l || r < a) return 2e9;
        if(a <= l && r <= b) return tree[n];
        int m = (l + r)>>1;
        int L = quer(a, b, l, m, 2*n);
        int R = quer(a, b, m + 1, r, 2*n + 1);
        return min(L, R);
    }
} bit;

int main() {
    scanf("%d", &N);

    B.resize(N + 1);
    int sum = 0;
    for(int i = 1; i <= N; i++) {
        scanf("%d", &B[i]);
        sum += B[i] ^ 1;
    }

    scanf("%d", &Q);

    query.resize(N + 1);
    for(int i = 0; i < Q; i++) {
        int l, r; scanf("%d %d", &l, &r);

        query[l].push_back(r);
    }
    for(int i = 1; i <= N; i++) {
        sort(query[i].begin(), query[i].end());
    }

    bit.init();
    bit.upd(0, 0, 0, MN - 1, 1);
    for(int i = 1; i <= N; i++) {
        for(int j = query[i].size(); j--;) {
            int r = query[i][j];

            bit.upd(r, bit.quer(i - 1, r, 0, MN - 1, 1), 0, MN - 1, 1);
        }
        bit.upd(i, (B[i]? 1 : -1) + bit.quer(i - 1, i - 1, 0, MN - 1, 1), 0, MN - 1, 1);
    }
    cout << sum + bit.quer(N, N, 0, MN - 1, 1);
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int) 1e9 + 7;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b;
        return 1;
    }
    return 0;
}

template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b;return 1; }return 0; }

int main() {
    int a,b;
    cin >> a >> b;
    cout << (a-1)*(b-1) << endl;
    return 0;
}

Measured memory_bytes: 256
//
//  main.cpp
//  Study
//
//  Created by 佐々木勇星 on 2020/03/12.
//  Copyright © 2020 佐々木勇星. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <map>

using namespace std;


int main(int argc, const char * argv[]) {


    int a, b, c, ans = 0;
    cin >> a >> b >> c;
    
    ans = c - (a - b);
    
    if(ans < 0) ans = 0;
    cout << ans << endl;
    
    return 0;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }


int main() {
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    
    string S;
    while (cin >> S) {
        for (int i = 0; i< S.size(); ++i) cout << "x";
        cout << endl;
    }
}


















Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for (int i=(a); i<=(b); i++)
#define per(i,a,b) for (int i=(a); i>=(b); i--)
using namespace std;
typedef long long LL;

inline int read() {
    int x=0,f=1; char ch=getchar();
    while (!(ch>='0'&&ch<='9')) {if (ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9') {x=x*10+(ch-'0'); ch=getchar();}
    return x*f;
}

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

int n,m,ans=0;
char s[N][N];
int head=0,tail=0,q[N*N][2];
int dis[N][N];
bool used[N][N];

int main() {

	n=read(),m=read(); rep(i,1,n) {
		scanf("%s",s[i]+1);
		rep(j,1,m) if (s[i][j]=='#') q[tail][0]=i,q[tail][1]=j,tail++,used[i][j]=1;
	}
	while (head<tail) {
		int nowx=q[head][0],nowy=q[head][1]; head++;
		ans=max(ans,dis[nowx][nowy]);
		rep(i,0,3) {
			int tmpx=nowx+dx[i],tmpy=nowy+dy[i];
			if (tmpx<1||tmpx>n||tmpy<1||tmpy>m) continue;
			if (used[tmpx][tmpy]) continue;
			dis[tmpx][tmpy]=dis[nowx][nowy]+1;
			used[tmpx][tmpy]=1;
			q[tail][0]=tmpx,q[tail][1]=tmpy,tail++;
		}
	}
	
	printf("%d\n",ans);

	return 0;
	
}


Measured memory_bytes: 13952
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <list>
#include <vector>
#include <map>
#include <time.h>
#include <cstdlib>
#include <iomanip>
#include <array>

#pragma warning(disable:4996)

using namespace std;

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




int main(void) {
	string str;
	bool on1 = false, on2 = false;
	cin >> str;
	for (int i = 0; i < str.length(); i++) {
		if (!on1 && str[i] == 'C')
			on1 = true;
		if (on1 && !on2 && str[i] == 'F')
			on2 = true;
	}
	if (on1 && on2)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}


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

#define ll long long

using namespace std;


int main()
{
    int cases, tc = 1;

       //c++, a, b);
       ll n, k;
       cin >> n >> k;
       ll cnt = 0;
       while( n > 0)
       {
           n /= k;
           cnt++;
       }
       cout << cnt << endl;


   return 0;

}


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

using namespace std;

typedef long long int64;

int main()
{
  int64 N, A, B, H[100000];

  cin >> N >> A >> B;
  for(int i = 0; i < N; i++) {
    cin >> H[i];
  }

  auto check = [&](int v)
  {
    int64 sa = A - B;
    int64 ret = 0;
    for(int i = 0; i < N; i++) {
      int64 get = H[i] - v * B;
      if(get > 0) ret += (get + sa - 1) / sa;
    }
    return (ret <= v);
  };

  int low = 0, high = 1 << 30;
  while(high - low > 0) {
    int mid = (low + high) / 2;
    if(check(mid)) high = mid;
    else low = mid + 1;
  }
  cout << low << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstring>
#include <string>

int d;
const int mod = 1000000007;
const int size = 100005;
std::string s;
int dp[size][2][102];

int Solve(int ndx, bool equal, int sum)
{
	if (ndx >= s.size())
		return sum == 0;
	if (dp[ndx][equal][sum] != -1)
		return dp[ndx][equal][sum];
	int ans = 0;
	for (int i = 0; i < 10; ++i)
	{
		if (equal)
		{
			if (i < s[ndx] - '0')
				ans = (ans + Solve(ndx + 1, false, (sum + i) % d)) % mod;
			else if (i == s[ndx] - '0')
				ans = (ans + Solve(ndx + 1, true, (sum + i) % d)) % mod;
		}
		else
			ans = (ans + Solve(ndx + 1, false, (sum + i) % d)) % mod;
	}
	return dp[ndx][equal][sum] = ans;
}

int main()
{
	memset(dp, -1, sizeof(dp));
	std::cin >> s;
	std::cin >> d;
	int ans = 0;
	for (int i = 0; i < 10; ++i)
	{
		if (i < s[0] - '0')
			ans = (ans + Solve(1, false, i % d)) % mod;
		if (i == s[0] - '0')
			ans = (ans + Solve(1, true, i % d)) % mod;
	}
	std::cout << (ans - 1 + mod) % mod << '\n';
	// std::cin >> d;
	return 0;
}

Measured memory_bytes: 80768
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

H, W, K = getNM()
maze = [list(input()) for i in range(H)]
for i in range(H):
    for j in range(W):
        if maze[i][j] == ".":
            maze[i][j] = 0
        else:
            maze[i][j] = 1

# 縦
cnt = 0
for bit_h in range(1 << H):
    # 横
    for bit_w in range(1 << W):
        opt = 0
        alta = copy.deepcopy(maze)
        for i in range(H):
            for j in range(W):
                if bit_h & (1 << i):
                    alta[i][j] = 0
                if bit_w & (1 << j):
                    alta[i][j] = 0
        for i in range(H):
            opt += sum(alta[i])
        if opt == K:
            cnt += 1
print(cnt)

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


int main(){
    int h, w;
    cin >> h >> w;

    string board[50];

    for (int i = 0; i < h; ++i) cin >> board[i];

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

    for (int i = 0; i < h; ++i){
        for (int j = 0; j < w; ++j){
            if (board[i][j] == '#') continue;

            int num = 0;
            for (int d = 0; d < 8; ++d){
                const int ni = i + dy[d];
                const int nj = j + dx[d];

                if (ni < 0 or h <= ni) continue;
                if (nj < 0 or w <= nj) continue;
                if (board[ni][nj] == '#') num++;
            }

            board[i][j] = char(num + '0');
        }
    }

    for (int i = 0; i < h; ++i) cout << board[i] << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N;
	long long sum=0;
	cin>>N;
	while(N>0){
		if(N%3!=0 && N%5!=0){
			sum+=N;
		}
		--N;
	}
	cout<<sum<<endl;
	
	return 0;
}

Measured memory_bytes: 3640
//#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define fast_io()                \
    ios::sync_with_stdio(false); \
    std::cin.tie(0);
#define mod 998244353
typedef long long ll;
typedef long double ld;
using namespace std;

int main()
{
    fast_io();
    int k, n;
    int p[1001];
    cin >> n >> k;
    for (int i = 0; i < n; i++)
        cin >> p[i];
    sort(p, p + n);
    ll ans = 0;
    for (int i = 0; i < k; i++)
        ans += p[i];
    cout << ans;
    return 0;
}

Measured memory_bytes: 3188
#include<bits/stdc++.h>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int fir[110],dis[210],nxt[210],id,eA[110],eB[110];
void link(int a,int b){nxt[++id]=fir[a],fir[a]=id,dis[id]=b;}
int Dep,son[110];
void dfs(int x,int d,int fa=-1){
	Dep=std::max(Dep,d);
	for(int i=fir[x],j=0;i;i=nxt[i]){
		if(dis[i]==fa)continue;
		son[d]=std::max(son[d],++j);
		dfs(dis[i],d+1,x);
	}
}
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n=gi(),a,b;
	for(int i=1;i<n;++i)eA[i]=a=gi(),eB[i]=b=gi(),link(a,b),link(b,a);
	std::pair<int,ll>ans(1e9,0);
	for(int i=1;i<=n;++i){
		memset(son,0,sizeof son);Dep=0;
		dfs(i,1);
		ll MUL=1;
		for(int i=1;i<Dep;++i)MUL*=son[i];
		ans=std::min(ans,{Dep,MUL});
	}
	for(int i=1;i<n;++i){
		memset(son,0,sizeof son);Dep=0;
		dfs(eA[i],1,eB[i]),dfs(eB[i],1,eA[i]);
		ll MUL=2;
		for(int i=1;i<Dep;++i)MUL*=son[i];
		ans=std::min(ans,{Dep,MUL});
	}
	printf("%d %lld\n",ans.first,ans.second);
	return 0;
}


Measured memory_bytes: 256
(_,K),*T=[map(int,t.split())for t in open(0)]
A,B=map(sorted,T)
d=[2**40,0]
exec("i=sum(d)//2;d[-sum(min(0,i//b-a)for a,b in zip(A,B[::-1]))>K]=i;"*41)
print(d[0])

Measured memory_bytes: 124704
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

N,K = II()
A = III()

print(math.ceil((N-1)/(K-1)))

Measured memory_bytes: 52476
#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (ll i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (ll i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n; cin >> n;

    ll ans = 0;
    REP(i, n) {
        int l, r; cin >> l >> r;
        ans += r - l + 1;
    }

    print(ans);
}

Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int totalAmount = 0;

	public static void solve() {
		int[] size = { 161, 160, 140, 120, 100, 80, 60 };
		int[] weight = { 26, 25, 20, 15, 10, 5, 2 };
		int[] fee = { 0, 1600, 1400, 1200, 1000, 800, 600 };
		int tempTotalAmount = fee[0];
		int vertical = sc.nextInt();
		int width = sc.nextInt();
		int height = sc.nextInt();
		int packWeight = sc.nextInt();
		int totalSize = vertical + width + height;
		if (totalSize >= size[0] || packWeight >= weight[0]) {
			return;
		}
		for (int i = 1; i < 7; i++) {
			if (totalSize <= size[i] && packWeight <= weight[i]) {
				tempTotalAmount = fee[i];
			}
		}
		totalAmount += tempTotalAmount;
	}

	public static void main(String[] args) {
		while (true) {
			int totalPackage = sc.nextInt();
			if (totalPackage == 0) {
				break;
			}
			int cnt = totalPackage;
			while (cnt > 0) {
				solve();
				cnt -= 1;
			}
			System.out.println(totalAmount);
			totalAmount = 0;
		}
	}

}

Measured memory_bytes: 69924
#include <unistd.h>
#include <stdlib.h>

void writing(int ans)
{
    char c;
    if (ans < 10)
    {
        c = ans + '0';
        write(1, &c, 1);
    }
    else
    {
        writing(ans / 10);
        writing(ans % 10);
    }
}

int get_num(char *s)
{
    int num;
    int i;
    
    i = -1;
    while (s[++i] != 10)
    {
        if (s[i] != 32)
        {
            num = 0;
            while ('0' <= s[i] && s[i] <= '9')
            {
                num = num * 10 + s[i++] - '0';
                    
            }
            return (num);
        }
    }  
}

void get_nums(int *array, char *s, int count)
{
    int num;
    int i;
    
    i = -1;
    while (s[++i])
    {
        if (s[i] != 10 && s[i] != 32)
        {
            num = 0;
            while ('0' <= s[i] && s[i] <= '9')
            {
                num = num * 10 + s[i++] - '0';
                if (!s[i])
                {
                    array[count] = num;
                    return ;                    
                }
            }
            array[count++] = num;
            i--;
        }
    }  
}

void get_num_plus(int *tab, char *tmp, int pass_flag, int count)
{
    int i;
    
    i = -1;
    while (count < pass_flag)
    {
        while (tmp[++i] != 10)
            ;
        count++;
    }
    get_nums(tab, &tmp[++i], 0);
}

void get_ans(int n, char *tmp)
{
    int i;
    int j;
    int tab[n];
    int count;
    
    get_num_plus(tab, tmp, 1, 0);
    count = 0;
    j = 0;
    i = -1;
    while (++i < n)
    {
        count++;
        if (tab[j] == 2)
        {
            writing(count);
            return ;
        }
        j = tab[j] - 1;
    }
    write(1, "-1", 2);
}

char *create_array(char *s, char *new_arr, char *t, int size)
{
    int i;
    int j;
    
    i = -1;
    while (s[++i])
        new_arr[i] = s[i];
    free(s);
    j = 0;
    while (j < size)
        new_arr[i++] = t[j++];   
    new_arr[i] = 0;
    return (new_arr);
}

char *get_data(char *s)
{
    int size;
    int sum_size;
    char t[1000];
    char *new_arr;
    
    sum_size = 0;
    while ((size = read(0, t, 1000)))
    {
        if (size == -1)
            return (NULL);
        sum_size += size;
        if (!(new_arr = (char*)malloc(sum_size + 1)))
            return (NULL);
        s = create_array(s, new_arr, t, size);
    }
    return (s);
}

int main(void){
    int num;
    char *s;
    
    s = malloc(1);
    s = get_data(s);
    num = get_num(s);
    get_ans(num, s);
    free(s);
    return (0);
}


Measured memory_bytes: 2264
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF 9223372036854775807+1
lli sosuu=1000000000+7;

lli RepeatSquaring(lli N, lli P, lli M){
    if(P==0) return 1;
    if(P%2==0){
        lli t = RepeatSquaring(N, P/2, M);
        return t*t % M;
    }
    return N * RepeatSquaring(N, P-1, M);
}//繰り返し二乗法

lli Inverse_b(lli b, lli m) {
    lli a = m, u = 1, v = 0;
    while (a) {
        lli t = b / a;
        b -= t * a; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}//非再帰拡張 Euclid の互除法を用いた逆元

lli kaijo(lli N,lli end){
  lli n=N;
  rep(i, end-1){
  n*=N-1;
    n%=sosuu;
    N--;
  }
  return n;
}

int main() {
  lli N,a,b;
  cin >> N >> a >> b;
  lli n=RepeatSquaring(2, N, sosuu)-1;
  lli ans=(n-kaijo(N,a)*Inverse_b(kaijo(a,a),sosuu)-(kaijo(N,b)*Inverse_b(kaijo(b,b),sosuu))%sosuu)%sosuu;
 
  
    if (ans < 0) ans += sosuu;
  
  cout << ans << endl;}



Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	int x, h;
	while (scanf("%d%d", &x, &h))
	{
		if (x == 0.0 && h == 0.0) break;
		printf("%.6f\n", (4.0*(sqrt(double(h*h)+double(x*x)/4.0)*x))/2.0+x*x);
	}
}

Measured memory_bytes: 0
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n):
    if a[i] % 2 == 0:
        while a[i] % 2 == 0:
            a[i] //= 2
            ans += 1
    else:
        cnt += 1

if cnt == n:
    print(0)
else:
    print(ans)

Measured memory_bytes: 4212
#include<stdio.h>
#include<string.h>

int main(void) {
	
	int a, b, c;

	scanf("%d%d%d", &a, &b, &c);

	if (a <= c && c <= b) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}

	
	return 0;

}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main() {
  int mon, day;
  string youbi[7] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
  int tDay[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int yb;

  while(cin >> mon >> day && mon) {
    yb = 0;
    for(int i = 0; i < mon-1; i++) {
      yb += tDay[i];
    }
    yb += day-1;
    yb %= 7;
    
    cout << youbi[yb] << endl;
  }
 
  return 0;
}

Measured memory_bytes: 1196
N, M = map(int, input().split())
a = [(1, int(i)) for i in input().split()]
for _ in range(M):
    b, c = map(int, input().split())
    a.append((b, c))
a = sorted(a, key=lambda x: x[1])
ans = 0
t = 0
while t < N:
    b, c = a.pop()
    p = min(b, N-t)
    ans += p * c
    t += p
print(ans)


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

int main() {
  ll N;
  cin>>N;
  vector<int> vec(N);
  rep(i,N-1){
int a;
cin>>a;
vec.at(a-1)++;
  }
  rep(i,N){
    cout<<vec.at(i)<<endl;
  }
}


Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
typedef pair<int,int> pii;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
//next_permutation(ALL(p));
//typedef priority_que<int> pque;//これは大きい順
//typedef priority_que<int, vector<int>, greater<int>> pque;//これは小さい順


int main(){
	string s;
	cin >> s;
	if(s == "AAA") cout << "No" << endl;
	else if(s == "BBB") cout << "No" << endl;
	else cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h> 
const int N=15;
int main()
{
	int a[N]={0}; 
	for(int i=0;i<10;i++)
	{
		scanf("%d", &a[i]); 
	}
	for(int i=0; i<10; i++)
	{
		for(int j=i; j<10; j++)
		{
			if( a[i]<a[j] )
			{
				int tmp=a[i];
				a[i]=a[j];
				a[j]=tmp;
		
			}
		}
	}
	for(int i=0;i<3;i++)
	{
		printf("%d\n", a[i]);
	}
	return 0;
}



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

int main(){
    ll n, k, s;
    cin >> n >> k >> s;
    
    ll t = (s<=2) ? s+1 : s-1;
    
    for(ll i=0; i<k; i++) cout << s << " ";
    for(ll i=k; i<n; i++) cout << t << " ";

    return 0;
}

Measured memory_bytes: 1280
#include<iostream>

using namespace std;

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

	for (int i = 1; i <= B; i++) {
		if ((A * i) % B == 0) {
			cout << A * i << endl;
			break;
		}
	}

	return 0;
}

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

int main() {
    ll ai, ao, at, aj, al, as, az;
    cin >> ai >> ao >> at >> aj >> al >> as >> az;
    ll ans = 0;
    ans += ai / 2 * 2;
    ans += al / 2 * 2;
    ans += aj / 2 * 2;
    ans += ao;
    if (ai && al && aj) {
        ll tmp = ai % 2 + al % 2 + aj % 2;
        if (tmp == 3) ans += 3;
        if (tmp == 2) ans += 1;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
using namespace std;
typedef long long ll;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tlll tuple<ll, ll, ll>

typedef struct point {
    double x, y;
} pt;

double dist(pt a, pt b, int k) {
    return pow(pow((a.x - b.x), 2) + pow(a.y - b.y, 2), 0.5 * k);
}

int main() {
    double eps = 1e-6;
    int n;
    pt p[55];
    cin >> n;
    for (int i = 0; i < n; i++) {
        double x, y;
        cin >> x >> y;
        p[i].x = x;
        p[i].y = y;
    }

    double ans = 1e10;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; k < n; k++) {
                pt u;
                double a = dist(p[j], p[k], 2), b = dist(p[k], p[i], 2), c = dist(p[i], p[j], 2);
                double fr = a * (b + c - a) + b * (c + a - b) + c * (a + b - c); 
                u.x = a * (b + c - a) * p[i].x + b * (c + a - b) * p[j].x + c * (a + b - c) * p[k].x; 
                u.y = a * (b + c - a) * p[i].y + b * (c + a - b) * p[j].y + c * (a + b - c) * p[k].y; 
                u.x /= fr;  u.y /= fr;

                double r = dist(u, p[i], 1);

                bool ok = 1;
                for (int l = 0; l < n; l++) {
                    if (l == i || l == j || l == k) continue;
                    if (dist(u, p[l], 2) - r * r > eps) ok = 0;
                }
                if (ok) ans = min(ans, r);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            pt u;
            u.x = (p[i].x + p[j].x) / 2;
            u.y = (p[i].y + p[j].y) / 2;
            double r = dist(u, p[i], 1);
            bool ok = 1;
            for (int k = 0; k < n; k++) {
                if (k == i || k == j) continue;
                if (dist(u, p[k], 2) - r * r > eps) ok = 0;
            }
            if (ok) ans = min(ans, r);
        }
    }

    cout << setprecision(16) << ans << endl;



}


Measured memory_bytes: 384
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
     os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N),B(N);
    vector<int> A_(N),B_(N);
    REP(i,N) cin >> A[i];
    REP(i,N) cin >> B[i];
    int ans = 0;
    REP(k,29){
        REP(i,N) A_[i] = A[i]&((1<<(k+1))-1);
        REP(i,N) B_[i] = B[i]&((1<<(k+1))-1);
        sort(ALL(B_));
        int cnt = 0;
        for(auto a:A_){
            //2**K <= a+b < 2**(K+1)
            cnt += lower_bound(ALL(B_), (1<<(k+1))-a) - lower_bound(ALL(B_), (1<<k)-a);
            //2**K + 2**(K+1) <= a+b < 2**(K+2)
            cnt += lower_bound(ALL(B_), (1<<(k+2))-a) - lower_bound(ALL(B_), (1<<(k+1)) + (1<<k) -a);
        }
        if(cnt&1) ans += 1<<k;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3456
S = list(input())
K = int(input())
S.extend(S)

prev = ''
cnt = 0
for s in S:
    if s == prev:
        cnt += 1
        prev = ''
    else:
        prev = s

b = 0
if K % 2 == 0:
    b += 1
if K > 2 and S[0] == S[-1]:
    mae = 1
    while mae < len(S) and S[mae] == S[0]:
        mae += 1
    if mae % 2 == 1 and mae != len(S):
        usiro = 1
        i = len(S) - 2
        while S[i] == S[-1]:
            usiro += 1
            i -= 1
        if usiro % 2 == 1:
            b = K // 2

if K % 2 == 0:
    res = cnt * (K // 2) + (b - 1)
else:
    res = cnt * (K // 2) + cnt // 2 + b
print(res)


Measured memory_bytes: 3064
/*   _/                _/                 _/_/_/   _/
  _/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
   _/     _/    _/   _/     _/    _/  _/_/_/     _/
  _/     _/    _/   _/     _/    _/  _/    _/   _/
   _/_/   _/_/       _/_/   _/_/      _/_/     _/ */
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=1e18;
using P=pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  ll x,y,ans=0;
  cin >> x >> y;
  while(x<=y) {
    ans++;
    x*=2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256