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

typedef long long int lli;
#define int lli
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef vector<pii> vii;

const int MOD	= 1e9 + 7;
const double PI = acos(-1.0);

#define fastio			ios_base::sync_with_stdio(0);cin.tie(0)
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define endl "\n"
#define error(x) cerr << #x << " = " << (x) << endl
#define errorp(p) cerr << #p << " = " << (p.first) << ", " << (p.second) << endl

template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template <typename T> T lcm(T a, T b){return (a*b)/gcd(a,b); }

void solve(){
    int a;
    string b;
    cin >> a >> b;
    
    int bb = (b[0] - '0')*100 + (b[2] - '0')*10 + (b[3] - '0');
    int ans = a * bb;
    ans /= 100;
    // double frac = ans ;
    cout << ans << endl;
}

signed main(){
    #ifdef DEBUG
		freopen("test", "r", stdin);
	#endif
    fastio;

    solve();

    return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
int main()
{
    double L[10];
    double V1, V2;
    double meet_pos, railway_lenth;
    int cnt, output_cnt;
    int output[50];
    
    output_cnt = 0;
    while(scanf("%lf,", &L[0]) != EOF){
    	for(cnt = 1; cnt < 10; cnt++)
			scanf("%lf,", &L[cnt]);
		scanf("%lf,%lf", &V1, &V2);
    	
    	railway_lenth = 0;
    	for(cnt = 0; cnt < 10; cnt++)
			railway_lenth += L[cnt];
    	meet_pos = railway_lenth * V1 / (V1 + V2);
    	
    	railway_lenth = 0;
    	for(cnt = 0; railway_lenth < meet_pos; cnt++)
			railway_lenth += L[cnt];
    	output[output_cnt] = cnt;
    	output_cnt++;
    }
    
    for(cnt = 0; cnt < output_cnt; cnt++)
		printf("%d\n", output[cnt]);
    
    return 0;
} 

Measured memory_bytes: 624
from collections import deque
def solve():
    S = input()
    q = deque()

    for op in S:
        if op == '0':
            q.append(op)
        elif op == '1':
            q.append(op)
        else:
            if not len(q) == 0:
                q.pop()
    
    print("".join(list(q)))

if __name__ == '__main__':
    solve()

Measured memory_bytes: 38256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main() {
  string S; cin >> S;
  sort(S.begin(), S.end());
  if (S[0]==S[1] && S[1]!=S[2] && S[2]==S[3]) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
constexpr ll INF = 1ll << 55;

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

// multi-dimensional vector (require c++14)
template <typename T, typename U>
static inline vector<U> make_nd_vector(T &&n, U &&val) noexcept {
  static_assert(is_integral<T>::value,
                "[make_nd_vector] 1st argument must be an integer type");
  return vector<U>(forward<T>(n), forward<U>(val));
}
template <typename T, typename... Args>
static inline decltype(auto) make_nd_vector(T &&n, Args &&... args) noexcept {
  static_assert(is_integral<T>::value,
                "[make_nd_vector] 1st argument must be an integer type");
  return vector<decltype(make_nd_vector(forward<Args>(args)...))>(
      forward<T>(n), make_nd_vector(forward<Args>(args)...));
}
//
// Print from Iterator
template <typename ite>
void print_ite(ite start, ite end, char sp = ' ', char en = '\n') {
  for (auto i = start; i != end; i++)
    cout << *i << sp;
  cout << en;
}
//
inline void Yes(bool condition) { cout << (condition ? "Yes\n" : "No\n"); }

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


Measured memory_bytes: 3160
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, n) for(int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<50);
const double inf=pow(10,10);
const ld pi=acosl(1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};

void solve(){
  ll n,k;cin>>n>>k;
  ld ans=0;
  rep(i,n){
    ll num=0;
    ll point=i+1;
    while(point<k){
      num++;
      point*=2;
    }
    ans+=powl((ld)0.5,(ld)num);
  }
  ans/=(ld)n;
  cout<<ans<<endl;
}

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


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <array>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <limits>

using namespace std;

int u_find(vector<int>& roots, int idx) {
	if (roots[idx] == idx) {
		return idx;
	} else {
		return roots[idx] = u_find(roots, roots[idx]);
	}
}

int main (int argc, char* argv[]) {
	int n, m;
	cin >> n >> m;
	vector<int> roots(n);
	for (int i = 0; i < n; i++) {
		roots[i] = i;
	}
	int rem = n;
	for (int i = 0; i < m; i++) {
		int x, y, z;
		cin >> x >> y >> z;
		x--; y--;
		int x_id = u_find(roots, x);
		int y_id = u_find(roots, y);
		if (x_id == y_id) continue;
		roots[y_id] = x_id;
		rem--;
	}
	cout << rem << endl;
}


Measured memory_bytes: 640
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <set>
#include <assert.h>
#include <numeric>
#define fast ios_base::sync_with_stdio(false)
#define mxn (ll)(1e5+5)
#define mod (ll)(1e9+7)
#define mod1 (ll)(998244353)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define crz(v,n) v.clear(),v.resize(n+1,0)
#define print(v) for(ll it=0;it<v.size();it++) cout<<v[it]<<" ";cout<<endl
#define printp(v) for(ll it=0;it<v.size();it++) cout<<v[it].first<<" "<<v[it].second<<endl
using namespace std;
int main(){fast;
	int n,i,x;ll s=0;cin>>n;
	map<int,int>mp;for(i=0;i<n;i++) cin>>x,mp[x]++,s+=x;
	int q;cin>>q;while(q--){
		int b,c;cin>>b>>c;
		s+=1LL*mp[b]*(c-b);cout<<s<<endl;
		mp[c]+=mp[b],mp[b]=0;
	}
}


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

namespace ABC114A
{
    class Program
    {
        static void Main(string[] args)
        {

            int x = int.Parse(Console.ReadLine());

            if (x == 7 || x == 5 || x == 3)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");

            Console.ReadKey();
        }
    }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h>
#define  pb push_back
#define  xx first
#define  yy second
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;
int h,n;
int dp[1001][100100];
int a[4000],b[4000];
/*
int go(int i,int sum){

        if(dp[i][sum]!=-1) return dp[i][sum];

       dp[i][sum] =min(val[i]+go(i+1,W-a[i]),go(i+1,W));
       return dp[i][sum];
}
*/
 int main()
{
   // fast;
  int a,b,t;
  int tot = 0;
  cin >> a>>b>>t;
  for(int i=1; i<=t; i++){
    if(i%a==0) tot+=b;
  }
  cout << tot << endl;


   return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)//初期値a,i<bの範囲でループ
#define REP(i,n) FOR(i,0,n)//初期値0,i<nの範囲でループ
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;

int N,C;
int s[100010],t[100010],c[100010];
int tt[200020];
int sm[200020];


int main(){

    cin>>N>>C;
    REP(i,N){
        cin>>s[i]>>t[i]>>c[i];
    }

    for(int i=1;i<=C;i++){
        REP(j,200002)tt[j]=0;
        REP(j,N){
            if(c[j]==i)tt[s[j]*2-1]++,tt[t[j]*2]--;
        }
        FOR(j,1,200002)tt[j]+=tt[j-1];
        REP(j,200002)if(tt[j]>0)sm[j]++;
        
    }


    int max=0;
    REP(i,200002){
        if(sm[i]>max)max=sm[i];
    }
    cout<<max<<endl;

    

    return 0;
}

Measured memory_bytes: 2944
N,M = map(int,input().split())
L = list(map(int,input().split()))
S = sum(L)
L = sorted(L)
A = 0
#print(L)

for i in L:
    #print(i)
    if i >= S/4/M:
        
        A += 1
        
#print(A)
if A >= M:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    ll k;
    cin>>k;
    vector<ll>a(50,49+k/50);
    ll cnt=k%50;
    rep(i,k%50){
        a[i]+=51-k%50;
    }
    REP(i,k%50,50){
        a[i]-=k%50;
    }
    cout<<50<<endl;
    rep(i,50){
        cout<<a[i]<<' ';
    }
    cout<<endl;
}

Measured memory_bytes: 764
#include <stdio.h>
int main(void){
    // Your code here!
    int A,B,C,max = 0;
    scanf("%d",&A);
    if(A > max) max = A;
    scanf("%d",&B);
    if(B > max) max = B;
    scanf("%d",&C);
    if(C > max) max = C;
    
    printf("%d\n",max*10 + (A+B+C-max));
    
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<pair<int,int>>list(M);
  for(int i=0;i<M;i++){
    cin>>list.at(i).first>>list.at(i).second;
  }
  sort(list.begin(),list.end());
  bool flag=true;
  for(int i=1;i<M;i++){
    if(list.at(i-1).first==list.at(i).first){
      if(list.at(i-1).second!=list.at(i).second){
        flag=false;
      }
    }
  }
  vector<int>data(N,0);
  if(N>1){
    data.at(0)=1;
  }
  for(int i=0;i<M;i++){
    data.at(list.at(i).first-1)=list.at(i).second;
  }
  if(data.at(0)==0&&N>1){
    flag=false;
  }
  if(flag){
    for(int i=0;i<N;i++){
      cout<<data.at(i);
    }
  }
  else{
    cout<<-1<<endl;
  }
}

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

typedef long long ll;

int main() {
  set<int> st;
  int q; cin >> q;
  for(int i=0; i<q; i++){
    int query, x;
    cin >> query >> x;
    if(query==0){
      st.insert(x);
      cout << st.size() << endl;
    }
    else if(query==1){
      auto itr = st.find(x);
      if(itr != st.end()) cout << 1 << endl;
      else cout << 0 << endl;
    }
    else if(query==2){
      st.erase(x);
    }
    else {
      int y; cin >> y;
      auto itrLower = st.lower_bound(x);
      auto itrUpper = st.upper_bound(y);

      while(itrLower != itrUpper){
        cout << *itrLower << endl;
        itrLower++;
      }
    }
  }
}


Measured memory_bytes: 12372
#include<stdio.h>
int main(void){
    int a = -1, b = -1, c = -1;
    while(a < 0 || b < 0 || c < 0 || 100 < a || 100 < b || 100 < c){
        scanf("%d %d %d", &a, &b, &c);
    }
    if(a < b && b < c){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 2052
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define sz(c) ((int)(c).size())

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
//const int MAX=;



int main(){
	int N;
	cin>>N;
	vi a(N,0),b(N,0);
	rep(i,N)cin>>a[i];
	rep(i,N)cin>>b[i];
	
	
	int ans=0;
	for(int k=28;k>=0;k--){
		int ca=0,cb=0;
		rep(i,N){
			if(a[i]>=(1<<k)){
				ca++;
				a[i]-=(1<<k);
			}
		}
		rep(i,N){
			if(b[i]>=(1<<k)){
				cb++;
				b[i]-=(1<<k);
			}
		}
//      	cout<<ca<<" "<<cb<<endl;
      	ca=ca%2;cb=cb%2;
		int fl=ca*((N%2)+2-cb)%2+cb*((N%2)+2-ca)%2;

      	if(k!=0){
			sort(a.begin(),a.end());
			rep(i,N){
				int d=lower_bound(a.begin(),a.end(),(1<<k)-b[i])-a.begin();
				fl+=(N-d)%2;
			};
        }
		fl=fl%2;
		ans+=(fl << k);
	}
	cout<<ans<<endl;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

int main(){
    ll n,k;cin >>n>>k;
    vector<pair<ll,ll>>p(n);
    for (int i = 0; i < n; ++i) {
        ll a,b;
        cin >>a>>b;
        p[i]=make_pair(a,b);
    }
    sort(all(p));
    ll now=0;
    ll ans;
    for (int i = 0; i < n; ++i) {
        now+=p[i].second;
        if(now>=k){
            ans=p[i].first;
            break;
        }
    }
    cout <<ans <<endl;
    return 0;
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b)-1; i >= (a); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;

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

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  int d, t, s;
  cin >> d >> t >> s;

  if (d <= t*s) cout << "Yes\n";
  else cout << "No\n";
}

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

using namespace std;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1000000007;

using ll = long long;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    cout << '[';
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len-1) s << ", ";
    }
    cout << ']';
    return s;
}


