akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

int main()
{
   FAST/**/
   
   ll powa[64];
   powa[0] = 1;
   for(ll i=1;i<64;i++)
        powa[i] = powa[i-1]*2;
   
   ll n,m,x;
   cin>>n>>m>>x;
   bool pos = 0;
   ll cst = inf;
   
   ll c[n], arr[n][m];
   rep(n)
   {
       cin>>c[i];
       repi(j,m)
            cin>>arr[i][j];
   }
   
   ll lim = (1ll<<n);
   repi(mask,lim)
   {
       if(mask == 0)
            continue;
       ll tot[m];
       memset(tot,0,sizeof(tot));
       ll ccost = 0;
       rep(n)
       {
           if(mask&powa[i])
           {
               ccost+=c[i];   
               repi(j,m)
                    tot[j]+=arr[i][j];
           }
       }
       
       bool pos1 = 1;
       rep(m)
            if(tot[i]<x)
                pos1 =  0;
       if(pos1)
       {
           pos = 1;
           cst = min(cst,ccost);
       }
               
   }
   if(pos)
        cout<<cst;
   else cout<<-1;        
   
   return 0;        
}  
  
   

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

int main(){
  ll n, ans = 1;
  string s;
  cin >> n >> s;
  map<char,int> p;
  
  p['R'] = p['G'] = p['B'] = 0;
  
  rep(i,n){
    if(s.at(i) =='R') p['R']++;
    if(s.at(i) =='G') p['G']++;
    if(s.at(i) =='B') p['B']++;
  }
  for(auto q : p){
    ans *= q.second;
  }
  
  ll remove = 0;
  for(int i = 0; i < n; i++){
    for(int j = 1; j <= n/2; j++){
      if (i+j >= n || i+2*j >= n) continue;
      else if (s.at(i)!=s.at(i+j)&&s.at(i)!=s.at(i+2*j)&&s.at(i+2*j)!=s.at(i+j)){
        remove++;
      }
    }
  }
  
  ans -= remove;
  cout << ans << endl;
  
}

Measured memory_bytes: 3532
from collections import Counter
N = int(input())
S = list(input())

counter = Counter(S)
E = counter.get('E', 0)
W = counter.get('W', 0)
# print('E W', E, W)

ans = 10**6
e, w = 0, 0
for i in range(N):
    v = w + E - e
    if S[i] == 'E':
        v -= 1
        e += 1
    else:
        w += 1
    # print('v, e, w', v, e, w)
    ans = min(ans, v)
print(ans)


Measured memory_bytes: 6304
# 初期入力
from collections import Counter
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A_c =Counter(A)
Q = int(input())
S =[0]*Q
bc =[]
for i in range(Q):
    x,y = (int(i) for i in input().split())
    bc.append((x,y))
    #print(A_np)
sum_A =[0]*(Q+1)
sum_A[0] =sum(A)
ind =0
for k,v in bc:
    sum_A[ind+1] =sum_A[ind] -A_c[k] *k +A_c[k] *v
    A_c[v] +=A_c[k]
    A_c[k] =0
    #print(A_c)
    print(sum_A[ind +1])
    ind +=1

Measured memory_bytes: 39756
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

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

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  ll x,t; cin >> x >> t;
  cout << max(x-t,0LL) << endl;
  
  
}

