akhauriyash/Code-Regression huggingface dataset:
# 1 -> 5 -> 6 -> 5 -> 6 ...
# 2 -> 6 -> 5 -> 6 -> 5 ...
# 3 -> 6 -> 5 -> 6 -> 5 ...
# 4 -> 6 -> 5 -> 6 -> 5 ...
# 5 -> 6 -> 5 -> 6 -> 5 ...
# 6 -> 5 -> 6 -> 5 -> 6 ...

x = int(input())

div, mod = divmod(x, 11)

n = div * 2

if mod == 0:
    print(n)
elif mod <= 6:
    print(n + 1)
else:
    print(n + 2)


Measured memory_bytes: 9160
#include<stdio.h>



int main(){
    
    int N;
    scanf("%d",&N);
    int i;
    for(i=0;i<N;i++){
        int a, b, c;
        scanf("%d %d %d",&a, &b, &c);
        if(a<b){
            int tmp;
            tmp=a; a=b; b=tmp;
        }
        if(a<c){
            int tmp;
            tmp=a; a=c; c=tmp;
        }
        
        if(a*a==b*b+c*c){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
            
    }
    
    return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 40;
#define FOR(i,k,n) for(int i=(k);i<(n);++i)
#define all(x) ((x).begin(),(x).end())

void floyd(vector<vector<int>> &d){

    FOR(k,0,10){
        FOR(i,0,10){
            FOR(j,0,10) d[i][j] = min(d[i][j],d[i][k]+d[k][j]);
        }
    }

}

int main(){
    int H, W; cin >> H >> W;
    vector<vector<int> > c(10,vector<int>(10));

    FOR(i,0,10){
        FOR(j,0,10){
            cin >> c[j][i];
        }
    }

    floyd(c);
    int res = 0;
    int a;
    FOR(i,0,H) {
        FOR(j,0,W) {
            cin >> a;
            if(a!=-1){
                res += c[1][a];
            }
        }
    }
    cout << res << endl;
    return 0;

}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);

int main(int argc, char* argv[]) {
  long long n;
  scanf("%lld", &n);
  std::vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }

  vector<ll> f(n), b(n);

  f[0] = a[0];
  b[0] = a[n - 1];

  rep(i, 1, n) {
    f[i] = gcd(f[i - 1], a[i]);
    b[i] = gcd(b[i - 1], a[n - 1 - i]);
  }

  ll ans = 1;
  rep(i, 0, n) {
    if (i == 0) {
      chmax(ans, b[n - 2]);
      continue;
    }

    if (i == n - 1) {
      chmax(ans, f[n - 2]);
      continue;
    }

    ll x = f[i - 1];
    ll y = b[n - 1 - i - 1];
    chmax(ans, gcd(x, y));
  }

  put(ans);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}


Measured memory_bytes: 2560
A, B, N = map(int, input().split())

maxFloor = 0