vector<long long> calc_divisor(long long n) {
    vector<long long> res;
    for (long long i = 1LL; i*i <= n; ++i) {
        if (n % i == 0) {
            res.push_back(i);
            long long j = n / i;
            if (j != i) res.push_back(j);
        }
    }
    sort(res.rbegin(), res.rend());
    return res;
}
int main(){

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

    ll n, m;
    cin >> n >> m;
    vector<ll> divisor = calc_divisor(m);

    for(int x : divisor){
        if(x*n <= m){
            ppp(x);
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
/*"Success isn't permanent, failure isn't fatal,
                                      it's the courage to continue that counts"*/
#include<bits/stdc++.h>
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN
using namespace std;
const ll mod=1e9+7;         
const int N=5e5+4;
int main()
{   
    ll n,a,b;
    
    cin>>n>>a>>b;
    
    ll dif=b-a;
    
    if(dif%2==0)
    {
        ll val=dif/2;
        
        cout<<val;
    }
    else
    {
        ll here;
        
        ll ans=min(b-1,n-a);
        
        ll ta=a,tb=b;
        
        here=ta-1+1;
            
        tb-=ta;
            
        here+=(tb-1)/2;
            
        ans=min(ans,here);
        
        here=n-b+1;
            
        a+=(n-b+1);
            
        here+=(n-a)/2;
            
        ans=min(ans,here);
        
        cout<<ans;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define FOR(i, b, n) for (ll i = b; i < n; ++i)

using namespace std;
using ll = long long;
using P = pair<int, int>;

void solve(ll N, vector<ll> A) {
  ll money(1000);
  ll kabu(0);
  REP(i, N - 1) {
    if (A[i] < A[i + 1]) {
      ll buy = money / A[i];
      kabu += buy;
      money -= buy * A[i];
    } else if (A[i] > A[i + 1]) {
      money += kabu * A[i];
      kabu = 0;
    }
  }
  money += kabu * A[N - 1];
  cout << money << endl;
}

int main(){
  // int 3E4  long 2E9  ll 9E18
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N;
  cin >> N;
  vector<ll> A(N);
  REP(i, N) {
    cin >> A[i];
  }

  solve(N, move(A));

  return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <sstream>
#include <vector>
#include <cassert>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <tuple>
#include <regex>
#include <map>

using namespace std;
using ull = unsigned long long;

int main() {
	int N, M;
	cin >> N >> M;
	
	vector<vector<int>> vec(N);
	for (size_t i = 0; i < N; i++) {
		int K;
		cin >> K;
		vec[i] = vector<int>(K, 0);
		for (auto&& a: vec[i]) {
			cin >> a;
		}
	}

	// 計算する。ゴリゴリと計算する。
	vector<int> ans(M, 0);
	for (auto&& col : vec) {
		for (size_t i = 0; i < col.size(); i++) {
			ans[col[i] - 1]++;
		}
	}

	const size_t ans_count = count_if(cbegin(ans), cend(ans), [N](auto a) {return a == N; });

	cout << ans_count << endl;

	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int desc(const void *a, const void *b){
    return *(int*)b-*(int*)a;
}
int main(void){
    int n,k,i;
    scanf("%d%d",&n,&k);
    int a[n];
    long long ans=0;
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    qsort(a,n,sizeof(int),desc);
    for(i=k;i<n;i++) ans+=a[i];
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int A, B;
	cin >> A;
	cin >> B;
	vector<int> calc = { A + B,A - B,A * B };
	int ans = max(calc[0], max(calc[1], calc[2]));
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main() {
  string str;
  int page;
  vector<pair<string, int>> vec;

  while (cin >> str >> page)
    vec.push_back(make_pair(str, page));

  sort(vec.begin(), vec.end(), [](auto &a, auto &b) {
    return (a.first != b.first) ? a.first < b.first : a.second < b.second;
  });

  string last = "";
  for (auto &v : vec) {
    if (last == v.first) {
      cout << " " << v.second;
   } else {
      if (last != "")
        cout << endl;
      cout << v.first << endl << v.second;
    }
    last = v.first;
  }
  cout << endl;
}


Measured memory_bytes: 3180
const fs = require('fs');

const createMemoizedFunction = (func, serializeFunc = JSON.stringify) => {
  let memo = new Map();
  const memoized = (...args) => {
    const key = serializeFunc(args);
    if (!memo[key]) {
      memo[key] = func(...args);
    }

    return memo[key];
  };

  return memoized;
};

const select = createMemoizedFunction((nums, m) => {
  if (m === 1) {
    return nums.map((n) => [n]);
  } else {
    const [fst, ...rest] = nums;
    return [
      ...(rest.length >= m ? select(rest, m) : []),
      ...select(rest, m - 1).map(c => [fst, ...c])
    ];
  }
});

const solve = (n, x) => {
  const nums = [...new Array(n).keys()].map(n => n + 1);
  return select(nums, 3).filter(c => c.reduce((prev, cur) => prev + cur) === x);
};

const main = input => {
  const result = input
    .split(/(\r)?\n/g)
    .filter(s => !!s && s !== "0 0")
    .map(s => {
      const [fst, snd] = s.split(" ");
      return solve(parseInt(fst), parseInt(snd)).length;
    }).join("\n");

  console.log(result);
}

main(fs.readFileSync('/dev/stdin', 'UTF-8'));



Measured memory_bytes: 234208
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>

using namespace std;

#define ll long long

vector<ll> ppp;
vector<vector<ll>> nelist;
vector<ll> counter;
vector<ll> used;

void dfs(ll pi, ll point)
{
    if(used.at(pi) == 1) {
        // 見たものは見ない
        return;
    }
    used.at(pi) = 1;
    point += ppp[pi];
    counter.at(pi) = point;
    for (auto child : nelist.at(pi))
    {
        dfs(child, point);
    }
    return;
}

void solve()
{
    ll N, Q;
    cin >> N >> Q;
    vector<ll> a(N - 1), b(N - 1);

    // 頂点1が根

    nelist = vector<vector<ll>>(N);
    counter = vector<ll>(N, 0);
    ppp = vector<ll>(N, 0);
    used = vector<ll>(N, 0);

    for (ll i = 0; i < N - 1; i++)
    {
        cin >> a.at(i) >> b.at(i);
        a.at(i) -= 1;
        b.at(i) -= 1;
        nelist.at(a.at(i)).push_back(b.at(i));
        nelist.at(b.at(i)).push_back(a.at(i));
    }

    for (ll i = 0; i < Q; i++)
    {
        ll pi, x;
        cin >> pi >> x;
        pi -= 1;
        ppp[pi] += x;
    }

    // used.at(0) = 1;
    dfs(0, 0);
    cout << counter.at(0);
    for (ll i = 1; i < N; i++)
    {
        cout << " " << counter.at(i);
    }
    cout << endl;

    return;
}

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


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

int main()
{
  int n;
  cin >> n;
  char ary[n];
  bool existsY = false;
  for (int i = 0; i < n; i++) cin >> ary[i];
  for (int i = 0; i < n; i++)
  {
    if(ary[i] == 'Y') existsY = true;
  }
  if(existsY) cout << "Four" << endl;
  else cout << "Three" << endl;
  return 0;
}


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

using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
 
  int ans = 0;
  for (int i=0; i<1000; i++) {
	string t(3,'0');
	for (int tmp=i,j=0; j<3; j++) t[j] = '0' + (tmp%10),tmp/=10;
     
	std::string::size_type pos = -1;
    bool f = false;
    for (int i=0; i<3; i++) {
	  pos = s.find(t[i], pos+1);
      if (pos == string::npos)  break;
      if (i==2) f = true;
    }
    
    if (f) ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3244
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using boost::multiprecision::cpp_int;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll,pair<ll, ll>> lpll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;

const ll LINF = LLONG_MAX;
// const ll MOD = 1e9+7;
const ll MOD = 998244353;

const ld PI = (acos(-1));
const ld EPS = 0.0000000001;
// cout << fixed << setprecision(10) << middle << endl;

int main() {
    // input, ready
    int N;
    cin >> N;

    // resolve
    N %= 10;

    if (N==2 || N==4 || N==5 || N==7 || N==9) {
        cout << "hon" << endl;
    }else if (N==3) {
        cout << "bon" << endl;
    } else {
        cout << "pon" << endl;
    }

    // output

    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll x;
  cin >> x;
  if(x%11==0) cout << x/11*2 << endl;
  else{
    ll num = x/11;
    if(11*num+6>=x) cout << 2*num+1 << endl;
    else if(11*num+11>x) cout << 2*num+2 << endl;
  }
}

Measured memory_bytes: 256
import sys
import itertools

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    per = list(itertools.permutations(range(1, n+1)))
    t = list(map(lambda x: "".join(str(i) for i in x), per))
    p = "".join(sys.stdin.readline().split())
    q = "".join(sys.stdin.readline().split())
    a = 0
    b = 0
    for i, x in enumerate(t):
        if p == x:
            a = i
        if q == x:
            b = i
    ans = abs(a - b)
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 16656
#include"bits/stdc++.h"


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 200010;
const int mod = 1e9+7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n;

int l[maxn],r[maxn],A[maxn],B[maxn],vi[maxn];

bool cmp1(int x,int y){
	return l[x]>l[y];
}
bool cmp2(int x,int y){
	return r[x]<r[y];
}

int calc(int &now,int l,int r){
	int ans=0;
	if(now<l){
		ans+=l-now;
		now=l;
	}
	if(r<now){
		ans+=now-r;
		now=r;
	}
	return ans;
}

ll solve(){
	REP(i,1,n)A[i]=B[i]=i,vi[i]=0;
	sort(A+1,A+n+1,cmp1);sort(B+1,B+n+1,cmp2);
	int now1=1,now2=1;
	ll ans=0;
	int now=0;
	REP(i,1,n){
		if(i&1){
			while(vi[A[now1]])now1++;
			vi[A[now1]]=1;
//			cout<<now<<' '<<l[A[now1]]<<' '<<r[A[now1]]<<endl;
			ans+=calc(now,l[A[now1]],r[A[now1]]);
		}
		else{
			while(vi[B[now2]])now2++;
			vi[B[now2]]=1;
			ans+=calc(now,l[B[now2]],r[B[now2]]);
		}
//		cout<<now<<endl;
	}
	return ans+abs(now);
}

void Work(){
	ll ans=solve();
	REP(i,1,n)l[i]=-l[i],r[i]=-r[i],swap(l[i],r[i]);
	ans=max(ans,solve());
	cout<<ans<<endl;
}

void Init(){
	read(n);
	REP(i,1,n)read(l[i],r[i]);
}

int main(){
	Init();
	Work();
	return 0;
}


Measured memory_bytes: 2176
"""
パーティションを作成する
"""
def partition(A, p, r):
    x = A[r]
    i = p-1 #A[i+1], A[i+2],,,がxより大きくなるようにしたい
    #jはxより大きいを指す
    for j in range(p, r):
        if A[j] <= x:
            i += 1
            A[j], A[i] = A[i], A[j]
        else:
            pass #何もできない
    A[i+1], A[r] = A[r], A[i+1]
    return i+1, A #交換したあとのxのインデックスを返す


n = int(input())
a = list(map(int, input().split()))
index, a = partition(a, 0, n-1)
a = list(map(str, a))
a[index] = "[" + str(a[index]) + "]"
print(' '.join(a))




Measured memory_bytes: 16388
# -*- coding: utf-8 -*-
import itertools
n, m, q = map(int,input().split())
abcd = []
for i in range(q):
    abcd.append([int(i) for i in input().split()])
"""
#再帰で求める（できない）
A = []
def func(B, n):
    if len(B) == n:
        A.append(B)
        return
    elif len(B) == 0:
        for i in range(1, m+1):
            func(B + [i], n)
    else:
        for i in range(B[-1], m+1):
            func(B + [i], n)
print(A)
"""

a = [0 for _ in range(q)]
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
d = [0 for _ in range(q)]
for i in range(q):
    a[i] = abcd[i][0]
    b[i] = abcd[i][1]
    c[i] = abcd[i][2]
    d[i] = abcd[i][3]

A = (list(itertools.combinations_with_replacement(range(1, m + 1), n)))
#print(A)
#print(len(A))
ans = 0
for i in range(len(A)):
    tmp = 0
    #print(A[i])
    for j in range(q):
        if (A[i][b[j]-1] - A[i][a[j]-1]) == c[j]:
            tmp += d[j]
    #print(tmp)
    if ans < tmp:
        ans = tmp
print(ans)


Measured memory_bytes: 85016
#include<bits/stdc++.h>
#define N 1000000
#define ll long long int
#define pr pair<ll,ll>
#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define r(i,a,b) for(ll i=a;i>=b;i--)
#define ms(a,b) memset(a,b,sizeof(a));
using  namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll tt = 1;  
    //cin>>tt;
    while(tt--){
        ll a,b,k;
        cin>>a>>b>>k;
        if(k>=a){
            k -= a;
            if(k>=b) cout<<"0 0";
            else cout<<"0 "<<b-k;
        }
        else{
            a -= k;
            cout<<a<<" "<<b;
        }
        cout<<endl;
    }
    return 0;
}

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

int n,m,cnt,a[105];
double tot;

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=0,x;i<n;i++)
        scanf("%d",a+i),tot+=a[i];
    tot/=4*m;
    for(int i=0;i<n;i++)
        if(a[i]>=tot-1e-7) cnt++;
    if(cnt>=m) printf("Yes\n");
    else printf("No\n");
    return 0;
}

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int d;
  	cin >> d;
    string ans;
    if(d==25) ans = "Christmas";
    if(d==24) ans = "Christmas Eve";
    if(d==23) ans = "Christmas Eve Eve";
    if(d==22) ans = "Christmas Eve Eve Eve";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
def num2alpha(num):
  if num<=26:
    return chr(64+num)
  elif num%26==0:
    return num2alpha(num//26-1)+chr(90)
  else:
    return num2alpha(num//26)+chr(64+num%26)

if __name__ == "__main__":
  N = int(input())
  name = num2alpha(N)
  print(name.lower())

Measured memory_bytes: 9180
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
using namespace std;
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; }
const int INF = 1e9;
const ll MOD = 1000000007;

using Graph = vector<vector<int>>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s; cin >> s;
    int n = s.size();
    if (n%2==1) {
        if (s[0]==s[n-1]) {
            cout << "Second" << "\n";
        } else {
            cout << "First" << "\n";
        }
    } else {
        if (s[0]!=s[n-1]) {
            cout << "Second" << "\n";
        } else {
            cout << "First" << "\n";
        }
    }

}



Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a > b){
            System.out.println("a > b");
        }else if(a == b){
            System.out.println("a == b");
        }else{
            System.out.println("a < b");
        }
    }
    
}

Measured memory_bytes: 26192
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

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);
		Solution sol = new Solution();
		sol.solve(in, out);
		out.close();
	}

	private static class Solution {
		int[] a = new int[5];
		private void solve(InputReader in, PrintWriter out) {
			for (int i = 0; i < 5; i++) if (in.ni() == 0) {
				out.println(i+1);
				return;
			}
			out.println(-1);
		}
	}

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

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

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

		private int ni() {
			return Integer.parseInt(n());
		}
	}

}


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