Measured memory_bytes: 3592
/*
for (int i = 0; i < N; ++i){}

// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<int,int> point;
#define rep(i,n) for(i,0,n)

// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
 

int main() {
	// 入力
	string S, T;
	cin >> S >> T;
 
	// 解法
	string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	ll num_S = 0;
	for (int i = 0; i < S.size(); ++i){
		string target = S.substr(i,1);
		bool change = true;
		for (int j = 0; j < ABC.size(); ++j){
			if (target==ABC.substr(j,1)) change = false;
		}
		if (change){
			for (int j = 0; j < S.size(); ++j){
				if (S.substr(j,1)==target){
					S.replace(j,1,ABC.substr(num_S,1));
				}
			}
			num_S++;
		}
	}
	
	
	ll num_T = 0;
	for (int i = 0; i < T.size(); ++i){
		string target = T.substr(i,1);
		bool change = true;
		for (int j = 0; j < ABC.size(); ++j){
			if (target==ABC.substr(j,1)) change = false;
		}
		if (change){
			for (int j = 0; j < T.size(); ++j){
				if (T.substr(j,1)==target){
					T.replace(j,1,ABC.substr(num_T,1));
				}
			}
			num_T++;
		}
	}
	// cout << S << " " << T << endl;
		
	if (S==T) printf("Yes");
	else printf("No");
}
 


Measured memory_bytes: 776
r,c = map(int,input().split())
A = [[0 for i in range(c+1)] for j in range(r+1)]
I = [0 for i in range(c+1)]
sum_c = 0
sum_r = 0

for a in range(r):
    S = input().strip().split()
    S = [int(s) for s in S]
    sum_c = sum(S)
    for b in range(c):
        A[a][b] = S[b]
        print(S[b],end=' ')
    A[a][c] = sum_c
    print(sum_c)
    
for i in range(c+1):
    for j in range(r):
        I[i] += A[j][i]
        if i == c and j == r-1:
            print(I[i])
        elif j == r-1:
            print(I[i],end=' ')











Measured memory_bytes: 5744
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int t,x;
double ans;
int main(int argc, char const *argv[])
{
	cin>>t>>x;
	ans = t / (x *1.0);
	printf("%.6f\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int n,tmp,ans=0,now=1;
    cin >> n;
    rep(i,n){
        cin >> tmp;
        if(tmp==now){
            now++;
        }
        else ans++;
    }
    if(ans<n)cout << ans << endl;
    else cout << -1 << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <list>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(d) string(1,d)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string s;
  cin>>s;
  int d[4];
  clr(d,0);
  rep(i,0,s.sz){
    if(s[i]=='N')d[0]=1;
    if(s[i]=='S')d[1]=1;
    if(s[i]=='E')d[2]=1;
    if(s[i]=='W')d[3]=1;
  }
  if(d[0]==d[1]&&d[2]==d[3]){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}





Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int n, m;
vector<int> adj[15];
int p[15];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    cin>>n>>m;
    f(i, m){
        int k;
        cin>>k;
        f(j, k) {
            int u;
            cin>>u;
            adj[i].pb(u);
        }
    }
    f(i, m) cin>>p[i];
    int ans = 0;
    f(i, (1 << n)){
        int mask = i;
        bool ok = true;
        f(j, m){
            int cnt = 0;
            for(int u : adj[j]){
                if(mask & (1 << (u - 1))) cnt++;
            }
            if(cnt % 2 != p[j]){
                ok = false;
                break;
            }
        }
        if(ok) ans++;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int n, a[N];
ll ans;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n) cin >> a[i];
  sort(a, a+n);
  if(n%2){
    FOR(i, 0, n/2) ans -= a[i];
    FOR(i, n/2, n) ans += a[i];
    ans = ans*2-a[n/2]-a[n/2+1];
    ll _ans = 0;
    FOR(i, 0, n/2+1) _ans -= a[i];
    FOR(i, n/2+1, n) _ans += a[i];
    _ans = _ans*2+a[n/2-1]+a[n/2];
    cout << max(ans, _ans) << endl;
  }else{
    FOR(i, 0, n/2) ans -= a[i];
    FOR(i, n/2, n) ans += a[i];
    ans = ans*2-a[n/2]+a[n/2-1];
    cout << ans << endl;
  }
}

Measured memory_bytes: 640
s = [len(w) for w in input().split("T")]
x,y = map(int,input().split())

lisx = s[2::2]
lisy = s[1::2]

nowx = {s[0]}
nowy = {0}

for x1 in lisx:
  gone = set()
  for x2 in nowx:
    gone.add(x2 + x1)
    gone.add(x2 - x1)
  nowx = gone

for y1 in lisy:
  gone = set()
  for y2 in nowy:
    gone.add(y2 + y1)
    gone.add(y2 - y1)
  nowy = gone


if x in nowx and y in nowy:print("Yes")
else:print("No")

Measured memory_bytes: 3816
<?php
//error_reporting(0);
//$A = explode(" ",trim(fgets(STDIN)));
//list($A,$B) = explode(" ",trim(fgets(STDIN)));
for($i=2;$i<=100000;$i++) {
  if (!isset($f[$i])) {
    for($j=$i+$i;$j<=100000;$j+=$i) {
      $f[$j]=true;
    }
  }
}
$c=array_fill(0,100000,0);
for($i=3;$i<100000;$i+=2) {
  if (!isset($f[$i]) && !isset($f[($i+1)/2])) $c[$i]++;
}
for($i=3;$i<100000;$i++) {
  $c[$i]+=$c[$i-1];
}
$Q = trim(fgets(STDIN));
$r = array();
for($i=0;$i<$Q;$i++) {
  list($L,$R)=explode(" ",trim(fgets(STDIN)));
  $r[] = $c[$R]-$c[$L-1];
}
foreach($r as $v) {
  printf("%d\n",$v);
}


Measured memory_bytes: 46452
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
template<typename Val>
bool bitcheck(Val bit, size_t idx) {
    return bit & (1 << idx);
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;

void solve() {
    ll n, m; cin >> n >> m;
    vector<vector<ll>> route(n);
    FOR(i, 0, m) {
        ll a, b; cin >> a >> b;
        a--; b--;
        route[a].push_back(b);
        route[b].push_back(a);
    }
    vector<ll> mark(n, -1);
    mark[0] = 0;
    vector<ll> c = {0};
    FOR(i, 0, n) {
        ll x = c[i];
        for(auto v : route[x]) {
            if (mark[v] == -1) {
                mark[v] = x;
                c.push_back(v);
            }
        }
    }
    if (std::any_of(mark.begin(), mark.end(), [](auto imark) {return imark == -1;})) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        FOR(i, 1, n) cout << mark[i] + 1 << endl;
    }
}

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

Measured memory_bytes: 13604
from collections import deque
import sys


if __name__ == '__main__':
    n = input()
    S = set(list(map(int, input().split())))
    q = int(input())
    T = set(list(map(int, input().split())))

    count = 0
    for t in T:
        for s in S:
            if t == s:
                count += 1

    print(count)



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

struct Problem {
public:

	UL BitNum(UL a) {
		a = (a & 0x55555555) + ((a >> 1) & 0x55555555);
		a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
		a = (a & 0x0f0f0f0f) + ((a >> 4) & 0x0f0f0f0f);
		a = (a & 0x00ff00ff) + ((a >> 8) & 0x00ff00ff);
		a = (a & 0x0000ffff) + ((a >> 16) & 0x0000ffff);
		return a;
	}

	void Solve() {
		UL N; scanf("%d", &N);
		UL K; scanf("%d", &K);
		rep(k, 1 << N) {
			if (BitNum(k) != K) continue;
			printf("%d:", k);
			rep(j, N) {
				if ((k >> j) & 1) printf(" %d", j);
			}
			printf("\n");
		}
	}
};

int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}



Measured memory_bytes: 3192
#include <iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a[10000];
	int b[10000];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];

	}
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
	}
	long long la = 0;
	long long lb = 0;

	for(int i = 0 ; i < n ; i++)
	{
		if(a[i] > b[i])
		{
			la += a[i] - b[i];
		}else
		{
			lb += (b[i] - a[i]) / 2;
		}

	}
	if(la > lb)
	{
		cout << "No" << endl;

	}else
	{
		cout << "Yes" << endl;
	}
	return 0;
}

Measured memory_bytes: 384
n=input()
ans=0
x=-1
n=n+str(0)
for i in range(len(n)-1):
    v=int(n[i])
    w=int(n[i+1])
    if x<0:
        if v<5:
            ans+=v
        elif v==5:
            if w>=5:
                ans+=9-v+2
                x+=1
            else:
                ans+=v
        else:
            ans+=9-v+2
            x+=1
    else:
        if v<4:
            ans+=v
            x-=1
        elif v==4:
            if w>=5:
                ans+=9-v
            else:
                ans+=v
                x-=1
        else:
            ans+=9-v

print(ans)

Measured memory_bytes: 55252
#include <stdio.h>

int main()
{
    long long int a;
    int b;
    scanf("%lld%d", &a, &b);
    long long int avr, total;
    total = a + b;
    avr = total/2;

    if(total%2 == 1) {
        printf("%lld\n", avr + 1);
    }
    else {
        printf("%lld\n", avr);
    }

    return 0;
}



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

int main () {
  int N;
  cin >> N;
  vector<int> l(N);
  vector<int> r(N);
  for (int i = 0; i < N; i++) {
    cin >> l.at(i) >> r.at(i);
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    ans = ans + r.at(i) - l.at(i) + 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    S=[input() for i in range(N)]
    s=set(S)
    print(len(s))

if __name__ == '__main__':
    main()


Measured memory_bytes: 99500
u = 10**5
mod = 10**9+7
f = [1]*u
for i in range(1,u):
    f[i]*=f[i-1]*i
    f[i] %= mod

def comb(n,k):
    x = f[n]
    x *= pow(f[k],mod-2,mod)
    x %= mod
    x *= pow(f[n-k],mod-2,mod)
    x %= mod
    return x

n,k = map(int,input().split())
for i in range(1,k+1):
    res = 0
    if n-k+1 >= i:
        res = comb(n-k+1,i)*comb(k-1,i-1)
        res %= mod
    print(res)


Measured memory_bytes: 7284
#include <iostream>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		int sum = 0;
		while(n)
		{
			n /= 5;
			sum += n;
		}
		cout << sum << endl;
	}
}

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

Measured memory_bytes: 0
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        string input = Console.ReadLine();
        if (input == null) { return; }
        var inputs = input.Split(' ');
        string result = inputs.Aggregate(string.Empty, (current, s) => current + s[0].ToString().ToUpper());
        Console.WriteLine(result);
    }
}

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

int main() {
  string S, T;
  cin >> S >> T;
  sort(S.begin(), S.end());
  sort(T.begin(), T.end());
  reverse(T.begin(), T.end());
  if (S<T) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
/*
ID: chen1041
LANG: C++
TASK: test
*/
//#pragma GCC optimize(2)
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<bitset>
#define LL long long
#define mod 1e9+7
#define INF 0x3f3f3f3f
using namespace std;

