akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const ll INF = numeric_limits<ll>::max();
int main()
{
    ll n; cin >> n;
    VI p;
    ll m = 1, s = 0, cnt = 1;
    rep(i, 12){
        m *= 26;
        s += m;
        if (n <= s) break;
        ++cnt;
        //
    }
    n = n - (s - m) - 1;
    ll b = 0;
    rep(i, cnt) {
        b = n%26;
        n -= b;
        n /= 26;
        p.push_back(b);
    }
    reverse(ALL(p));
    string ans = "";
    rep(i, cnt){
        char a = p[i] + 'a';
        ans += a;
    }


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

Measured memory_bytes: 3656
#include<stdio.h>

void a(int);

int main(void){
	int b=1;
	a(b);
	return 0;
}

void a(int c){
	int i;
	if(c<10){
		for(i=1;i<10;i++){
			printf("%dx%d=%d\n",c,i,c*i);
		}
	}else{
		return;
	}
	a(c+1);
	return;
}

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


int main()
{
	int H,W,M;
	cin>>H>>W>>M;
	map<int,int> height;
	map<int,int> width;
	vector<vector<int>> target_h(H);
	vector<vector<int>> target_w(W);
	int max_h=-1;
	int max_w=-1;
	rep(i,M)
	{
		int h,w;
		cin>>h>>w;
		h--;
		w--;
		target_h[h].push_back(w);
		target_w[w].push_back(h);
		height[h]++;
		width[w]++;
		if(height[max_h]<height[h])
		{
			max_h=h;
		}
		if(width[max_w]<width[w])
		{
			max_w=w;
		}
	}
	map<int,bool> seen_w;
	for(auto p : height)
	{
		if(height[max_h]==p.second)
		{
			for(int v : target_h[max_h])
			{
				seen_w[v]=true;
			}
		}
	}	
	bool is_max=true;
	for(auto p : width)
	{
		if(width[max_w]==p.second&&!seen_w[p.first])
		{
			is_max=false;
			break;
		}
	}
	map<int,bool> seen_h;
	for(auto p : width)
	{
		if(width[max_w]==p.second)
		{
			for(int v : target_w[max_w])
			{
				seen_h[v]=true;
			}
		}
	}
	for(auto p : height)
	{
		if(height[max_h]==p.second&&!seen_h[p.first])
		{
			is_max=false;
			break;
		}
	}
	if(is_max)
	{
		cout<<height[max_h]+width[max_w]-1<<endl;
	}
	else
	{
		cout<<height[max_h]+width[max_w]<<endl;
	}
	return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<bool>> map(N, vector<bool>(M, false));
  for (int i = 0; i < N; i++) {
    int K;
    cin >> K;
    for (int j = 0; j < K; j++) {
      int like;
      cin >> like;
      map[i][like-1] = true;
    }
  }
  int res = 0;
  for (int i = 0; i < M; i++) {
    bool can = true;
    for (int j = 0; j < N; j++) {
      if (!map[j][i]) {
        can = false;
        continue;
      }
    }
    if (can) res++;
  }
  cout << res;
}


Measured memory_bytes: 256
import std.container;
import std.range;
import std.algorithm;
import std.array;
import std.string;
import std.conv;
import std.stdio;
import std.container;

void main() {
	long n = readln.chomp.to!int;

	auto d = new bool[n];
	
	foreach (i;0..n) {
		int a, b;
		readf("%s %s\n", a, b);

		d[i] = a == b;
	}

	if (n < 3) {
		writeln("No");
		return;
	}
	
	foreach (i;2..n) {
		if (d[i - 2] && d[i - 1] && d[i]) {
			writeln("Yes");
			return;
		}
	}
	writeln("No");
}


Measured memory_bytes: 2844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
#define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now();
#define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now();
#define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n";
/* clang-format on */

int main() {
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  ll cnt = 0;
  while (b <= a) {
    cnt++;
    b *= 2;
  }
  while (c <= b) {
    cnt++;
    c *= 2;
  }
  if (cnt > k)
    cout << "No"
         << "\n";
  else
    cout << "Yes"
         << "\n";

  return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//定数
#define INF 1000000000 //10^9:極めて大きい値,∞
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second　//pairの二つ目の要素

int main(){
    string s,t,u;
    int a,b;
    cin>>s>>t>>a>>b>>u;
    if(s==u)a--;
    else b--;
    cout<<a<<" "<<b<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define res resize
#define as assign
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));

typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 9223372036854775806ll;
const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
//-0.4620981203755741
int main(){
    int n;
    std::cin >> n;
    VEC(ll,a,n);
    std::vector<ll> b(n+1);
    rep(i,n){
        b[i+1]=b[i]+a[i];
    }
    ll su=b[n];
    ll ans=INF64;
    rrep(i,1,n+1){
        ans=min(ans,abs(b[i]-(su-b[i])));
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REPS(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll m, ll n) {
    ll tmp;
    while (m % n != 0) {
        tmp = n;
        n = m % n;
        m = tmp;
    }
    return n;
}

ll lcm(ll m, ll n) {
    return m * n / gcd(m, n);
}

int main(void) {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;

    // CとDの最小公倍数を求める
    ll CD;
    CD = lcm(C, D);
    ll divisors;
    divisors = (B/C + B/D - B/CD) - ((A-1)/C + (A-1)/D - (A-1)/CD);
    cout << 1 + B - A - divisors << endl;
}

Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.format;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.concurrency;
import std.traits;
import std.uni;
import core.bitop : popcnt;
alias Generator = std.concurrency.Generator;

enum long INF = long.max/5;
enum long MOD = 10L^^9+7;

void main() {
  long H, A;
  scanln(H, A);
  H.ceil(A).writeln;
}

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


void times(alias fun)(long n) {
  // n.iota.each!(i => fun());
  foreach(i; 0..n) fun();
}
auto rep(alias fun, T = typeof(fun()))(long n) {
  // return n.iota.map!(i => fun()).array;
  T[] res = new T[n];
  foreach(ref e; res) e = fun();
  return res;
}

T ceil(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  // `(x+y-1)/y` will only work for positive numbers ...
  T t = x / y;
  if (y > 0 && t * y < x) t++;
  if (y < 0 && t * y > x) t++;
  return t;
}

T floor(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  T t = x / y;
  if (y > 0 && t * y > x) t--;
  if (y < 0 && t * y < x) t--;
  return t;
}

ref T ch(alias fun, T, S...)(ref T lhs, S rhs) {
  return lhs = fun(lhs, rhs);
}
unittest {
  long x = 1000;
  x.ch!min(2000);
  assert(x == 1000);
  x.ch!min(3, 2, 1);
  assert(x == 1);
  x.ch!max(100).ch!min(1000); // clamp
  assert(x == 100);
  x.ch!max(0).ch!min(10); // clamp
  assert(x == 10);
}

mixin template Constructor() {
  import std.traits : FieldNameTuple;
  this(Args...)(Args args) {
    // static foreach(i, v; args) {
    foreach(i, v; args) {
      mixin("this." ~ FieldNameTuple!(typeof(this))[i]) = v;
    }
  }
}

void scanln(Args...)(auto ref Args args) {
  enum sep = " ";
  enum n = Args.length;
  enum fmt = n.rep!(()=>"%s").join(sep) ~ "\n";
  static if (__VERSION__ >= 2071) {
    readf!fmt(args);
  } else {
    enum argsTemp = n.iota.map!(
      i => "&args[%d]".format(i)
    ).join(", ");
    mixin(
      "readf(fmt, " ~ argsTemp ~ ");"
    );
  }
}

// fold was added in D 2.071.0
static if (__VERSION__ < 2071) {
  template fold(fun...) if (fun.length >= 1) {
    auto fold(R, S...)(R r, S seed) {
      static if (S.length < 2) {
        return reduce!fun(seed, r);
      } else {
        return reduce!fun(tuple(seed), r);
      }
    }
  }
}

// popcnt with ulongs was added in D 2.071.0
static if (__VERSION__ < 2071) {
  ulong popcnt(ulong x) {
    x = (x & 0x5555555555555555L) + (x>> 1 & 0x5555555555555555L);
    x = (x & 0x3333333333333333L) + (x>> 2 & 0x3333333333333333L);
    x = (x & 0x0f0f0f0f0f0f0f0fL) + (x>> 4 & 0x0f0f0f0f0f0f0f0fL);
    x = (x & 0x00ff00ff00ff00ffL) + (x>> 8 & 0x00ff00ff00ff00ffL);
    x = (x & 0x0000ffff0000ffffL) + (x>>16 & 0x0000ffff0000ffffL);
    x = (x & 0x00000000ffffffffL) + (x>>32 & 0x00000000ffffffffL);
    return x;
  }
}


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

void dfs(int now, int d, vector<int> &dist, vector<vector<int> > &edges, vector<int> &cut){
    if(dist[now]!=MOD || cut[now]>0){
        if(cut[now]==1){
            dist[now]=d;
        }
        return;
    }

    dist[now]=d;
    for(int i=0; i<(int) edges[now].size(); i++){
        int next_=edges[now][i];
        dfs(next_, d+1, dist, edges, cut);
    }
}

template<typename T>
void cout_vec(vector<T> &vec){
    for(int i=0; i<vec.size(); i++){
        if (i!=0){
            cout << ' ';
        }
        cout << vec[i];
    }
    cout << endl;
}

int main(){
    int N, u, v;
    cin >> N >> u >> v;
    u--;v--;

    vector<vector<int> > edges(N,vector<int>(0));
    for(int i=0; i<N-1; i++){
        int A, B;
        cin >> A >> B;
        A--;B--;

        edges[A].push_back(B);
        edges[B].push_back(A);
    }

    vector<int> t_dist(N,MOD);
    vector<int> a_dist(N,MOD);
    vector<int> cut(N,0);

    dfs(u, 0, t_dist, edges, cut);
    dfs(v, 0, a_dist, edges, cut);

    
    for(int i=0; i<N; i++){
        if(t_dist[i]>a_dist[i]){
            cut[i]=2;
        }else if(t_dist[i]==a_dist[i]){
            cut[i]=1;
        }
    }

    t_dist = vector<int>(N,MOD);
    dfs(u, 0, t_dist, edges, cut);

    int ans=0;
    for(int i=0; i<N; i++){
        if(t_dist[i]==MOD)continue;

        if(ans<a_dist[i]){
            int diff=t_dist[i]-a_dist[i];
            if(diff==0){
                ans=a_dist[i];
            }else{
                ans=a_dist[i]-1;
            }
        }
    }

    //cout_vec(t_dist);
    //cout_vec(a_dist);
    cout << ans << endl;

}


Measured memory_bytes: 12416
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
using vl = vector<ll>;
using vi = vector<int>;
using vchar = vector<char>;
using vstr = vector<string>;
using pll =  pair<ll,ll>;

const ll mod = 1000000007;
const ll inf = 1000000000000000;

#define pi acos(-1)
#define pb push_back
#define test int TEST;cin>>TEST;while(TEST--)
#define vsort(xx) sort(xx.begin(),xx.end())
#define vrevsort(xx) sort(xx.rbegin(),xx.rend())


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    string s;cin>>s;
  if(s=="ABC") cout<<"ARC";
     else cout<<"ABC";
   
    return 0;
}




Measured memory_bytes: 3660
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

const int maxn = 100010;
const int mod = 1e9+7;
typedef long long ll;

char s[maxn];
int jc[maxn], cnt[maxn];
int n = 0;

int qpow(int x, int y) {
	int ret = 1;
	while (y) {
		if (y & 1)
			ret = 1ll*ret*x%mod;
		x = 1ll*x*x%mod;
		y >>= 1;
	}
	return ret;
}

int cal(int c) {
	if (c <= 1) return 0;
	return (1ll*qpow(2, c)-1+mod-c)%mod;
}

int main() {
	scanf("%d", &n);
	jc[0] = 1;
	scanf("%s", s+1);
	for (int i = 1; i <= n; i++) {
		jc[i] = 1ll*jc[i-1]*i%mod;
		cnt[s[i]-'a'] ++;
	}
	int ans = qpow(2, n) - 1;
	int k = 1;
	int sum = n;
	for (int i = 0; i < 26; i++) {
		sum -= cnt[i];
		ans = (ans + mod - 1ll*k*cal(cnt[i])%mod*qpow(2, sum)%mod) % mod;
		k = 1ll*k*(cnt[i]+1)%mod;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 768
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()
def main():
    X=int(input())

    def isprime(n):
        for i in range(2, int(n**0.5+1)):
            if n%i == 0:
                return False
        else:
            return True

    while isprime(X) == False:
        X += 1
    print(X)


# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc149","c",main)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  vector<int> A(5),B(5);
  rep(i,5){
    cin>>A[i];
    if(A[i]%10) B[i]=A[i]%10;
    else B[i]=10;
    A[i]=(A[i]+9)/10*10;
  }
  sort(all(B));
  cout<<B[0]+A[0]+A[1]+A[2]+A[3]+A[4]-10<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 510000;
const double pi=acos(-1);

int main(){
    string s;
    getline(cin,s);
    rep(j,s.size()){
      if('a'<=s[j] && s[j]<='z')  s[j]+='A'-'a';
      else if('A'<=s[j] && s[j]<='Z')  s[j]-='A'-'a';
    }
    cout << s << endl;
    return 0;
  
}



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

long calc(string S, int p, int N) {
  long ans = 0;
  int st = 0, nchar = 1;
  for (int i = 0; i < N; i++) {
    if (p % 2) {
      ans += stol(S.substr(st, nchar));
      st = st + nchar;
      nchar = 1;
    } else {
      nchar++;
    }
    p >>= 1;
  }
  ans += stol(S.substr(st, nchar));
  return ans;
}

int main() {
  string S;
  cin >> S;

  int N = S.size() - 1;
  long ans = 0;
  for (int i = 0; i < pow(2, N); i++) {
    ans += calc(S, i, N);
  }
  cout << ans << endl;
}

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

int main() {
	string s, ans("");
	bool t = true;
	cin >> s;
	for(int i = 0; i < s.size(); ++i){
		if(t && s[i] == 'A'){
			ans += s[i];
			t = false;
		}
		else if(!t && s[i] == 'Z'){
			ans += s[i];
			t = true;
		}
	}
	if(ans.size() >= 1 && ans[ans.size() - 1] == 'A')
		ans.erase(ans.size() - 1);
		
	if(ans.empty())
		cout << "-1" << endl;
	else
		cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define DIM 100007
#define INF 1000000009.0
#define X 500007
#define epc 0.0000001
#define pi 3.14159265358979323846
#define MAX 25
#define MODULO 10009
const long double gr=(1+sqrt(5))/2;

typedef int I;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

typedef pair<I,I> pII;
typedef pair<ll,ll> pllll;
typedef pair<ld,ld> pldld;

typedef vector<I> vI;
typedef vector<ll> vll;
typedef vector<pllll> vpllll;

typedef char cr;
typedef string str;

typedef tree<
I,
null_type,
less<I>,
rb_tree_tag,
tree_order_statistics_node_update> mset;

ll n,h[DIM],d[DIM];

int main()
{
    //freopen("suffarray.in", "r", stdin);
    //freopen("suffarray.out", "w", stdout);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //cout<<"ops"<<endl;

    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //ll x1,y1,xs,ys,y1,y2,x3,x4,y3,y4;

    cin>>n;
    for(int i=1;i<=n;i++)cin>>h[i];
    d[2]=abs(h[1]-h[2]);
    for(int i=3;i<=n;i++)d[i]=min((abs(h[i]-h[i-1])+d[i-1]),(abs(h[i]-h[i-2])+d[i-2]));
    cout<<d[n]<<endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <ext/pb_ds/priority_queue.hpp> //__gnu_pbds::priority_queue
 
using std::pair;
using std::vector;
using std::string;

typedef long long ll;
typedef pair<int, int> pii;
 
#define fst first
#define snd second
#define pb(a) push_back(a)
#define mp(a, b) std::make_pair(a, b)
#define debug(...) fprintf(stderr, __VA_ARGS__)
 
template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }
 
const int N = 100000;
const int oo = 0x3f3f3f3f;
 
template<typename T> T read(T& x) {
    int f = 1; x = 0;
    char ch = getchar();
    for(;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
    for(; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48; 
    return x *= f;
}

ll x, y;
int main() {
#ifdef Wearry
    freopen("data.txt", "r", stdin);
    freopen("ans.txt", "w", stdout);
#endif 
    read(x), read(y);
    int ans = 0;
    while(y >= x) {
        x = x * 2;
        ans ++;
    }
    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <string>
#include <math.h>
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

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

int main()
{
        //input->compute->output//
        int N;
        cin >> N;

        cout << "Christmas"
             << " ";

        for (int i = 0; i < 25 - N; i++)
        {
                cout << "Eve"
                     << " ";
        }
        cout << endl;

        return 0;
}


Measured memory_bytes: 256
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7

def mapline(t = int):
    return map(t, sysread().split())
def mapread(t = int):
    return map(t, read().split())

def run():
    N, *A = mapread()
    ans = 1
    current = [0,0,0]
    for a in A:
        transition = 0
        cache = None
        for i, c in enumerate(current):
            if c == a:
                transition += 1
                cache = i
        ans *= transition
        ans %= mod
        if cache == None:
            print(0)
            return
        current[cache] += 1
        #print(current)
    print(ans)

if __name__ == "__main__":
    run()


Measured memory_bytes: 19348
#pragma GCC optimize ("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
#define all(x) x.begin(), x.end()
#define trav(i,a) for(auto &i:a) 
inline int in(){int x;scanf("%lld",&x);return x;}
int32_t main()
{
	int n=in();
	int l=n/2;int h=l+1;
	l--;h--;
	vector<int> a(n),b(n);
	for(int i=0;i<n;i++)a[i]=in();
	
	b=a;
	sort(all(b));
	int lo=b[l];int hi=b[h];
	
	for(int i=0;i<n;i++)
	{
		if(a[i]<=lo)cout<<hi<<"\n";
		else cout<<lo<<"\n";
	}
	
}

Measured memory_bytes: 6432
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

class Main {

        static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        public static void main(String[] args) throws Exception{
            int N = 50022;
            int[] primes = new int[N];
            for (int i=0; i<N; i++) {
                if (i == 0 || i == 1)
                    primes[i] = 0;
                else
                    primes[i] = 1;
            }

            for (int i=2; i<N/2; i++) {
                if (primes[i] == 0) continue;
                for (int j=i*2; j<N; j+=i) {
                    primes[j] = 0;
                } 
            }

            /*HashMap<Integer, Integer> iidx = new HashMap<Integer, Integer>(); 
            int[] prime_seq = new int[N]; 
            int j = 0;
            for (int i=0; i<N; i++) {
                if (primes[i] == 1) {
                    prime_seq[j] = i;
                    iidx.put(i, j);
                    j++;
                }
            }*/

            String row = "";
            while ((row = reader.readLine()) != null) {
                if(row.isEmpty()) return;
                int n = Integer.parseInt(row);
               
                int prev=0, next=0; 
                for (int i=n-1; i>=0; i--) {
                    if (primes[i] == 1) {
                        prev = i; 
                        break; 
                    }
                }

                for (int i=n+1; i<=N; i++) {
                    if (primes[i] == 1) {
                        next = i;
                        break; 
                    } 
                }
               
                System.out.println(prev + " " + next);
            }
            
        }

}

Measured memory_bytes: 18916
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


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

	public static void main (String [] args){
		List <Integer> list = new ArrayList<Integer>();
		int v1 = Integer.parseInt(sc.next());
		int v2 = Integer.parseInt(sc.next());;
		String ans = "";
		if (v1*v2%2 == 0){
			ans = "No";
		}else{
			ans = "Yes";
		}
		
		System.out.println(ans);
		System.out.flush();
		sc.close();
	}
}

Measured memory_bytes: 22612
#include<iostream>
using namespace std;
int main () {
  int R = 0;
  int B = 0;
  int N;
  cin >> N;
  for (int i = 0; i < N; i ++) {
    char c;
    cin >> c;
    if (c == 'R') R ++;
    else B ++;
  }
  if (R > B) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

int main(){
    string s;
    cin>>s;
    if(s=="A"){
        s="T";
    }
    else if(s=="T"){
        s="A";
    }
    else if(s=="G"){
        s="C";
    }
    else{
        s="G";
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();
		int[] B = new int[M];
		int[][] A = new int[N][M];
		for (int i = 0; i < M; i++) {
			B[i] = sc.nextInt();
		}
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		int resNum = 0;
		for (int i = 0; i < N; i++) {
			long sum = 0;
			for (int j = 0; j < M; j++) {
				sum += A[i][j] * B[j];
			}
			if (sum > -C) {
				resNum++;
			}
		}
		System.out.println(resNum);
	}
}


Measured memory_bytes: 36480
s1 = input()
s2 = input()

s1 = sorted(s1)
s2 = sorted(s2)
s2 = s2[::-1]

s1 = "".join(s1)
s2 = "".join(s2)

array = [s1,s2]
exchange = sorted(array)

if array[0]==exchange[0] and s1!=s2:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
import java.util.*;
public class Main {
	
	static int primes[];
	static int N = (int)1e5;
	
	public static void main(String[] args) {	
		
		Scanner sc = new Scanner(System.in);
		int Q = sc.nextInt();
		int sections[][] = new int[Q][2];
		for(int i=0;i<Q;i++) {
			sections[i][0] = sc.nextInt();//l
			sections[i][1] = sc.nextInt();//r
			}
		sc.close();
		
		primes = new int[N+1];
		Arrays.fill(primes, 1);
		sieve();//primesは素数の位置だけ１になっている
		
		//累積和 cumulative sum
		int cum[] = new int[N+1];
		for(int i=1;i<=N;i++) {
			if(i%2==0)cum[i]=cum[i-1];
			else {
				if(primes[i]==1&&primes[(i+1)/2]==1) {
					cum[i]=cum[i-1]+1;
				}else {
					cum[i]=cum[i-1];
				}
			}
		}
		
		int ans[] = new int[Q];
		for(int i=0;i<Q;i++) {
			int l = sections[i][0], r = sections[i][1];
			ans[i] = cum[r]-cum[l-1];
		}
		
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<Q;i++) {
			sb.append(ans[i]+"\n");
		}
		System.out.println(sb.toString());
		
		
	}
	static void sieve() {
		primes[0]=primes[1]=0;
		for(int i=2;i*i<=N;i++) {
			if(primes[i]==1) {
				for(int j=i*2;j<=N;j+=i) {
					primes[j]=0;//0なら素数ではない。
				}
			}
		}
		
	}
}

Measured memory_bytes: 94436
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<tuple>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

using namespace std;

int main() {
	string s, t;
	cin>>s>>t;
	int dp[s.size() + 1][t.size() + 1];
	REP(i, s.size() + 1) {
		REP(j, t.size() + 1) {
			if(i == 0 || j == 0) dp[i][j] = max(i, j);
			else {
				int cost = s[i - 1] != t[j - 1];
				dp[i][j] = min(min(dp[i - 1][j] + 1, dp[i][j - 1] + 1), dp[i - 1][j - 1] + cost);
			}
		}
	}
	cout<<dp[s.size()][t.size()]<<endl;
}

Measured memory_bytes: 7052
#include <stdio.h>
#define NUMBER 100

void print_array(int array[],int num){
	int i;
	
	for(i = 0; i < num - 1; i++)
		printf("%d ", array[i]);
	
	//スペースを出力したくないので最後の要素だけfor文外で出力
	printf("%d\n", array[i]);
}

void insertionSort(int array[],int num){
	int i, j, v;
	for(i = 1; i <= num - 1 ; i++){
		v = array[i];
		j = i - 1;
		while(j >= 0 && array[j] > v){
			array[j + 1] = array[j];
			j--;
		}
		array[j + 1] = v;
		//配列の出力
		print_array(array, num);
	}
}

int main(void){
	int array[NUMBER];
	int num, i;
	
	scanf("%d", &num);
	
	for(i = 0; i < num; i++){
		//配列を入力
		scanf("%d", &array[i]);
	}
	print_array(array, num);
	
	//挿入ソート
	insertionSort(array, num);

	
	return 0;
}


Measured memory_bytes: 2052
#include<iostream>

int main(){
  int n, x, counter;
  while(1){
    counter = 0;
    std::cin >> n >> x;
    if(n == 0 && x == 0) break;
    for(int i = 1; i <= n; i++){
      for(int j = 1; j <= n; j++){
	for(int k = 1; k<= n; k++){
	  if(i + j + k == x){
	    if(i != j && i != k && j != k){
	      if(i < j && j < k){
		counter++;
	      }
	    }
	  }
	}
      }
    }
    std::cout << counter << std::endl;
  }
  return 0;
}

Measured memory_bytes: 3096
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
const int INF=1e+9;
const ll INFLL=1e+17;
double N,K;
double pow2[30];
void make_pow2(){
  pow2[0]=1;
  rep1(i,20){
    pow2[i]=2*pow2[i-1];
  }
}
double solve(){
  double res=0;
  make_pow2();
  for(double i=1;i<=N;i++){
    int j=0;
    while(i*pow2[j]<K) j++;
    res+=1/N/pow2[j];
  }
  return res;
}
int main(){
  cin>>N>>K;
  printf("%.10f\n",solve());
  return 0;
}


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

int main(){
    string s; cin >> s;
    vector<long long int > ans(s.size(), 0);
    int j = 0;
    int ans1 = 0;
    int mid = 0;
    int start = 0;;
    int res;
    for(int i = 0; i < s.size(); i++){
        if(j == 0){
            if(s[i] == 'L'){
                j = 1;
                mid = i;
            }
        }else if(j == 1){
            if(s[i] == 'R'){
                j = 0;
               res = max((start - mid),(i - mid));
           float f = i - start;
            if(res % 2 == 1){
                ans[mid] = round(f/2);
                ans[mid-1] = f/2;
            }else{
                ans[mid-1] = round(f/2);
                ans[mid] = f/2;
            }
                ans1 = 0;
                start = i;
            }
        }
        ans1++;
        if(i == s.size()-1){
           res = max((start - mid),(i+1 - mid));
           float f = i+1 - start;
            if(res % 2 == 1){
                ans[mid] = round(f/2);
                ans[mid-1] = f/2;
            }else{
                ans[mid-1] = round(f/2);
                ans[mid] = f/2;
            }
        }
    }
    for(int i = 0; i < s.size(); i++){
        cout << ans[i] << " ";
    }
}

Measured memory_bytes: 1408
from numba import njit
import numpy as np
@njit
def dfs(v,c,h,stay,todo):
    # hを更新
    todo[0]=v
    now=0
    while now>=0:
        vv=todo[now]
        now-=1
        x,y=divmod(vv,n)
        for dx,dy in ((0,1),(0,-1),(1,0),(-1,0)):
            nx,ny=x+dx,y+dy
            if 0<=nx<n and 0<=ny<n:
                nv=nx*n+ny
                if h[nv]>h[vv]+stay[vv]:
                    h[nv]=h[vv]+stay[vv]
                    now+=1
                    todo[now]=nv

@njit
def main(n,p):
    h=[min(i//n,n-i//n-1,i%n,n-i%n-1) for i in range(n**2)]
    h=np.array(h,np.int32)
    stay=np.full(n*n,1,np.int32)
    todo=np.zeros(n*n,np.int32)
    ans=0
    for v in p:
        c=h[v]
        ans+=c
        stay[v]=0
        dfs(v,c,h,stay,todo)
    print(ans)

if __name__=='__main__':
    n=int(input())
    p=np.array(list(map(int,input().split())),np.int32)
    p-=1
    main(n,p)

Measured memory_bytes: 120500
n = int(input())
p = list(map(int, input().split()))

count = 0

for i in range(1, n-1):
  if p[i] > p[i-1] and p[i] < p[i+1]:
    count += 1
  elif p[i] > p[i+1] and p[i] < p[i-1]:
    count += 1

print(count)

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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, a, n) for (int i = (n); i < (a); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int r,g;cin>>r>>g;
  cout<<g*2-r<<endl;
}

Measured memory_bytes: 256
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>
#include <list>
#include <random>

// macros
#define ll long long int
#define pb emplace_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;

// solve
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(a > b){a = b; return 1;} return 0;}

ll dp[200001];
vector<int> vec[200001];
ll sum[200001];

int main(int argc, char const* argv[])
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> c(n);
  rep(i, n)cin >> c[i], c[i]--;
  vector<int> C;
  for(int i = 0; i < n; i++){
    if(i == 0 || c[i] != c[i-1])C.pb(c[i]);
  }
  for(int i = 0; i < sz(C); i++){
    vec[C[i]].pb(i);
  }
  dp[0] = 1;
  for(int i = 0; i < sz(C); i++){
    dp[i+1] = dp[i];
    dp[i+1] = (dp[i+1] + sum[C[i]]) % mod;
    sum[C[i]] = (sum[C[i]] + dp[i]) % mod;
  }
  cout << dp[sz(C)] << endl;
	return 0;
}


Measured memory_bytes: 15860
#include<iostream>
#include<string>

using namespace std;

int main(void)
{
	string  A,B,C;
	cin >> A >> B >> C;
	
		if (A[A.size()-1] == B[0] && B[B.size()-1] == C[0])// str.size() strの文字数が取得できる
	{
		cout << "YES" <<endl;
	}
	else
	{
		cout << "NO" <<endl;
	}
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
N = int(input())
f = 0
if N == 1:
  print("Yes")
  print(2)
  print(1, 1)
  print(1, 1)
  exit(0)
for i in range(1, N + 1):
  if i * (i + 1) == 2 * N:
    f = i + 1
    break
if f:
  print("Yes")
  print(f)
  res = [set() for _ in range(f + 1)]
  table = [0] * (N + 1)
  for i in range(N):
    res[i % f + 1].add(i + 1)
    table[i + 1] = 1
  for i in range(1, f + 1):
    for j in range(f - len(res[i]) - 1):
      for k in res[(i + j) % f + 1]:
        if table[k] < 2:
          res[i].add(k)
          table[k] += 1
          break
    print(len(res[i]), *sorted(res[i]))
else:
  print("No")


Measured memory_bytes: 70748
n = int(input())
c_ls, s_ls, f_ls = [0] * n, [0] * n, [0] * n
for i in range(n-1):
    c,s,f = map(int,input().split())
    c_ls[i] = c
    s_ls[i] = s
    f_ls[i] = f
# sta_num + 1 駅までの時間を求める
def to_sta(time_used, sta_num):
    if time_used < s_ls[sta_num]:
        return s_ls[sta_num] + c_ls[sta_num]
    else:
        if (time_used - s_ls[sta_num]) % f_ls[sta_num] == 0:
            return time_used + c_ls[sta_num]
        else:
            return time_used + c_ls[sta_num] + f_ls[sta_num] - ((time_used - s_ls[sta_num]) % f_ls[sta_num])
for start in range(n):
    time_used = 0
    for nex in range(start, n-1):
        time_used = to_sta(time_used, nex)
    print(time_used)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define endl '\n'
#define PI acos(-1)
#define bitcount(a) __builtin_popcountll(a)
#define P pair<int,int>
#define ff first
#define ss second
typedef tree<int,null_type,less_equal <int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
long double eps=1e-9;
int mod=1e9+7;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n;
	cin>>n;
	int k;
	cin>>k;
	int a[n+1];
	for(int i=1;i<=n;i++)
		cin>>a[i];
	int ans=0;
	ans=1;
	n-=k;
	ans+=(n+k-2)/(k-1);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1LL << 60;
#define LLINF 1e12
#define PI 3.14159265359
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int ny, nx;
typedef long long ll;
using namespace std;

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

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

ll llmin(ll x, ll y) { return x < y ? x : y; }
ll llmax(ll x, ll y) { return x > y ? x : y; }

template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v)
{
    return (c.end() != std::find(c.begin(), c.end(), v));
}

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

ll nCr(int n, int r)
{
    if (n == r or n == 0)
        return 1;
    if (n < r)
        return 0;
    if (r == 1)
        return n;
    return nCr(n - 1, r - 1) + nCr(n - 1, r);
}

//std::cout << std::defaultfloat << std::setprecision(10);
////////////////////////////////////////
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    int n; cin >> n;
    vector<int> a(n);
    REP(i,n) cin >> a[i];

    sort(a.begin(), a.end(), greater<int>());

    int big = a[0];

    if(a.size()==2){
        cout << a[0] << " " << a[1] << endl;
        return 0;
    }

    if(big%2==0){
        int median = big / 2;
        int remain = 1e9;
        int ans;
        REP(i,n){
            if(abs(a[i] - median) < remain){
                remain = abs(a[i] - median);
                ans = a[i];
            }
            else break;
        }
        cout << big << " " << ans << endl;
    }else{
        int small_median = big / 2;
        int big_median = big / 2 + 1;
        int remain = 1e9;
        int ans;

        REP(i,n){
            if(min(abs(a[i]-small_median) , abs(a[i]-big_median)) < remain){
                remain = min(abs(a[i]-small_median) , abs(a[i]-big_median));
                ans = a[i];
            }else break;
        }
        cout << big << " " << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAX = 20;
vector<ll> seq_a(MAX);
ll n, m;

ll solve(ll point,ll target)
{
    if( target == 0 ) return 1;
    if( point >= n) return 0;
    ll res = solve(point + 1, target) || solve(point + 1, target - seq_a.at(point));
    return res;
}
signed main() {
    cin >> n;
    for (ll i = 0; i < n; i++) cin >> seq_a.at(i);
    cin >> m;
    for(ll i = 0; i < m; i++) {
        ll M; cin >> M;
        if( solve(0, M) ) cout << "yes" << endl;
        else cout << "no" << endl;
    }

    return 0;
}




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

using i64 = int64_t;

int main(){
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int ans = 0;
    for(int i=0;i<n;++i){
        if(i > 0 && s[i] == 'L' && s[i-1] == 'L')ans++;
        if(i < n-1 && s[i] == 'R' && s[i+1] == 'R')ans++;
    }
    vector<pair<char, int>> v;
    for(int i=0;i<n;++i){
        char c = s[i];
        int cnt = 0;
        do{
            cnt++;
            i++;
            if(i>=n)break;
        }while(s[i] == c);
        v.emplace_back(c, cnt);
        i--;
    }
    int op = 0;
    for(int i=1;i<v.size();i+=2){
        v[i].first = v[0].first;
        if(i == v.size()-1){
            ans++;
            break;
        }
        ans += 2;
        op++;
        if(op >= k)break;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1528
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        if (Math.abs(b - a) % 2 == 0) { out.println("Alice"); } else { out.println("Borys"); }
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}


Measured memory_bytes: 22484
/**
 *    author:  [itmo] enot110
 *    created: 26.08.2017 15:04:03       
**/
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define forn(i, n) for(int i = 0 ; (i) < (n) ; ++i)
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(),a.end()
#define pw(x) (1LL<<(x))

using namespace std;

typedef long long ll;
typedef double dbl;
typedef vector<int> vi;
typedef pair<int, int> pi;

const int inf = 1.01e9;
const dbl eps = 1e-9;

/* --- main part --- */

const int N = 2e5 + 10;

char s[N];
int cnt[26];

int main()
{
    #ifdef HOME
        assert(freopen("1.in", "r", stdin));
        assert(freopen("1.out", "w", stdout));
    #endif
    scanf("%s", s);
    int n = strlen(s);
    forn(i, n) cnt[s[i] - 'a']++;
    ll res = 0;
    forn(i, 26) forn(j, i) res += cnt[i] * (ll)cnt[j];
    printf("%lld\n", res + 1);
    #ifdef HOME
        eprintf("time = %d ms\n", (int)(clock() * 1000. / CLOCKS_PER_SEC));
    #endif
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define INF 1e9
typedef long long ll;
using namespace std;

int main() {
    int maxnum = 0;
    int minnum = INF;
    int n; cin >> n;
    rep(i,n){
        int a; cin >> a;
        maxnum = max(maxnum,a);
        minnum = min(minnum,a);
    }
    cout << maxnum-minnum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// sliding_minimum(L, comp = std::less<T>): L is the width of segments;
// operator[k]: returns the result of the k-th segment;
// size(): returns the length of val
// data_size(): returns the length of data
// amorized time: O(N)
template<
	class T,
	class Compare = std::less<T>
> class sliding_minimum {
public:
	using value_type = T;
	using u32 = std::uint_fast32_t;

protected:
	std::vector<value_type> data, val;
	std::deque<u32> deq;
	
	u32 L;

	Compare comp;
	
public:
	sliding_minimum(const Compare & comp = Compare()) : L(1), comp(comp) {}
	sliding_minimum(const u32 & L, const Compare & comp = Compare()) : L(L), comp(comp) {}
	sliding_minimum(const u32 & L, const std::vector<value_type> & vec, const Compare & comp = Compare()) : L(L), comp(comp) {
		for(auto x: vec) push(x);
	}
	
	bool push(value_type x) {
		const u32 i = data.size();
		data.push_back(x);

		while(!deq.empty() and i >= L + deq.front()) deq.pop_front();
		while(!deq.empty() and comp(x, data[deq.back()])) deq.pop_back();
		deq.push_back(i);

		if(i + 1 >= L) {
			val.push_back(data[deq.front()]);
			return true;
		}
		return false;
	}
	
	const u32 width() const { return L; }
	const size_t size() const { return val.size(); }
	const size_t data_size() const { return data.size(); }
	const value_type operator[](const u32 & k) const { return val[k]; }
	const value_type front() { return val.front(); }
	const value_type back() { return val.back(); }
	const std::vector<value_type> get_data() { return data; }
	void swap(sliding_minimum & r) {
		using std::swap;
		data.swap(r.data);
		val.swap(r.val);
		deq.swap(r.deq);
		swap(L, r.L);
		swap(comp, r.comp);
	}
};

int main() {
	int n, L; scanf("%d%d", &n, &L); std::vector<int> a(n);
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	
	sliding_minimum<int> sm(L, a);
	
	for(int i = 0; i < sm.size(); i++) {
		if(i + 1 == sm.size()) printf("%d\n", sm[i]);
		else printf("%d ", sm[i]);
	}
	return 0;
}



Measured memory_bytes: 15372
n = int(input())
a_s = list(map(int, input().split()))

flag = 0
ans = 1
tmp = 0

for i in range(n):
    if i == 0:
        continue
    elif a_s[i] > a_s[i-1]:
        if flag == -1:
            ans += 1
            flag = 0
        else:
            flag = 1
    elif a_s[i] < a_s[i-1]:
        if flag == 1:
            ans += 1
            flag = 0
        else:
            flag = -1

print(ans)


Measured memory_bytes: 20312
#include<bits/stdc++.h>
    using namespace std;
    const int mx=1e6+42;
    int main(){
   string a;
   cin>>a;
   if(a=="AAA")cout<<"No"<<endl;
   else if(a=="BBB")cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
        return 0;
    }


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int h, w, a[250005], i, j, cnt = 0;
  bool odd = false, t = false;
  scanf("%d%d", &h, &w);
  for(i = 0; i < h; i++) for(j = 0; j < w; j++)
    scanf("%d", &a[i*w + (i%2 ? j : w-1-j)]);
  for(i = 0; i < h*w; i++){
    if(odd) cnt++;
    if(a[i]%2) odd ^= true;
  }
  printf("%d\n", cnt);
  
  for(i = 0; i < h*w; i++){
    if(t)
      printf("%d %d %d %d\n", (i-1)/w+1, ((i-1)/w%2 ? (i-1)%w : w-1-(i-1)%w)+1, i/w+1, (i/w%2 ? i%w : w-1-i%w)+1);
    if(a[i]%2) t ^= true;
  }
}


Measured memory_bytes: 3072