int main(){
	double a, b, x, tan;
	scanf("%lf%lf%lf", &a, &b, &x);
	x /= a;
	if(x <= a * b / 2){
		tan = b * b / (2 * x);
	}
	else{
		tan = 2 * (a * b - x) / (a * a);
	}
	printf("%.10lf\n", atan(tan) * 180 / acos(-1));
	return 0;
}

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

using namespace std;

long long gcd(long long x,long long y){
  if(y==0){
    return x;
  }
  else{
    return gcd(y,x%y);
  }
}

int main(){
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> L(n+1); //L[i]はa1~aiまでの最大公約数
  vector<long long> R(n+1); //R[i]はai+1~anまでの最大公約数
  
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  L[0]=0; R[n]=0;
  L[1]=a[0]; R[n-1]=a[n-1];
  for(int i=2;i<n+1;i++){
    R[n-i]=gcd(R[n-i+1],a[n-i]);
    L[i]=gcd(L[i-1],a[i-1]);
    \
  }
  long long ans=0;
  for(int i=1;i<n+1;i++){
    long long M;
    if(L[i-1]==0){
        M=R[i];
    }
    else if(R[i]==0){
        M=L[i-1];
    }
    else{
        M=gcd(L[i-1],R[i]);
    }
    ans=max(ans,M);
  }
  cout << setprecision(30);
  cout << ans << endl;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}