namespace FastIO {
	template<typename tp> inline void read(tp &x) {
		x=0; register char c=getchar(); register bool f=0;
		for(;c<'0'||c>'9';f|=(c=='-'),c = getchar());
		for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c = getchar());
		if(f) x=-x;
	}
	template<typename tp> inline void write(tp x) {
		if (x==0) return (void) (putchar('0'));
		if (x<0) putchar('-'),x=-x;
		int pr[20]; register int cnt=0;
		for (;x;x/=10) pr[++cnt]=x%10;
		while (cnt) putchar(pr[cnt--]+'0');
	}
	template<typename tp> inline void writeln(tp x) {
		write(x);
		putchar('\n');
	}
}
using namespace FastIO;
int a,b,i,j;
char paper[101][101];
int main(){
	puts("100 100");
	read(a),read(b);
	for(i=0;i<50;++i) 
		for(j=0;j<100;++j) paper[i][j]='.';
	for(i=50;i<100;++i)
		for(j=0;j<100;++j) paper[i][j]='#';
	--a,--b;
	for(i=0;i<50;++i) if(i%2==0)
		for(j=0;j<100;++j){
			if(b==0) break;
			if(j%2==0) paper[i][j]='#',--b;
		}
	for(i=52;i<100;++i) if(i%2==0)
		for(j=0;j<100;++j){
			if(a==0) break;
			if(j%2==0) paper[i][j]='.',--a;
		}
	for(i=0;i<100;++i) printf("%s\n",paper[i]);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

 

void solve(void)
{
   int N; cin>>N;
   vector<vector<int> > mat (N,vector<int>(N,0));
   for (int i = 0; i < N; i++)
   {
     for (int j = 0; j < N; j++)
     {
       cin>>mat[i][j];
     }
   }
  vector<int> DP ((1<<N)+1,0);
   for (int s = 0; s < (1<<N); s++)
   {
     for (int i = 0; i < N; i++)
     {
       for (int j = 0; j < i; j++)
       {
         if(s >> i & s >>j & 1)DP[s] += mat[i][j];
       } 
     }
      for (int t = s; t > 0; t = t-1 &s)
       {
         if(t==s)continue;
         DP[s] = max(DP[s],DP[t] + DP[s^t]);
         //sの部分集合を見てゆく
       }
   }

   cout<<DP[(1<<N)-1]<<endl;

   
  

  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

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

    int stNum = X;
    if (X == 2) {
        cout << X << endl;
        return 0;
    }

    if (stNum % 2 == 0) {
        stNum++;
    }

    bool targetFlg = true;
    int maxDivNum = stNum / 2;
    for (int i = stNum; ; i = i + 2) {
        for (int j = 3; j < maxDivNum; j++) {
            if (i % j == 0) {
                targetFlg = false;
                break;
            }
        }
        if (targetFlg) {
            cout << i << endl;
            break;
        }
        targetFlg = true;
        maxDivNum++;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(x,y) make_pair(x,y)
#define ALL(a) a.begin(),a.end()
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define MAX 5010
using namespace std;

int n,m,a[MAX],b[MAX];

void solve(){
 cin>>n>>m;
 FOR(i,n) cin>>a[i];
 FOR(i,m) cin>>b[i];
 vector<int> pos[1001];
 FOR(i,n) pos[a[i]].pb(i);
 int ma=0;
 FOR(i,m){
  int now=-1;
  FORR(j,i,m){
   int ind=upper_bound(ALL(pos[b[j]]),now)-pos[b[j]].begin();
   if(ind>=0&&ind<pos[b[j]].size()) now=pos[b[j]][ind];
   else{
    ma=max(ma,j-i);
    break;
   }
   if(j==m-1) ma=max(ma,m-i);
  }
 }
 cout<<ma<<endl;
}

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

Measured memory_bytes: 3260
def resolve():
    S = input()
    N = int(input())
    L = [list(map(str, input().split())) for _ in range(N)]
    
    for i in range(N):
        start = int(L[i][1])
        end = int(L[i][2]) + 1
        if L[i][0] == 'print':
            print(S[start:end])
        elif L[i][0] == 'reverse':
            S = S[:start] + S[start:end][::-1] + S[end:]
        else:
            S = S[:start] + L[i][3] + S[end:]

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 5620
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int result = 0;
		for (; A <= B; A++) {
			int digit1 = A / 10000;
			int digit2 = A / 1000 % 10;
			int digit4 = A / 10 % 10;
			int digit5 = A % 10;
			if (digit1 == digit5 && digit2 == digit4) {
				result++;
			}
		}
		System.out.println(result);
	}
}


Measured memory_bytes: 26844
N = int(input())
A = list(map(int, input().split()))
cnt = [0]*100010
for i in range(N):
    cnt[A[i]] += 1

ans = sum(A)
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    minus = cnt[B]
    cnt[B] = 0
    cnt[C] += minus
    ans = ans - minus*B + minus*C
    print(ans)




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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define hash dhsjakhd
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,T,k,q;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;
const ll MAXN = 300001;




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

    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);
    ll a,b,c,d,e;

    cin >> n >> m >> a >> b;
    rep(c1,0,n){
        rep(c2,0,m){
            cout << ((c1 < b)^(c2 < a));
        }cout << "\n";
    }

    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <vector>