def floor(x):
    num = int(x // 1)
    return num


if B - 1 <= N:
    check = floor(A * (B - 1) / B) - A * floor((B - 1) / B)
    print(check)
else:
    check = floor(A * N / B) - A * floor(N / B)
    print(check)

Measured memory_bytes: 81228
import sys
from bisect import bisect_left



N,Q = map(int, input().split())
STX = [None] * N
for i in range(N):
  s,t,x = map(int, input().split())
  STX[i] = [x,s,t]
STX.sort()
Dn = [None] * (Q+1)
for i in range(Q):
  Dn[i] = int(input())
Dn[Q] = 10**10

ans = [-1] * Q
skip = [-1] * Q
for x, s, t in STX:
  ss = bisect_left(Dn, s - x)
  tt = bisect_left(Dn, t - x)
  while ss < tt:
    sk = skip[ss]
    if sk == -1:
      ans[ss] = x
      skip[ss] = tt
      ss += 1
    else:
      ss = sk

print('\n'.join(map(str, ans)))


Measured memory_bytes: 73108
// https://atcoder.jp/contests/abc159/tasks/abc159_c

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ld L;
  cin >> L;

  ld len = L / 3;
  ld res = pow(len, 3);

  cout << fixed << setprecision(12) << res << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

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

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

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 512
#include<stdio.h>
         
    unsigned long int XOR(unsigned long int n){
       	if(n==-1){
          return 0;
        }
       	else if(n%4==1){
       		return 1;
       	}
       	else if(n%4==3){
       		return 0;
       	}
       	else if(n%4==2){
       		return 1^n;
       	}
       	else{
       		return n;
      	}
    }
     
    int main(void){
       	unsigned long int A,B;
       	scanf("%lu %lu",&A,&B);
       	//printf("%lu %lu\n", XOR(A-1), XOR(B));
    	printf("%lu\n",XOR(A-1)^XOR(B));
        return 0;
    }

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

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;
template <class T> inline void chmax(T &a, const T b) { a = max(a, b); }
template <class T> inline void chmin(T &a, const T b) { a = min(a, b); }
template <class T> void pp(T v, int n) { REP(i,n) cout<<v[i]<< ' '; cout << endl; }

void inline TorF(bool tf, const string &trueMessage, const string &falseMessage) {
  cout << (tf ? trueMessage : falseMessage) << endl;
}
void inline YESNO(bool tf) { TorF(tf, "YES", "NO"); }
void inline YesNo(bool tf) { TorF(tf, "Yes", "No"); }

int main() {
  string a[] = {"Sunny", "Cloudy", "Rainy"};
  int ans = 0;
  string S; cin>>S;
  REP(i,3) {
    if(a[i] == S) {
      ans = i;
      break;
    }
  }
  ans =	(ans +1	) % 3;
  cout << a[ans] << endl;
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
using namespace std;
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int ans=0;
    int ma=0;
    for(auto x:s)
    {
        if(x=='R')
        {
            ans++;
        }
        else
        {
            ans=0;
        }
        ma=max(ans,ma);
        
    }    
    cout<<ma;
    return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
typedef long long int ll;
using namespace std;
int main()
{
  int a,b;
  cin >> a>>b;
  
  if((a + b)%2 == 0){
    cout << (a + b)/2 << endl;
  }else{
    cout << "IMPOSSIBLE" << endl;
}

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> pii;
 
#define fst first
#define snd second
#define pb push_back
#define eb emplace_back
#define REP(i, a, b)  for(int i = (a), i##end = (b); i < i##end; ++i)
#define DREP(i, a, b) for(int i=(a-1), i##end = (b); i >=i##end; --i)
 
template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }
 
const int mod = 1e9 + 7;
const int oo = 0x3f3f3f3f;
const int maxn = (2000 + 10) * 3 + 100;
const long double PI = acos(-1.0);
 
template<typename T> T read() {
    T n(0), f(1);
    char ch = getchar();
    for( ;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
    for( ; isdigit(ch); ch = getchar()) n = n * 10 + ch - 48; 
    return n * f;
}
 
int N;
vector<pii> P;

int UP() {
    vector<int> S;
    for(int i = 0; i < int(P.size()); ++i) {
        if(S.empty() || P[i].snd > S.back()) 
            S.pb(P[i].snd);
        else {
            *lower_bound(S.begin(), S.end(), P[i].snd) = P[i].snd;
        }
    }
    return S.size();
}

int DOWN() {
    vector<int> S;
    for(int i = 0; i < int(P.size()); ++i) {
        P[i].snd = - P[i].snd;
        if(S.empty() || P[i].snd > S.back()) 
            S.pb(P[i].snd);
        else {
            *lower_bound(S.begin(), S.end(), P[i].snd) = P[i].snd;
        }
    }
    return S.size();
}

int main() {
#ifdef Wearry
    freopen("data.txt", "r", stdin);
    freopen("ans.txt", "w", stdout);
#endif
 
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    if(sx > tx) {
        swap(sx, tx);
        swap(sy, ty);
    }

    cin >> N;

    for(int i = 0; i < N; ++i) {
        static int x, y;
        cin >> x >> y;
        if(x < min(sx, tx) || x > max(sx, tx)) continue;
        if(y < min(sy, ty) || y > max(sy, ty)) continue;

        P.pb(pii(x, y));
    }

    if(P.size()) sort(P.begin(), P.end());

    int ans;
    if(sy < ty) ans = UP(); else ans = DOWN();

    long double res = 100.0 * (abs(sx - tx) + abs(sy - ty)) + ans * (5*PI - 20);
    if(ans == min(abs(tx - sx), abs(ty - sy)) + 1) res += (5*PI);

    printf("%.20Lf\n", res);

    return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define fastio() ios_base::sync_with_stdio(false);
using namespace std;
typedef long long ll;

const int maxn = 3e3+5;
bool add[maxn][maxn];
int dp[maxn][maxn];
pair<int, int> p[maxn][maxn];
char s[maxn], t[maxn];

void calc(int i, int j){
	dp[i][j] = dp[i-1][j], p[i][j] = {i-1, j};
	if (dp[i][j-1]>dp[i][j]) dp[i][j] = dp[i][j-1], p[i][j] ={i, j-1};
	if (s[i] == t[j] && dp[i-1][j-1]+1>dp[i][j])
		dp[i][j] = dp[i-1][j-1]+1, p[i][j] = {i-1, j-1}, add[i][j] = true;
}

int main(){
	char c;
	int n = 1, m = 1;
	for(;; n++) {
		c = getchar(); if (c == '\n') break;
		s[n] = c;
	} n--;
	for(;; m++){
		c = getchar(); if (c == '\n') break;
		t[m] = c;
	} m--;
	for(int i = 0; i<=n; i++) p[i][0] = {-1, -1};
	for(int i = 0; i<=m; i++) p[0][i] = {-1, -1};
	for(int i = 1; i<=n; i++){
		for(int j = 1; j<=m; j++) calc(i, j);
	}
	pair<int, int> v = {n, m};
	deque<char> ans;
	while(v != make_pair(-1, -1)) {
		if (add[v.first][v.second]) ans.push_front(s[v.first]);
		v = p[v.first][v.second];
	}
	for(auto x: ans) printf("%c", x);
	puts("");
	return 0;
}


Measured memory_bytes: 114816
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#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 <cctype> // isupper, islower, isdigit, toupper, tolower
 
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  ll n,P;
  cin >> n >> P;
  if(n == 1){
    cout << P << endl;
    return 0;
  }
  int t = 10000000;
  vi p(t, 1);
  p[0] = p[1] = 0;
  for(int i = 2; i < t; i++) if(p[i]) for(int j = i + i; j < t; j += i) p[j] = 0;
  int g = 1;
  rep(i, t){
    if(!p[i] || P % i != 0) continue;
    ll num = pow(i, n);
    if(P % num == 0){
      g *= i;
      P /= num;
      i--;
    }
  }
  cout << g << endl;
}

Measured memory_bytes: 39424
#include<bits/stdc++.h>
using namespace std;
constexpr int mod = 1e9 +7;
//constexpr int mod2 = 998244353;
constexpr int MAXNe5 = 1e5 +7;
constexpr int MAXNe6 = 1e6 + 7;
#pragma region 
inline long long read()
{
	char c = getchar();long long flag = 1, ans = 0;
	while(c < '0' || c > '9'){if(c == '-')flag = -1; c = getchar();}
	while(c >= '0' && c <= '9'){ans = ans * 10 + c - '0'; c = getchar();}
	return (ans * flag);
}
#pragma endregion
// C'est la vie
int main() {
    long long n = read(), m = read();
    if(n == 1 || m == 1) return cout << "1", 0;
    cout << (n & 1 ? (n - 1) / 2 * m + (m & 1 ? (m + 1) / 2 : m / 2) : n / 2 * m);
    #ifndef ONLINE_JUDGE
    system("pause");
    #endif
}

Measured memory_bytes: 504
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;

int main() {
   int w,a,b; cin >> w >> a >> b;
   if(a + w < b || b + w < a)print(min(abs(a + w - b),abs(b + w - a)));
   else print(0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef int ll;
typedef long double ld;
const int N = 200005;
ll inf = 1e16;
ll mod = 1e9 + 7;

char en = '\n';
ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x %= mod;
  while (n) {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n, k;
  cin >> n >> k;
  cout << (n - k + 1) << en;

  return 0;
}


Measured memory_bytes: 256
import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    const int L = 394,
              W = 394;
    int n; readf("%d\n", &n);
    int[] P = new int[L];
    foreach (i; 0 .. n) {
        int s, l, p; readf("%d %d %d\n", &s, &l, &p);
        for (int j = s; j <= l; j++) {
            P[j] = max(P[j], p);
        }
    }

    int cache[L][W]; memset(cast(void*)cache, -1, cache.sizeof);
    int solve(int i, int w) {
        if (w == 0) return 0;
        if (i == L) return -1;
        if (cache[i][w] >= 0) return cache[i][w];
        if (P[i] == 0) return solve(i + 1, w);
        int ret = -1;
        for (int x = 0; x * i <= w; x++) {
            int r = solve(i + 1, w - x * i);
            if (r == -1) continue;
            ret = max(ret, r + x * P[i]);
        }
        return cache[i][w] = ret;
    }

    int m; readf("%d\n", &m);
    int[] ans;
    foreach (i; 0 .. m) {
        int w; readf("%d\n", &w);
        ans ~= solve(0, w);
        if (ans.back == -1) {
            writeln(-1);
            return;
        }
    }
    foreach (a; ans) {
        a.writeln;
    }
}

Measured memory_bytes: 1724
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
//#define int long long  
int main(){
	string S;
	cin >> S;
	REP(i,S.size()-1){
	    if(S[i]=='A'&&S[i+1]=='C'){
	        cout << "Yes" << endl;
	        return 0;
	    }
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int H, W; cin >> H >> W;
    vector G(10, vector(10, 0));
    rep(i,10) rep(j,10) cin >> G[i][j];
    rep(k,10) rep(i,10) rep(j,10) {
        int n = G[i][k] + G[k][j];
        if (G[i][j] > n) G[i][j] = n;
    }
    vector WA(H, vector(W, -1));
    int res = 0;
    rep(i,H) rep(j, W) {
        cin >> WA[i][j];
        if (WA[i][j] != -1) res += G[WA[i][j]][1];
    }
    cout << res << endl;
}


Measured memory_bytes: 3784
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;cin>>n;
  bool f=(n%10==9)||(n/10==9);
  if(f)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;

}


Measured memory_bytes: 256
import sys
from itertools import combinations, product
from string import digits
from collections import Counter

def main():
    n, s = sys.stdin.read().split()
    n = int(n)
    
    # t = [None] * (n+1)
    # c = Counter(s)
    # t[0] = set(s)
    # # for i in range(n):
    # #     c[s[i]] -= 1
    # #     if c[s[i]] == 0:
    # #         t[i+1] = t[i] - set([s[i]])
    # #     else:
    # #         t[i+1] = t[i]
    # # print(t)


    
    cand = list(''.join(p) for p in product(digits, repeat=3))
    # print(cand)
    # for comb in combinations(s, 3):
    #     res.add(comb)
    
    # ans = len(res)
    # print(ans)

    res = set()
    for c in cand:
        i = s.find(c[0])
        if i == -1:
            continue
        j = s.find(c[1], i+1)
        if j == -1:
            continue
        k = s.find(c[2], j+1)
        if k == -1:
            continue
        
        res.add(c)
        
    ans = len(res)
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define DEBUG(x) cerr << #x << " = " << x << endl
signed main() {
  string S; cin >> S;
  string T = "CODEFESTIVAL2016";
  int c = 0;
  REP(i,S.size()) {
    if(S[i] != T[i]) ++c;
  }
  cout << c << endl;
}


Measured memory_bytes: 256
/**
  *  Worg
  */
#include <cstdio>

//FILE *fin = freopen("main.in", "r", stdin); FILE *fout = freopen("main.out", "w", stdout);

int main() {
    char S[200]; scanf("%s", S);
    if(S[0] == 'Y' && S[1] == 'A' && S[2] == 'K' && S[3] == 'I') {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
	return 0;
}


Measured memory_bytes: 128
import collections
n = int(input())

a = []
for _ in range(n):
    a.append(input())
#print(a)
b = collections.Counter(a).most_common()

c = []
d = b[0][1]
for i in range(len(b)):
    if b[i][1] != d:
        break
    c.append(b[i][0])
#print(c)
e = sorted(c)

for i in range(len(e)):
    print(e[i])


Measured memory_bytes: 45044
#include<stdio.h>
int main(void){
    int a,b,c,d,e,k;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    scanf("%d",&d);
    scanf("%d",&e);
    scanf("%d",&k);
    if(e-a>k){
        printf(":(\n");
    }else{
        printf("Yay!\n");
    }
    return 0;
}


Measured memory_bytes: 128
/*
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
*/
#include <bits/stdc++.h>

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

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


Measured memory_bytes: 256
from collections import deque
from collections import Counter
from collections import defaultdict
INF = int(1e9)
def main():
    n, x, y = map(int, input().split())
    x-=1
    y-=1
    g = [[] for _ in range(n)]
    for i in range(n-1):
        g[i].append(i+1)
        g[i+1].append(i)
    g[x].append(y)
    g[y].append(x)
    ans = defaultdict(int)
    q = deque()
    pns = []
    for i in range(n):
        dist = [INF for _ in range(n)]
        q.append(i)
        dist[i] = 0
        while len(q):
            node_s = q.popleft() 
            for j in range(len(g[node_s])):
                if dist[g[node_s][j]] != INF:
                    continue
                q.append(g[node_s][j])
                dist[g[node_s][j]] = dist[node_s] + 1
        for k in range(n): 
            pns.append(dist[k])
    
    ans = Counter(pns) 
    for k in range(1, n):
        print(ans[k]//2)
main()

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

#define ll long long
#define ull unsigned long long
#define db long double
#define pb push_back
#define ppb pop_back
#define F first
#define S second
#define mp make_pair
#define all(x) (x).begin(), (x).end()

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;



int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	string s;
	cin >> s;
	if (s == "AAA" || s == "BBB") {
		cout << "No";
	}	else {
		cout << "Yes";
	}
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int i, j, N, A[100]={0}, cnt = 0, temp;

  scanf("%d", &N);
  
  for(i = 0; i < N; i++)
    scanf("%d", &A[i]);

  for(i = 0; i < N - 1; i++){
    for(j = N - 1; j >= i + 1; j--){
      if(A[j] < A[j-1]){
	temp = A[j];
	A[j] = A[j-1];
	A[j-1] = temp;
	cnt++;
      }
    }
  }

  for(i = 0; i < N; i++){
    if(0 < i)   printf(" %d", A[i]);
    else        printf("%d", A[i]);
  }
  printf("\n%d\n", cnt);

  return 0;
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

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

const ll mod=1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// head

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

    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;

    ll sum = 0;

    vll red(a);
    vll green(b);
    vll ncolor(c);
    rep(i,0,a) cin >> red[i];
    rep(i,0,b) cin >> green[i];
    rep(i,0,c) cin >> ncolor[i];

    sort(all(red));
    sort(all(green));
    reverse(all(red));
    reverse(all(green));
    for(int i = 0; i < x; i++) {
        ncolor.pb(red[i]);
    }
    for(int i = 0; i < y; i++) {
        ncolor.pb(green[i]);
    }
    sort(all(ncolor));
    reverse(all(ncolor));
    for(int i = 0; i < x + y; i++) {
        sum += ncolor[i];
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 6384
N = int(input())
kingaku = []
tanni = []

otoshidama = 0.0
for i in range(N):
    k, t = input().split()
    if t == 'BTC':
        otoshidama += float(k) * 380000.0
    else:
        otoshidama += int(k)

print(otoshidama)


Measured memory_bytes: 2940
// Prime Factorize
// 所要時間 分
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

int main() {

    int n;
    cin >> n;

    vector<bool> prime(100001, true);
    prime[0] = false;
    prime[1] = false;
    for(int i=2; i*i<=100000; ++i){
        if(prime[i]){
            for(int x=i*2; x<=100000; x+=i){
                prime[x] = false;
            }
        }
    }

    vector<int> s(100001);
    for(int i=2; i<=100000; i++){
        s[i] = s[i-1];
        if((i+1) % 2 != 0){
            continue;
        }
        if(prime[i] && prime[(i+1)/2]){
            s[i]++;
        }
    }

    vector<int> ans(n);
    rep(i, n){
        int l, r;
        cin >> l >> r;
        ans[i] = s[r] - s[l-1];
    }

    rep(i, n){
        cout << ans[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 1408
#include<iostream>
int main(){
 int a,b;
 std::cin>>a>>b;
 int c=a+b;
 if(a%3!=0&&b%3!=0&&c%3!=0){
  std::cout<<"Impossible"<<std::endl;
 }
 else{
  std::cout<<"Possible"<<std::endl;
 }
 return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int NMAX=20+1;
const int MMAX=20+1;
int n,m;//n行，m列 
char mp[NMAX][MMAX];//记录迷宫情况
int ans[NMAX][MMAX];
struct q_node{
	int x,y,num;
};
 
int dx[4+1]={0, 0, 1, 0, -1};
int dy[4+1]={0, 1, 0, -1, 0};

void bfs(int x, int y){
//	cout<<"from x:"<<x<<" y:"<<y<<endl;
	int vis[NMAX][MMAX];
	memset(vis, 0, sizeof(vis));
	queue<q_node> q; 
	
	q_node head;
	head.x=x,head.y=y,head.num=0;
	vis[x][y]=1;
	q.push(head);
	
	while(!q.empty()){
		q_node temp=q.front();
		
		for(int i=1;i<=4;i++){
			q_node next;
			next.x = temp.x+dx[i];
			next.y = temp.y+dy[i];
			next.num = temp.num+1;
			
			if(next.x<=n && next.x>=1 && next.y<=m && next.y>=1
			&& !vis[next.x][next.y] && mp[next.x][next.y]=='.')
			{
				vis[next.x][next.y]=1;
				q.push(next);
				ans[next.x][next.y]=max(ans[next.x][next.y], next.num); 
			}
		}
		q.pop();
	}
}
int main()
{
//	freopen("in.txt", "r", stdin);
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++){
			cin>>mp[i][j];
		}
	
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			if(mp[i][j]=='.')
				bfs(i,j);
				
	int res = 0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++){
//			cout<<"x: "<<i<<" y: "<<j<<" max: "<<ans[i][j]<<endl; 
            res = max(res, ans[i][j]);
        }			
			
	cout<<res<<endl;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int s=0,i;
    char str[3];
    for(i=0;i<3;i++)
    scanf("%c",&str[i]);
    getchar();
    for(i=0;i<3;i++)
    if(str[i]=='1')
    s++;
    printf("%d",s);
    return 0;
}


Measured memory_bytes: 128
N, A, B, C, D = map(int, input().split())
S = input()

for i in range(A, C-1):
    if S[i] == "#" and S[i+1] == "#":
        print("No")
        exit()

for i in range(B, D-1):
    if S[i] == "#" and S[i+1] == "#":
        print("No")
        exit()

if C < D:
    print("Yes")
else:
    for i in range(B-2, D-1):
        if S[i:i+3] == "...":
            print("Yes")
            break
    else:
        print("No")
        
    

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

int main() {
    int a, b, cnt;
    cin >> a >> b;

    if (max(a, b)==a) {
        cnt += a;
        a--;
    } else {
        cnt += b;
        b--;
    }

    cnt += max(a, b);

    cout << cnt << endl;
}

Measured memory_bytes: 256
import Control.Monad

main :: IO ()
main = do
  w <- readLn
  n <- readLn
  lots <- replicateM n $ do
    ln <- getLine
    let (a,b) = break (== ',') ln
    return $ (read a-1, read (tail b)-1)
  mapM_ print $ foldl (\acc (a,b) -> swap acc a b) [1..w] lots

swap :: [a] -> Int -> Int -> [a]
swap xs a b = foldr f [] $ zip [0..] xs
  where
    f (idx, v) acc
      | idx == a  = xs !! b : acc
      | idx == b  = xs !! a : acc
      | otherwise = v : acc

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

using namespace std;

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

    int n; cin >> n;
    for (int i = 0; i < n; ++i) {
        int b; cin >> b;
        auto it = find(a.begin(), a.end(), b);
        if (it != a.end()) a[it - a.begin()] = 0;
    }
    string ans = "No";

    for (int i = 0; i <= 7; i += 3) {
        if (a[i] == 0 && a[i+1] == 0 && a[i+2] == 0) {
            ans = "Yes";
            goto end;
        }
    }
    for (int i = 0; i < 3; ++i) {
        if (a[i] == 0 && a[i+3] == 0 && a[i+6] == 0) {
            ans = "Yes";
            goto end;
        }
    }
    if (a[4] == 0) {
        if (a[0] == 0 && a[8] == 0) {
            ans = "Yes";
            goto end;
        }
        if (a[2] == 0 && a[6] == 0) {
            ans = "Yes";
        }
    }

    end:;
        cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()){
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()){
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

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

    int k, n;
    cin >> k >> n;

    if(k % 2 == 0){
        cout << k / 2;
        rep(i, n - 1){
            cout << " " << k;
        }
        cout << endl;
        return 0;
    }

    vector<int> ans;
    rep(i, n){
        ans.push_back((k + 1) / 2);
    }

    int x = n / 2;
    rep(i, x){
        if(ans.back() == 1){
            ans.pop_back();
            continue;
        }

        ans.back()--;
        while(SZ(ans) != n){
            ans.push_back(k);
        }
    }

    for(int x : ans){
        cout << x << " ";
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 6512
Sa = input()
Sb= input()
Sc = input()
A_list = []
B_list = []
C_list = []
def str_tolist(string,X_list):
    for item in string:
        X_list.append(item)
    return X_list
str_tolist(Sa,A_list)
str_tolist(Sb,B_list)
str_tolist(Sc,C_list)
start_character = A_list[0]
next_player = A_list.pop(0)
while len(A_list) >= 0 and len(B_list) >= 0 and len(C_list ) >=0:
    if next_player == 'a':
        if len(A_list) != 0:
            next_player = A_list.pop(0)
        else:
            print('A')
            break
    elif next_player == 'b':
        if len(B_list) != 0:
            next_player = B_list.pop(0)
        else:
            print('B')
            break
    else:
        if len(C_list) != 0:
            next_player = C_list.pop(0)
        else:
            print('C')
            break

Measured memory_bytes: 3064
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class A
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var (N, M) = Scanner.Scan<int, int>();
            Console.WriteLine(N == M ? "Yes" : "No");
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


Measured memory_bytes: 28356
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>
#include <map> 
#include <queue>

using namespace std;
typedef long long ll;
ll N, M;

//数列の最大公約数を最大にするには
//数列上の任意の数字を一つ取り除いたときの数列の最大公約数が最大になればよい

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

int main(){

    cin >> N;
    vector<ll > v(N, 0);


    for(ll i = 0; i < N; i++){
        cin >> v[i];
    }

    vector<ll > left(N + 1, 0);
    vector<ll > right(N + 1, 0);
    
    //GCDを左右から求める
    //left[0] = 0 left[1] = 0 と　数列v[0]の最大公約数つまりv[0]
    //left[2] = GCD(v[0], v[1])
    for(ll i = 0; i < N; i++){
        left[i + 1] = GCD(left[i], v[i]);
        //cout << v[i] << endl;
    }
    //leftの反対
    for(ll i = N - 1; i >= 0; i--){
        right[i] = GCD(right[i + 1], v[i]);
        //cout << v[i] << endl;
    }  


    ll ans = 0;
    //GCD(left[0], left[1]) >>> v[0]を穴あきにしたときの数列の最大公約数を調べる
    //GCD(left[1], left[2]) >>> v[1]を穴あきにしたときの数列の最大公約数を調べる
    for(ll i = 0; i < N; i++){
        ans = max(ans, GCD(left[i], right[i + 1]));
    }

    cout << ans << endl;


}

Measured memory_bytes: 2560
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define ABS(a) (((a) >= 0) ? (a) : -(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define POW_10_5 100000
#define POW_10_9 1000000000
#define MOD 1000000007
#define INF (numeric_limits<int>::max()/2)
#define int long long

typedef pair<int, int> Pair;
typedef unordered_map<int, int> Hash;

// ---
int N;

int Ans() {
  if (N%2 == 0) {
    return N/2 - 1;
  } else {
    return (N-1)/2;
  }
}

signed main() {
  cin >> N;

  auto ans = Ans();

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


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::Read;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok().unwrap();
    ret
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn solve() {
    let h: usize = get();
    let n: usize = get();
    let p: usize = get::<usize>() - 1;
    let m: usize = get();
    let k: usize = get();
    let mut yoko = vec![None; h];
    for _ in 0 .. m {
        let a: usize = get();
        let b: usize = get();
        yoko[a - 1] = Some(b - 1);
    }
    let mut dp = vec![vec![vec![0.0; n]; k + 1]; h + 1];
    dp[h][0][p] = 1.0;
    let mut rem = h - m;
    for i in (0 .. h).rev() {
        if let Some(pos) = yoko[i] {
            dp[i] = dp[i + 1].clone();
            for j in 0 .. k + 1 {
                dp[i][j].swap(pos, pos + 1);
            }
            continue;
        }
        for j in 0 .. k + 1 {
            for l in 0 .. n {
                let coef = (rem as f64 - (k - j) as f64) / rem as f64;
                dp[i][j][l] += coef * dp[i + 1][j][l];
                if j > 0 {
                    let coef = (k - j + 1) as f64 / rem as f64 / (n - 1) as f64;
                    if n >= 3 {
                        dp[i][j][l] += (n - 3) as f64 * coef * dp[i + 1][j - 1][l];
                        dp[i][j][l] += coef * dp[i + 1][j - 1]
                            [if l == 0 { 0 } else { l - 1 }];
                        dp[i][j][l] += coef * dp[i + 1][j - 1]
                            [if l == n - 1 { n - 1 } else { l + 1 }];
                    } else {
                        dp[i][j][l] += coef * dp[i + 1][j - 1][1 - l];
                    }
                }
            }
        }
        rem -= 1;
    }
    println!("{:.15}", dp[0][k].iter()
             .max_by(|&x, &y| x.partial_cmp(y).unwrap()).unwrap());
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}



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

int main() {
    int64_t a, b, c, d;
    cin >> a >> b >> c >> d;
    
    
    if(b <= 0){
        if(d <= 0){
            cout << a * c << endl;
        }else if(c < 0 && d > 0){
            cout << a * c << endl;
        }else if(c > 0){
            if(b == 0){
                cout << 0 << endl;
            }else cout << b * c << endl;
        }
    }else if(a < 0 && b > 0){
        if(d <= 0){
            cout << a * c << endl;
        }else if(c < 0 && d > 0){
            if(a*c > b*d){
                cout << a * c << endl;
            }else cout << b * d << endl;
        }else if(c > 0){
            cout << b * d << endl;
        }
    }else if(a >= 0){
        if(d <= 0){
            if(a == 0){
                cout << 0 << endl;
            }else cout << a * d << endl;
        }else if(c < 0 && d > 0){
            cout << b * d << endl;
        }else if(c > 0){
            cout << b * d << endl;
        }
    }
}

Measured memory_bytes: 3632
#include <iostream>
using namespace std;
int main(){


  int n,a[10000],m,b,result=0,i,j;

  cin>>n;
  for(i=0;i<n;i++) cin>>a[i];
  cin>>m;
  for(i=0;i<m;i++){
    cin>>b;
    for(j=0;j<n;j++) if(b==a[j]){
	result++;
	break;
      }
  }

  cout<<result<<endl;

  return 0;

}



Measured memory_bytes: 3116
N,K = gets.split.map(&:to_i)
cs = {}
N.times {
  a,b = gets.split.map(&:to_i)
  cs[a] = (cs[a] || 0) + b
}

ans = 0
M = (1 << 32) - 1
(0..K.bit_length).each{ |i|
  k = K
  b = 1 << (i-1)
  next if i > 0 && (K & b) == 0
  c = b > 0 ? b-1 : 0
  if (k & b) > 0
    k -= b
  end
  k = (k | c)
  $stderr.puts sprintf("%032b", k)

  k = k ^ M
  s = cs.map{ |a,b| a & k > 0 ? 0 : b }.inject(:+)
  $stderr.puts sprintf("%032b -> %d", k, s)
  ans = [ans, s].max
}
p ans


Measured memory_bytes: 24280
#include <iostream>
using namespace std ;
int main(int argc, const char * argv[]) {
    int n ;
    cin >> n ;
    
    if(n >= 100 && n <= 999){
        if(n/100 == n % 10)
            cout << "Yes" << endl ;
        else cout << "No" << endl;
    }
    else cout << "No" << endl ;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

ll n,k,c;
vector<ll> t;

int main()
{
	cin >> n >> c >> k;
	
	REP(i,n)
	{
		ll tmp;cin >> tmp;
		t.PB(tmp);
	}
	
	sort(ALL(t));
	
	ll ans = 0;
	ll time = 0;
	ll peo = 0;
	
	REP(i,n)
	{
		if(peo == 0)
		{
			time = t[i] + k;
			peo = 1;
			
			if(peo == c)
			{
				ans++;
				peo = 0;
			}
		}
		else
		{
			if(t[i] > time)
			{
				ans++;
				peo = 1;
				time = t[i] + k;
			}
			else
			{
				peo++;
				if(peo == c)
				{
					ans++;
					peo = 0;
				}
			}
		}
	}
	
	if(peo > 0)ans++;
	
	cout << ans << endl;
				
	
	return 0;
}

Measured memory_bytes: 1400
from collections import*
h,w,_,*t=map(int,open(0).read().split())
d=defaultdict(int)
for a,b in zip(*[iter(t)]*2):
  for i in range(9):d[a-i//3,b-i%3]+=1
a=[0]*10
for i,j in d:a[d[i,j]]+=h-1>i>0<j<w-1
a[0]=(h-2)*(w-2)-sum(a)
print(*a)

Measured memory_bytes: 178312
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n;
vi a,b;

int main(){
	cin>>n;
	a=b=vi(n);
	for(int i=0;i<n;i++) cin>>a[i]>>b[i];
	for(int i=2;i<n;i++) if(a[i-2]==b[i-2]&&a[i-1]==b[i-1]&&a[i]==b[i]){
		cout<<"Yes"<<endl;
		return 0;
	}
	cout<<"No"<<endl;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define INF 1000000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec) rep(lp, vec.size()) cout << vec[lp] << " "; print(""); 
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;

const int mod = 1000000007;
class mint {
public:
    ll x;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { 
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res /= a;
    }
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};

ll modpow(ll a, ll n){
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

void rem(string &str, char* charsToRemove){
   rep(i, strlen(charsToRemove)) str.erase(remove(str.begin(), str.end(), charsToRemove[i]), str.end());
}

void Main(){
	
	ll N;
	cin >> N;
	string S;
	cin >> S;
	
	ll ptr = 0;
	ll left = 0;
	rep(i, N){
		if(S[i] == '(') ptr++;
		else{
			if(ptr > 0) ptr--;
			else left++;
		}
	}
	rep(i, left) cout << '(';
	cout << S;
	rep(i, ptr) cout << ')';
		
}

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	Main();
	return 0;
	
}





Measured memory_bytes: 3612
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[]L  = new int [N*2];
 
    int all = 0;
    for(int i=0; i<N*2; i++){
    L[i] = sc.nextInt();
        if(i%2!=0){
        all += L[i]-L[i-1]+1;
        }
    }
    System.out.println(all);
    }
}

Measured memory_bytes: 39320