template< typename T >
struct edge {
  int src, to;
  T cost;

  edge(int to, T cost) : src(-1), to(to), cost(cost) {}

  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

  edge &operator=(const int &x) {
    to = x;
    return *this;
  }

  operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WG = vector< Edges< T > >;
using UG = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;



void tsort_dfs(int u,vector<int> &graph,bool visited[],UG &g){

  if(visited[u]) return;
  visited[u] = true;
  for(int i=0;i<g[u].size();i++){
    tsort_dfs(g[u][i],graph,visited,g);
  }
  graph.PB(u);
}


vector<int> tsort(UG &g){
  vector<int> graph;
  bool visited[110000] = {};
  for(int i=1;i<g.size();i++){
    tsort_dfs(i,graph,visited,g);
  }
  reverse(all(graph));
  return graph;
}


main(){
  int n;
  cin>>n;
  UG es(n+1);
  int a[200000];
  FOR(i,2,n+1){
  
    cin>>a[i];  
    es[a[i]].PB(i);

  }

  vector<int> v=tsort(es);
  reverse(all(v));

  /*
  rep(i,v.size()){
    cout<<v[i]<<' ';
  }
  cout<<endl;
  */

  int dp[200000]={};
  

  rep(i,v.size()){
    int k=v[i];
    int res=0;
    vector<int> b;
    for(auto e:es[k]){
      b.PB(dp[e]);
    }
    sort(all(b));
    for(auto e:b){
      res=max(res+1,e);
    }
    dp[k]=res+1;

  }
  FOR(i,1,n+1){
//    cout<<" "<<dp[i]<<endl;
  }
  cout<<dp[1]-1<<endl;
  
}


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

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

int main()
{
    int n;
    while(1)
    {
	cin >> n;
	if (n==0)break;
	int t[15][15]={0};
	int x=n/2,y=n/2+1;
	rep(i,n*n)
	{
	    if (t[y][x] == 0)
	    {
		t[y][x]=i+1;
		x=(x+1)%n;
		y=(y+1)%n;
	    } else {
		x=(x-1+n)%n;
		y=(y+1)%n;
		i--;
	    }
	}
	rep(i,n)
	{
	    rep(j,n)
	    {
		printf("%4d",t[i][j]);
	    }
	    printf("\n");
	}
    }
    return 0;
}

Measured memory_bytes: 0
using System;

class Prog{
  static void Main(){
    var ls = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
    if(ls[1]*2 < ls[0]){
      Console.WriteLine(ls[0] - 2*ls[1]);
    }else{
      Console.WriteLine(0);
    }
  }
}



Measured memory_bytes: 13140
#include <iostream>
using namespace std;
int main(void) {
	int D;
	cin >> D;
	switch(D){
	case 22:
		cout << "Christmas Eve Eve Eve";
		break;
	case 23:
		cout << "Christmas Eve Eve";
		break;
	case 24:
		cout << "Christmas Eve";
		break;
	case 25:
		cout << "Christmas";
		break;
	}
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int S[100000];
  int T[100000];
  int n;
  int q;
  int c=0;
  int i,j,b;

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

  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

  for(i=0;i<q;i++){
    for(j=0;j<n;j++){
      if(T[i]==S[j]){
	c++;
	break;
      }
    }
  }



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

  return 0;
}

Measured memory_bytes: 648
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if(a % 2 == 1 && b % 2 == 1){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}



Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var mod int = 1000000007
	var n int
	fmt.Scan(&n)