using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	vector<int> H(N);
	vector<vector<int>> G(N);
	for (int i = 0; i < N; i++) cin >> H[i];
	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	int count = 0;

	for (int i = 0; i < N; i++) {
		bool ok = true;
		for (int j : G[i]) {
			if (H[i] <= H[j]) ok = false;
		}
		if (ok) count++;
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 8656
#include <bits/stdc++.h>
using namespace std;
int main()
{   int_fast64_t s;
cin>>s;
int c=1000;
while(s>=100){
  int a=s%1000;
  int b=abs(a-753);
  c=min(c,b);
  s/=10;
}
cout<<c<<endl;
}

Measured memory_bytes: 3608
/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *      ____________
 *     /         __ \
 *    /   __    |  | \
 *   /   |__|   |  |  \
 *  (           |__|   )
 *   \                /
 *    \      ___     /
 *     \____________/
 *
 *
 */
const long long mod = 1000000007;

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

	string s;
	cin>>s;
	int ind = -1;
	bool can = true;
	can &= (ind = s.find('C')) != -1;
	can &= (ind = s.find('F',ind+1) != -1);
	cout<<(can?"Yes":"No")<<'\n';
	return 0;
}
/**/


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
  int n; cin>>n;
  int cnt = 0;
  for(int i = 0; i < n; i++){
    int x; cin>>x;
    while(x%2 == 0){
      cnt++;
      x/=2;
    }
  }
  cout<<cnt<<"\n";
  return 0;
}

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