	a := make([]int, n)
	b := make([]int, n+1)

	for i := range a {
		fmt.Scan(&a[i])
	}
	for i := 0; i < n; i++{
		b[i+1] = b[i] + a[i]
	}

	var data int
	var ans int

	for j := 0; j < n; j++{
		data = (b[n] - b[j+1]) % mod

		ans += a[j] * data
		ans = ans % mod
	}

	fmt.Println(ans)
}


Measured memory_bytes: 8560
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  vector<int> vec(3);
  cin>>vec[0]>>vec[1]>>vec[2];
  
  sort(vec.begin(),vec.end());
  
  cout<<vec[0]+vec[1]<<endl;
}

Measured memory_bytes: 3588
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;

class Map {
 public:
  Map(size_t cap) : size_(cap) {
    table_.resize(cap);
    for (auto& b : table_) b.data[0] = '\0';
  }

  void insert(const char* k, size_t size) {
    size_t key = hash0(k, size);
    for (size_t i = 0; i < table_.size(); ++i) {
      size_t j = hash(key, i);
      if (table_[j].data[0] == '\0') {
        strncpy(table_[j].data, k, size);
        return;
      }
    }
    // not enough space
  }

  bool find(const char* k, size_t size) const {
    size_t key = hash0(k, size);
    for (size_t i = 0; i < table_.size(); ++i) {
      size_t j = hash(key, i);
      if (table_[j].data[0] == '\0') return false;
      if (strncmp(table_[j].data, k, 16) == 0) return true;
    }
    return false;
  }

 private:
  struct block {
    char data[16];
  };

  size_t hash(size_t key, size_t i) const {
    size_t h = hash1(key) + i * hash2(key);
    return h % size_;
  }

  size_t hash0(const char* k, size_t size) const {
    size_t h = 0;
    size_t p = 1;
    for (int i = 0; i < size; i++) {
      size_t c = k[i] - 'A';
      h += p * c;
      p *= 5;
    }
    return h;
  }

  size_t hash1(size_t k) const { return k % size_; }
  size_t hash2(size_t k) const { return 1 + k % (size_ - 1); }

  const size_t size_;
  vector<block> table_;
};

int main() {
  int n;
  scanf("%d", &n);
  char cmd[9], key[16];
  Map m(1046527);  // 1000003 is prime
  for (int i = 0; i < n; i++) {
    scanf("%s %s", cmd, key);
    if (cmd[0] == 'f') {
      if (m.find(key, strnlen(key, 16))) {
        printf("yes\n");
      } else {
        printf("no\n");
      }
    } else {
      m.insert(key, strnlen(key, 16));
    }
  }

  return 0;
}



Measured memory_bytes: 19200
#include <iostream>
#include <vector>
#include <math.h>
#include <cstdio>
#include <algorithm>
using namespace std;

double renritux(double a,double b,double c,double d,double e,double f) 
{

	double x;	

		if (a==0){
			x = (f - (e*c/b)) / d;
		}else if(b==0){
			x = c / a;
		}else if(d==0){
			x = (c - (b*f/e)) / a;
		}else if(e==0){
			x = f / d;
		}else{
			x = (f - (e*c/b)) / (d - (e*a/b));
		}
		if (x==-0) x=0;
		
	return x;
  
}