int main() {
  int n, x;
  cin >> n;
  int i = 1;
  do {
    x = i;
    if (x % 3 == 0) {
      cout << " " << i;
      continue;
    } else{
      while(x > 0){
        if(x % 10 == 3){
          cout << " " << i;
          break;
        }else{
          x /= 10;
          continue;
        }
      }
    }
  } while (++i <= n);
  cout << endl;
}


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

using namespace std;

int main()
{
	int L, R, d;
	cin >> L >> R >> d;

	int count = 0;
	for (int i = L; i <= R; i++) {
		if (i % d == 0) {
			count++;
		}
	}
	cout << count << endl;

}


Measured memory_bytes: 3504
import java.util.*;
import java.io.*;
 
public class Main {
  static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
  
  public static void main(String[] args) throws Exception {
    int n = Integer.parseInt(br.readLine());
    String[] split = br.readLine().split(" ");
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
      arr[i] = Long.parseLong(split[i]);
    }
    long sum = 0;
    long min = Long.MAX_VALUE;
    int negs = 0;
    for(long i : arr) {
      if(i < 0)
        negs++;
      long abs = Math.abs(i);
      min = Math.min(min, abs);
      sum += abs;
    }
    if(negs % 2 == 1)
        sum -= min * 2;
    
    pw.println(sum);
    
    pw.close();
  }
}


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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> as(n);
    vector<int> bs(n, 0); // b_i = #{j | a_j = i}
    for (auto& a : as) {
        cin >> a;
        --a;
        ++bs[a];
    }
    vector<int> cs(n+1, 0); // c_i = #{j | b_j = i}
    for (auto& b : bs) {
        ++cs[b];
    }
    int s = n;
    int last = n;
    cout << last << "\n";
    for (int k = 2; k <= n; ++k) {
        while (s/k < last) {
            int best = min(last, s/k);
            for (int i = last; i > best; --i) {
                // s -= cs[i]*i;
                // s += cs[i]*(i-1);
                s -= cs[i];
                cs[i-1] += cs[i];
                cs[i] = 0;
            }
            last = best;
        }
        cout << last << "\n";
    }
    return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

const long long mod = 1000000007;
struct mint{ //modint
    long long x;
    mint(long long x = 0): x(((x % mod) + mod) % mod) {}
    friend istream& operator >> (istream &s, mint& m){ return s >> m.x; }
    friend ostream& operator << (ostream &s, mint m){ return s << m.x; }
    inline mint& operator += (mint a){ if((x += a.x) >= mod)x -= mod; return *this; }
    inline mint& operator -= (mint a){ if((x += mod - a.x) >= mod)x -= mod; return *this; }
    inline mint& operator *= (mint a){ (x *= a.x) %= mod; return *this; }
    inline mint& operator /= (mint a){ return (*this) *= a.inv(); }
    inline mint operator + (mint a){ mint res(*this); return res += a; }
    inline mint operator - (mint a){ mint res(*this); return res -= a; }
    inline mint operator * (mint a){ mint res(*this); return res *= a; }
    inline mint operator / (mint a){ mint res(*this); return res /= a; }
    inline void takemod(){ x = ((x % mod) + mod) % mod; }
    mint inv(){ return pow(mod - 2); }
    mint pow(long long p){
        mint res(1), tmp(x);
        for(; p; p >>= 1){ if(p & 1)res *= tmp; tmp *= tmp; }
        return res;
    }
};