double renrituy(double a,double b,double c,double d,double e,double f) 
{

	double y;	

		if (a==0){
			y = c / b;
		}else if(b==0){
			y = (f - (d*c/a)) / e;
		}else if(d==0){
			y = f / e;
		}else if(e==0){
			y = (c - (a*f/d)) / b;
		}else{
			y = (f - (d*c/a)) / (e - (d*b/a));
		}
		if (y==-0) y=0;
		
	return y;
  
}

double distance(double x1,double y1,double x2,double y2)
{
 
    vector<double> x,y;
    double dist;
    
    x.push_back(x1);
    y.push_back(y1);
    x.push_back(x2);
    y.push_back(y2);
     
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
     
    dist = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
     
    return dist;
    
}

int main() {
	int n;
	cin >>n;
	
	for(int i=0;i<n;i++){
		double x1,y1,x2,y2,x3,y3,px,py,r,a,b,c,d,e,f;
		cin >>x1>>y1>>x2>>y2>>x3>>y3;
		
		if (y2!=y1){
			a = (x2-x1)/(y2-y1);
			b = 1;
			c = (x1+x2)*(x2-x1)/(2*(y2-y1)) + (y1+y2)/2;
		}else{
			a = 1;
			b = 0;
			c = (x1+x2)/2;
		}
		
		if (y3!=y1){
			d = (x3-x1)/(y3-y1);
			e = 1;
			f = (x1+x3)*(x3-x1)/(2*(y3-y1)) + (y1+y3)/2;
		}else{
			d = 1;
			e = 0;
			f = (x1+x3)/2;
		}
		px = renritux(a,b,c,d,e,f);
	  	py = renrituy(a,b,c,d,e,f);
	  	
	  	r = distance(px,py,x1,y1);
	  	
		printf("%.3f %.3f %.3f\n",px,py,r);
	
	}	
	return 0;
  
}