const int mx = 52;
int n, s;
mint dp[mx][mx][mx * mx];

int main(){

    cin >> n >> s;
    dp[0][0][0] = 1;

    rep(i, n)rep(j, i + 1)rep(k, n * n + 1){
        dp[i + 1][j][k + j * 2] += mint(j * 2 + 1) * dp[i][j][k];
        dp[i + 1][j + 1][k + j * 2] += dp[i][j][k];
        if(j == 0)continue;
        dp[i + 1][j - 1][k + j * 2] += mint(j * j) * dp[i][j][k];
    }

    cout << dp[n][0][s] << endl;
    return 0;

}

Measured memory_bytes: 57472
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i++)
#define RFOR(i, a, b) for(int i=(int)(a); i!=(int)(b); i--)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
using ll = long long;

constexpr int lim = 1e5;

ll n, k;
ll a[lim+1], b[lim+1];

ll allocation(ll c){
  ll ret = 0;
  REP(i, n){
    if((c | a[i]) == c) ret += b[i];
  }

  return ret;
}

ll solve(ll m){
  if(m == -1) return 0;
  if(((k >> m) & 1) == 0){
    return solve(m-1);
  }

  ll t = (1<<m) - 1;
  return max(allocation((k-(1<<m))|t), solve(m-1));
} 

int main(){
  cin >> n >> k;
  REP(i, n) cin >> a[i] >> b[i];

  cout << max(allocation(k), solve(30)) << endl;
    
  return 0;
}


Measured memory_bytes: 1792
function Main(s) {
  s = s.split(" ").map(a => +a);
  var a = s[0];
  var b = s[1];
  var k = s[2];
  var c = Math.min(b, a + k);
  for(;a < c; a++){
    console.log(a);
  }
  c = Math.max(a, b - k + 1);
  for(a = c; a <= b; a++){
    console.log(a);
  }
}

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

Measured memory_bytes: 9264
using System;
using System.Collections.Generic;
using System.Linq;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var input = Console.ReadLine().ToCharArray();
            int cnt = 0;
            foreach (char c in input)
            {
                if (c == '+') cnt++;
            }
            Console.WriteLine(2 * cnt - 4);
        }
    }
}



Measured memory_bytes: 11092
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265358979323

//int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y);
//void quick(int *,long long,long long);
//int comp(char *a,char *b);

int main(){
	
	int a[12]={3,6,0,3,5,1,3,6,2,4,0,2};
	char b[7][10]={
		"Monday",
		"Tuesday",
		"Wednesday",
		"Thursday",
		"Friday",
		"Saturday",
		"Sunday",
	};
	int m,n;

	scanf("%d %d",&m,&n);
	while(m!=0){
		printf("%s\n",b[(a[m-1]+n-1)%7]);
		scanf("%d %d",&m,&n);
	}
	return 0;
}

Measured memory_bytes: 584
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

S = X()

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9936
n,q = map(int,input().split())

hen = [[0,0]]*(n-1)
for i in range(n-1) :
    hen[i] = list(map(int,input().split()))

xlist = [0]*n
for k in range(q) :
    p,x = map(int,input().split())
    xlist[p-1] += x

#---

hen = sorted(hen, key=lambda x:x[1])
hen = sorted(hen, key=lambda x:x[0])

for i in range(n-1) :
    xlist[hen[i][1]-1] += xlist[hen[i][0]-1]

y = xlist.copy()

c = str(y[0])
for i in range(1,n) :
    c += ' ' + str(y[i])

print(c)

Measured memory_bytes: 71072
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a)      (a).begin(),(a).end()
#define debug_array(a,n) for (ll bccc=(0); bccc<(n); bccc++) cout<<a[bccc]<<" "<<"\n"
#define debug_vector(a) for(ll bccc=(0); bccc<(a.size());bccc++) cout<<a[bccc]<<" "<<"\n"
#define F           first
#define S           second
#define debug_set(s) for(auto p:s) cout<<p<<" "
#define debug_map(m) for(auto p:m) cout<<p.F<<" "<<p.S<<"\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll> >,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;

/* ll t = 0;
ordered_multiset me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

///////////   t is insertion time
*/
//#pragma GCC optimize("Ofast")  // works very well
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long double lld;
lld pi=3.14159265358;
ll powr(ll a,ll b)
{
    ll c=1;
    ll kjk;
    for(kjk=0;kjk<b;kjk++)
        c*=a;
    return c;
}
ll hell=1000000007;
//ll hell=998244353   ;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// to generate random number , use rng() ... eg cout<<rng();
bool check(ll a[],ll n,ll mid,ll k)
{
    ll ans=0;
    for(int i=0;i<n;i++)
        ans+=max(0LL,((a[i]+mid-1)/mid-1));
    return ans<=k;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,k,i;
    cin>>n>>k;
    ll a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
    ll lo=1;
    ll hi=hell;
    ll mid,ans;
    while(lo<=hi)
    {
        mid=((hi+lo)/2);
        if(check(a,n,mid,k))
        {
            ans=mid;
            hi=mid-1;
        }
        else
            lo=mid+1;
    }
    cout<<ans;
    return 0;
}


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

using namespace std;
#define ll long long 
int main() {
    string s1;
    cin>>s1;
    int l=s1.length();
    string s2;
    for(int i=0;i<l;i++){
        s2=s2+'x';        
    }
    cout<<s2;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
using namespace std;

int main() {
    int x, n = 1;
    cin >> x;
    for (int i = 2; i <= sqrt(x); i++) {
        int m=i*i;
        while (x >= m) {
            m *= i;
        }
        n = max(m/i, n);
    }
    cout << n << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	InputUtil in = new InputUtil();
    	PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
        int m = in.nextInt();
        int[] A = in.nextInt(new int[n*m]);
        int[] b = in.nextInt(new int[m]);
        int c;
        for(int i=0; i<n; i++) {
        	c = 0;
        	for(int j=0; j<m; j++) {
        		c += A[i*m+j]*b[j];
        	}
        	out.println(c);
        }
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
}


/**
 * --------------------------------------------------
 * Input Utility
 * --------------------------------------------------
 */
class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 50000;
	
	//Fields
	protected InputStream in;
	private char[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private BufferedReader br = null;
	
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {br = new BufferedReader(new InputStreamReader(this.in = in));}
	protected void initBuf(int bufsiz) {buf = new char[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && br.ready()) {
			max = br.read(buf);
			ptr = 0;
		}
	}
	//Number Input Reader/Parser
	private boolean isNum(char b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(char b) {return b=='-'; }


	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		char c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}

	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}

}

Measured memory_bytes: 25072
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

#include <math.h>
#include <stdlib.h>


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

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

//INT_MAX	2,147,483,647 = 2*1.0e9

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

  if(D ==25) cout << "Christmas" << endl;
  if(D ==24) cout << "Christmas Eve" << endl;
  if(D ==23) cout << "Christmas Eve Eve" << endl;
  if(D ==22) cout << "Christmas Eve Eve Eve" << endl;


  return 0;
}


Measured memory_bytes: 256