Measured memory_bytes: 1264
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001



X,t = map(int,input().split())

print("%d"%max(0, X-t))



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

#define long long long int
using namespace std;

// @author: pashka

int main() {
    ios::sync_with_stdio(false);

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

    vector<int> aa(n);
    vector<int> bb(n);
    for (int i = 0; i < n; i++) {
        aa[i] = a[i] ^ (a[(i + 1) % n]);
        bb[i] = b[i] ^ (b[(i + 1) % n]);
    }
    
    vector<int> s;
    for (int i = 0; i < n; i++) {
        s.push_back(bb[i]);
    }
    s.push_back(-1);
    for (int i = 0; i < n; i++) {
        s.push_back(aa[i]);
    }
    for (int i = 0; i < n - 1; i++) {
        s.push_back(aa[i]);
    }
    
    vector<int> p(s.size() + 1);
    p[0] = -1;
    for (int i = 1; i < p.size(); i++) {
        int k = p[i - 1];
        while (k >= 0 && s[i - 1] != s[k]) k = p[k];
        p[i] = k + 1;
        if (p[i] == n) {
            int k = i - n - n - 1;
            int x = b[0] ^ a[k];
            cout << k << " " << x << "\n";
        }
    }
    
    return 0;
}

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

int main() {
    string s, t;
    cin >> s >> t;

    int min = 1000;
    int tmp = 0;
    for (int i = 0; i <= s.length() - t.length(); i++) {
        for (int j = 0; j < t.length(); j++) {
            if (s.at(i + j) != t.at(j)) tmp++;
        }
        if (tmp < min) min = tmp;
        tmp = 0;
    }

    cout << min << endl;
}


Measured memory_bytes: 3584
#include<cstdio>
#include<cstring>
#define M 4004
#define N 2002
int A[N],B[N*N],C[N*N],D[N*N],E[N*N],F[N*N],a[N],b[M],c[M],d[N],f[N],m,n,s,t;
inline void swap(int&u,int&v){s=u,u=v,v=s;}
inline void add(int u,int v,int x,int y){d[v]<d[u]?swap(u,v),0:0,C[++t]=u,D[t]=v,E[t]=x,F[t]=y,u!=v?B[t]=A[u],A[u]=t:0;}
void dfn(int u)
{
    for(int i=a[u];i;i=b[i])if(c[i]!=f[u])f[c[i]]=u,dfn(c[i]);
    d[u]=++t;
}
void dfs(int u)
{
    for(int i=a[u];i;i=b[i])if(c[i]!=f[u])dfs(c[i]);
    for(;B[A[u]];A[u]=B[B[A[u]]])add(D[A[u]],D[B[A[u]]],A[u],B[A[u]]);
    if(A[u])add(f[u],D[A[u]],A[u],0);
}
int i,u,v;
int main()
{
    for(scanf("%d%d",&n,&m),i=t=1;i<n;i++)scanf("%d%d",&u,&v),b[++t]=a[u],c[a[u]=t]=v,b[++t]=a[v],c[a[v]=t]=u;
    for(t=0,dfn(1),i=1,t=0;i<=m;i++)scanf("%d%d",&u,&v),add(u,v,0,0);
    for(dfs(1),i=t;m<i;i--)D[E[i]]==D[i]?swap(C[F[i]],D[F[i]]):swap(C[E[i]],D[E[i]]);
    for(memset(b+1,0,n<<2),memset(c+1,0,n<<2),i=1,s=0;i<=m;i++)for(u=C[i],v=D[i];u!=v;)d[u]<d[v]?s+=!b[u],b[u]=1,u=f[u]:(s+=!c[v],c[v]=1,v=f[v]);
    for(printf("%d\n",s),i=1;i<=m;i++)printf("%d %d\n",C[i],D[i]);
    return 0;
}

Measured memory_bytes: 8448