akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>

#define ll long long
#define ld long double
#define ull unsigned ll
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pii pair<int,int> 
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vector<int>>
#define forn(it,from,to) for(int (it)=from; (it)<to; (it)++)
const int  Inf = 2 * 1000 * 1000 * 1000;
ll LINF = (ll)4e18;
using namespace std;
#define M_PI       3.14159265358979323846   // pi

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

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("sum.in", "r", stdin);
	//freopen("sum.out", "w", stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	ll n;
	cin >> n;
	vector<ll>a(5);
	ll mx = -1;
	n--;
	for (auto &x : a) {
		cin >> x;
		mx = max(mx, n / x);
	}
	cout << mx + 5;
 	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string.h>
#define ll long long
#define Start ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define fr first
#define sc second
#define M_PI           3.14159265358979323846
using namespace std;
int n,x,Cnt[300300];


int main()
{



    scanf("%d",&n);
    for(int i=2;i<=n;i++)
     scanf("%d",&x),Cnt[x]++;
    for(int i=1; i<=n; i++)
    {
        printf("%d\n",Cnt[i]);

    }




}






Measured memory_bytes: 4516
#include <stdio.h>
#include <cmath>
#include <bits/stdc++.h>



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

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



int main(void){

	int N; cin >> N;

	int tmp = N;
	int sum = 0;
	while(tmp){
		sum += tmp % 10;
		tmp /= 10;
	}

	if(N%sum == 0) cout << "Yes" << endl;
	else cout << "No" << endl;


	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long double ld;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;

char m[60][60];
int dis[60][60];
bool visit[60][60];

void solve(){

    int h,w;
    cin >> h >> w;
    rep(i,60){
        rep(j,60){
            m[i][j]='#';
            dis[i][j]=0;
            visit[i][j]=false;
        }
    }
    int wallcount=0;
    rep(i,h){
        string st;
        cin >> st;
        rep(j,w){
            if(st[j]=='#') wallcount++;
            m[i+1][j+1]=st[j];
        }
    }

    queue<pair<int,int>> q;
    q.push(make_pair(1,1));
    visit[1][1]=true;
    int a=0;
    while(!q.empty()){
        int x = q.front().first;
        int y = q.front().second;
        //cout << x << " " << y << endl;
        q.pop();
        if(x==h&&y==w){
            a=dis[x][y];
            break;
        }
        if(!visit[x+1][y]&&m[x+1][y]=='.'){
            visit[x+1][y]=true;
            dis[x+1][y]=dis[x][y]+1;
            q.push(make_pair(x+1,y));
        }
        if(!visit[x-1][y]&&m[x-1][y]=='.'){
            visit[x-1][y]=true;
            dis[x-1][y]=dis[x][y]+1;
            q.push(make_pair(x-1,y));
        }
        if(!visit[x][y+1]&&m[x][y+1]=='.'){
            visit[x][y+1]=true;
            dis[x][y+1]=dis[x][y]+1;
            q.push(make_pair(x,y+1));
        }
        if(!visit[x][y-1]&&m[x][y-1]=='.'){
            visit[x][y-1]=true;
            dis[x][y-1]=dis[x][y]+1;
            q.push(make_pair(x,y-1));
        }
    }

    //cout << a << endl;

    if(a!=0) cout << h*w-a-wallcount-1 << endl;
    else cout << -1 << endl;

}

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


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var S = Console.ReadLine();
            var tmp = S;
            for (var i = 0; i < N; i++)
                tmp = tmp.Replace("()", "");

            int rCount = 0, lCount = 0;
            for (var i = 0; i < tmp.Length; i++) {
                if (tmp[i] == '(') rCount++;
                else if (tmp[i] == ')') lCount++;
            }

            Console.WriteLine(new string('(',lCount)+S+new string(')',rCount));
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    
    ll n, x; cin >> n >> x;
    ll m[n]; zep(i, 0, n){cin >> m[i];}
    
    ll sm = 0;
    ll mm = INF;
    zep(i, 0, n){
        sm += m[i];
        mm = min(mm, m[i]);
    }
    print(n+(x-sm)/mm)
    return 0;
}

Measured memory_bytes: 256
n = int(input())
plist = list(map(int, input().split()))

prevp = plist[0]
swap = 0
is_swap = False
for i, p in enumerate(plist[1:]):
  if is_swap:
    is_swap = False
  elif i+1 == prevp:
    is_swap = True
    swap += 1
  prevp = p

print(swap + (1 if not is_swap and plist[-1] == len(plist) else 0))


Measured memory_bytes: 14008
# 答案
from operator import itemgetter

N,M = map(int,input().split())
ｌ = []
for i in range(M):
    array = [i, 0, 0, '']
    array[1], array[2] = map(int, input().split())
    l.append(array)
tmp = 0 

# 県->年でソート
l = sorted(l, key=itemgetter(1,2))
# 識別番号をつける
for ctr in range(M):
    if l[ctr-1][1] != l[ctr][1]:
        tmp = 0
    tmp += 1
    l[ctr][3] = str(l[ctr][1]).zfill(6) + str(tmp).zfill(6)
l = sorted(l, key=itemgetter(0))

for ctr in range(M):
    print(l[ctr][3])

Measured memory_bytes: 33224
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val w = sc.next()
    println(problem044b(w))
}

fun problem044b(w: String): String {
    return if (w.groupBy { it }.map { it.value.size }.filter { it % 2 != 0 }.isEmpty()) "Yes" else "No"
}

Measured memory_bytes: 31388
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
const long long INF = INT64_MAX;

#define REP(i, n) for(ll i=0;i<n;i++)
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).rbegin(), (v).rend())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define DESC(v) sort((v).rbegin(), (v).rend())
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);erase(unique(v.begin(), v.end()), v.end())
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);

void solve() {
    ll N, Q;
    str S;
    cin >> N >> Q;
    cin >> S;
    vll l(Q), r(Q);
    for(int i = 0; i < Q; i++) {
        cin >> l[i] >> r[i];
    }
    vll cum(N, 0);
    ll ctr = 0;
    for(int i = 0; i < S.size() - 1; i++) {
        if(S[i] == 'A' && S[i + 1] == 'C') {
            ctr++;
        }
        cum[i+1] = ctr;
    }
    for(int i = 0; i < Q; i++) {
        cout << cum[r[i]-1] - cum[l[i]-1] << endl;
    }
}

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


Measured memory_bytes: 3408
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<complex>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using Complex = complex<double>;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
double PI = acos(-1.0);
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

const int KMAX = 200000;
long double sum[KMAX + 3];

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

	int N, K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		long double p;
		cin >> p;
		sum[i + 1] += sum[i] + (p + 1.0) / 2.0;
	}
	long double ans = 0;
	for (int i = 0; i < N; i++) {
		if (i + K > N)break;
		ans = max(ans,sum[i+K]-sum[i]);
	}
	cout << setprecision(20) << ans << endl;
	
	return 0;
}

Measured memory_bytes: 3456
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	char a,b;
  cin>>a>>b;
  if(a>b){
	cout<<">"<<endl;
  }else if(a==b){
    cout<<"="<<endl;
  }else{
    cout<<"<"<<endl;
  }
}

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

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  int x = 0, n; cin >> n;
  string s; cin >> s;
  n = 0;
  for (char ch: s) {
    x += ch == 'I' ? 1 : -1;
    n = max(x, n);
  }
  cout << n << '\n';
  return 0;
}


Measured memory_bytes: 384
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());

    int N;
    in(N);

    string c;
    in(c);

    //int count = 0;
    //reps(i, 1, N)
    //{
    //    if (c[i] == 'R' && c[i - 1] == 'W') count++;
    //}

    int countR = 0;
    int countW = 0;
    rep(i, N)
    {
        if (c[i] == 'R')
            countR++;
        else
            countW++;
    }

    int count2 = 0;
    reps(i, countR, N)
    {
        if (c[i] == 'R') count2++;
    }

    int ans = N;
    //chmin(ans, count);
    chmin(ans, countR);
    chmin(ans, countW);
    chmin(ans, count2);

    outl(ans);

    return 0;
}

Measured memory_bytes: 3732
w, h, n = map(int, input().split())
start = [0, 0]
end = [w, h]
for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        start[0] = max(start[0], x)
    elif a == 2:
        end[0] = min(end[0], x)
    elif a == 3:
        start[1] = max(start[1], y)
    elif a == 4:
        end[1] = min(end[1], y)

if end[0] - start[0] > 0 and end[1] - start[1] > 0:
    print((end[0] - start[0])*(end[1] - start[1]))
else:
    print(0)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printv(x) for(int i = 0; i < x.size(); i++){ cout << (x[i]) << " "; } cout << endl; 
#define printa(x) for(int i = 0; i < (sizeof(x)/sizeof(x[0])); i++){ cout << (x[i]) << " ";} cout << endl;
#define printaa(x) for(int i = 0; i < (sizeof(x)/sizeof(x[0])); i++){ for(int j = 0; j < (sizeof(x[0])/sizeof(x[0][0])); j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;

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

    int N;
    cin >> N;
    int t[100001], x[100001], y[100001];
    rep(i,0,N){
        cin >> t[i] >> x[i] >> y[i];
    }
    bool is_ok = true;
    int bt = 0;
    int bx = 0;
    int by = 0;
    rep(i,0,N){
        int at = t[i];
        int dt = at-bt;
        int dx = x[i] - bx;
        int dy = y[i] - by;
        if(abs(dx) + abs(dy) > dt){
            is_ok = false;
        }else if((dt - abs(dx) - abs(dy)) % 2 == 1){
            is_ok = false;
        }

        bt = t[i];
        bx = x[i];
        by = y[i];
    }
    if(is_ok){
        print("Yes");
    }else{
        print("No");
    }
}


Measured memory_bytes: 1408
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<int,int>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
// set:T,map:f  TxT→T =(T,f)
// set:E,map:h ExE→E =(E,h)
//map: g:TxE→T
//1-index
template<typename T,typename E>
struct lazysegtree{
using F=function<T(T,T)>;
using G=function<T(T,E)>;
using H=function<E(E,E)>;
int n,height;
F f;G g;H h;T t;E e;
vector<T> dat;
vector<E> laz;
lazysegtree(int n_,F f,G g,H h,T t,E e):f(f),g(g),h(h),t(t),e(e){
    n=1;height=0;
    while(n<n_)n*=2,height++;
    dat.assign(2*n,t);
    laz.assign(2*n,e);
}
lazysegtree(int n_,vector<T> &v,F f,G g,H h,T t,E e):f(f),g(g),h(h),t(t),e(e){
    n=1;height=0;
    while(n<n_)n*=2,height++;
    dat.assign(2*n,t);
    for(int i=n;i-(n-2)<v.size();i++)dat[i]=v[i-(n-2)];
    for(int i=n-1;i>0;i--)dat[i]=f(dat[i*2+1],dat[i*2+2]);
    laz.assign(2*n,e);
}
inline T reflect(int k){
    return (laz[k]==e?dat[k]:g(dat[k],laz[k]));
}
inline void eval(int k){
    if(laz[k]==e)return;
    laz[(k<<1)|0]=h(laz[(k<<1)|0],laz[k]);
    laz[(k<<1)|1]=h(laz[(k<<1)|1],laz[k]);
    dat[k]=reflect(k);
    laz[k]=e;
}
inline void thrust(int k){
    for(int i=height;i>0;i--)eval(k>>i);
}
inline void recalc(int k){
    while(k>>=1)dat[k]=f(reflect((k<<1)|0),reflect((k<<1)|1));
}
void update(int a,int b,E x){
    thrust(a+=n);
    thrust(b+=n-1);
    for(int l=a,r=b+1;l<r;l>>=1,r>>=1){
        if(l&1)laz[l]=h(laz[l],x),l++;
        if(r&1)--r,laz[r]=h(laz[r],x);
    }
recalc(a);
recalc(b);
}
void set_val(int a,T x){
    thrust(a+=n);
    dat[a]=x;laz[a]=e;
    recalc(a);
}
T query(int a,int b){
    thrust(a+=n);
    thrust(b+=n-1);
    T vl=t,vr=t;
    for(int l=a,r=b+1;l<r;l>>=1,r>>=1){
        if(l&1)vl=f(vl,reflect(l++));
        if(r&1)vr=f(reflect(--r),vr);
    }
    return f(vl,vr);
}
};
int main(){
ll n,q;
cin>>n>>q;
auto f=[](ll a,ll b){return min(a,b);};
auto g=[](ll a,ll b){return b;};
lazysegtree<ll,ll> tree(n,f,g,g,INT_MAX,INT_MAX);
int c;
while(q--){
    cin>>c;
    if(c){
        int s,t;
        cin>>s>>t;
        cout<<tree.query(s,t+1)<<endl;
    }
    else{
        int s,t;ll x;
        cin>>s>>t>>x;
        tree.update(s,t+1,x);
    }
}
}


Measured memory_bytes: 7072
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
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; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
	if(!b)return 1;	if(b&1)return modpow(a,b-1,m)*a%m;
	int memo = modpow(a,b>>1,m);
	return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  int a;
  cin>>a;
  int b=(2*a-1)/222;
  out((b+1)*111);
}

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

int main(){
  ll n,m,s=0;
  cin>>n;
  m=n;
  while(m){s+=m%10;m/=10;}
  cout<<(n%s?"No":"Yes")<<endl;
}

Measured memory_bytes: 256
N = int(input())
S = input()

T = S[:N]
U = S[N:]
U = U[::-1]

from collections import defaultdict

dd1 =defaultdict(int)
dd2 =defaultdict(int)

for i in range(2**N):
    red1 = ""
    blue1 = ""
    red2 = ""
    blue2 = ""
    for j in range(N):
        if (i//(2**j))%2==0:
            red1 = red1 + T[j]
            red2 = red2 + U[j]
        else:
            blue1 = blue1 + T[j]
            blue2 = blue2 + U[j]
    dd1[red1 + " " + blue1]+=1
    dd2[red2 + " " + blue2]+=1
ans=0
for key in dd1:
    ans+=dd1[key]*dd2[key]
print(ans)

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

int main(){
  int64_t n,a,b;
  cin >> n >> a >> b;
  if(a ==0 && b== 0) {
    cout << 0;
    return 0;
  }
  int64_t c = a+b;
  int64_t d = n % c ;
  if(d>a) d = a   ;

  int64_t ans = n/c*a + d;
  cout << ans;
  

}


Measured memory_bytes: 256
use std::io;


/// https://beta.atcoder.jp/contests/abc048/tasks/abc048_b
fn main() {
    let (a, b, x) = {
        let i = read::<isize>();
        (i[0], i[1], i[2])
    };

    println!("{}", count(b, x) - count(a - 1, x));
}

fn count(n: isize, x: isize) -> isize {
    if n >= 0 { n / x + 1 }
    else { 0 }
}

#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

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

#define INF 1LL << 60
#define pb push_back
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPR(i, b, e) for (int i = (b); i <= (e); i++)

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

    int coin = 0;
    REP(i, 2) {
        if (A > B) {
            coin += A; A--;
        } else {
            coin += B; B--;
        }
    }
    cout << coin << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<sstream>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const LL inf = 1 << 30;
const int mod = 998244353;
map<PII,int>mp;
map<PII,int>mp1;
map<PII,int>mp2;
map<PII,int>::iterator it;
const int maxn = 505;
struct point{
    int x,y,flag;
}s,q;
int n;
int ans = 0;
int main(){
	int a,b,x,Max = 0,Min = 0;
	cin >> a >> b >> x;
	for(int i = 0;i<b;i++){
		int num;
		cin >> num;
		if(num < x) Min++;
		else if(num > x)Max++;
	}
	cout << min(Max,Min) <<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[4];
    cin>>s;
    int cnt=0;
    for(int i=0;i<4;i++)
    {
        if(s[i]=='2')
        {
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define allr(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define sp " "
#define double long double
#define pb push_back
#define ff first
#define int long long
#define ss second
#define vi vector<int>
#define mem(ara, a) memset(ara, a, sizeof(ara))
#define bruh freopen("bruh.txt", "r", stdin)
#define fo freopen("output.txt", "w", stdout)
#define pii pair<int, int>

long long inf = 2e18;
long long minf = -inf;

using namespace std;


signed main() {

#ifndef ONLINE_JUDGE
	//freopen("bruh.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	set<int > s;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		s.insert(a);
	}
	if (s.size() == n)cout << "YES" << endl;
	else cout << "NO" << endl;
}




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

ll mod = 1e9+7;
ll modpow(ll x, ll n){
    if(n==0)return 1;
    ll res = modpow(x*x%mod,n/2);
    if(n&1) res = res*x%mod;
    return res;
}

bool ispa(string s){
    int n = s.size();
    for(int i=0;i<n/2;i++){
        if(s[i] != s[n-1-i]){
            return false;
        }
    }
    return true;
}

int main(){
    string zaki,o;
    ll n;
    cin>>zaki>>o>>n;
    if(n <= o.size()){
        // string hoge = o.substr(o.size()-n,n);
        string rev=o;
        reverse(rev.begin(),rev.end());
        string hoge=rev.substr(0,n);
        if(ispa(hoge+zaki+hoge+o)){
            cout << 1 << endl;
            return 0;
        } 
        else {
            cout << 0 << endl;
            return 0;
        }
    }
    else{
        string rev=o;
        reverse(rev.begin(),rev.end());
        string s=zaki+rev;
        if(!ispa(s)){
            cout << 0 << endl;
            return 0;
        }
        ll ans = modpow(26,(n-o.size()+1)/2);
        cout << ans << endl;
    }
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
int g(int x, int i)
{
    return (x>>i)&1;
}
int divide(int x, int i)
{
    return (x>>(i+1)<<i) + (x&((1<<i)-1));
}
int join(int x, int i, int bit)
{
    x=(x>>i<<(i+1)) + (x&((1<<i)-1));
    if (bit) x^=(1<<i);
    return x;
}
void pl(vector<int> &c, vector<int> &a, vector<int> &b)
{
    for(auto x: a) c.push_back(x);
    for(auto x: b) c.push_back(x);
}
vector<int> build(int x, int y, int n)
{
    //cout<<x<<' '<<y<<' '<<n<<'\n';
    if (n==1) return {x, y};
    vector<int> v, v1, v2;
    for(int i=0; i<n; ++i) if (g(x, i) != g(y, i))
    {
        int newx=divide(x, i), newy=divide(y, i);
        int middle=newx^1;
        //cout<<x<<' '<<y<<' '<<n<<' '<<newx<<' '<<newy<<' '<<middle<<'\n';
        //cout<<newx<<' '<<newy<<' '<<middle<<'\n';
        v1=build(newx, middle, n-1);
        v2=build(middle, newy, n-1);
        for(int j=0; j<v1.size(); ++j) v1[j]=join(v1[j], i, g(x, i));
        for(int j=0; j<v2.size(); ++j) v2[j]=join(v2[j], i, g(y, i));
        pl(v, v1, v2);
        return v;
    }
}
string display(int x, int n)
{
    string s;
    for(int i=0; i<n; ++i)
    {
        //cout<<g(x, i)<<' '<< char('0'+g(x, i))<<'\n';
        s+=char('0'+g(x, i));
    }
    reverse(s.begin(), s.end());
    return s;
}
int main()
{
    int n, a, b;
    cin>>n>>a>>b;
    int x=__builtin_popcount(a) % 2;
    int y=__builtin_popcount(b) % 2;
    if (x==y) cout<<"NO"; else
    {
        cout<<"YES\n";
        vector<int> v=build(a, b, n);
        for(auto x: v) cout<<x<<' ';
        //cout<<'\n';
        //for(auto x: v) cout<<display(x, n)<<'\n';
    }
}


Measured memory_bytes: 1628
import java.util.Scanner;
public class Main {
 
	public static void main(String[] args) {
		  Scanner sc = new Scanner(System.in);
	         
          int K = sc.nextInt();
    	  int A = sc.nextInt();
      	  int B = sc.nextInt();
      	  int largest = (B/K)*K;
      if(A <= largest){
        System.out.println("OK");
      }else{
        System.out.println("NG");
      }
    }
}

Measured memory_bytes: 35704
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
typedef int64_t ll;
typedef uint64_t ull;
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

#define MAXN (10)
#define MOD (1000000007)

ll x[MAXN][MAXN];
int main(void)
{
    ll l,r;
    scanf("%ld %ld",&l,&r);

    ll ans = 2019;
    for(ll i = l;i<=r;i++) for(ll j=i+1;j<=r;j++)
    {
        if((j%2019) == 0 || (i%2019)==0)
        {
            printf("0\n");
            return 0;
        }

        ans = min(ans, ((i%2019)*(j%2019))%2019);
    }

    printf("%ld\n",ans);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
ll inf = LLONG_MAX;
long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll n, a, b, c, d;
  string s;
  cin >> n >> a >> b >> c >> d >> s;
  a--;
  b--;
  c--;
  d--;

  for (ll i = a; i < c; i++) {
    if (s[i] == '#' && s[i + 1] == '#') {
      No();
      return 0;
    }
  }
  for (ll i = b; i < d; i++) {
    if (s[i] == '#' && s[i + 1] == '#') {
      No();
      return 0;
    }
  }

  if (a < b &&  b < d && d < c) {
    for (ll i = b; i <= d; i++) {
      if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
        Yes();
        return 0;
      }
    }
    No();
  }
  else Yes();
}

Measured memory_bytes: 640
#include <stdio.h>

int main(){
    
    int mula=1;
    int count=0;
    int brpKali;    //4
    scanf("%d", &brpKali);
    int tambahBrp;  //3
    scanf("%d", &tambahBrp);
    for(int i=0;i<(brpKali-count);i++){
        while(mula<=tambahBrp){
            if(count>=brpKali){
                break;
            }
            mula*=2;
//            printf("dikali 2 jadi %d\n", mula);
            count++;

        }
        if(count>=brpKali){
            break;
        }
        mula+=tambahBrp;
//        printf("ditambah 3 jadi %d\n", mula);
    }
printf("%d", mula);


    return 0;
}

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

using namespace std;

int main() {
  char s[10];
  scanf("%s", s);
  int f = 0, t = 0;
  f *= 10, f += s[0] - '0';
  f *= 10, f += s[1] - '0';
  t *= 10, t += s[2] - '0';
  t *= 10, t += s[3] - '0';
  //cout << f << " " << t << endl;
  if (f == 0) {
    if (t <= 12 && t > 0) {
      puts("YYMM");
    } else {
      puts("NA");
    }
  } else if (t == 0) {
     if (f <= 12 && f > 0) {
      puts("MMYY");
    } else {
      puts("NA");
    }
  } else if (f > 12 && t > 12) {
    puts("NA");
  } else if (f <= 12 && t <= 12) {
    puts("AMBIGUOUS");
  } else if (f <= 12 && t > 12) {
    puts("MMYY");
  } else if (f > 12 && t <= 12) {
    puts("YYMM");
  }
  return 0;
}


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

int main(){
	int T;
	cin >>T ;
	while(T--){
		int s[3];
		cin >> s[0] >> s[1] >> s[2];
		sort(s,s+3);
		if( s[0] * s[0] + s[1] * s[1] == s[2] * s[2] ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

Measured memory_bytes: 2980
n = int(input())
s = []
t = []
for i in range(n):
    input_s, input_t = input().split()
    s.append(input_s)
    t.append(int(input_t))
x = input()
c = 0
for i in range(n):
    if s[i] != x:
        c += 1
    else:
        print(sum(t[c+1:]))

Measured memory_bytes: 3064
import numpy as np
import copy

def main():
    n = int(input())
    ns = list(input().split(' '))
    ns = ns[0:n]
    ns = [int(i) for i in ns]

    ns2 = copy.deepcopy(ns)

    ns2.sort()

    count =0
    for i ,v in enumerate(ns):
        if v != ns2[i]:
            count =count + 1
    
    if count >= 3:
        print("NO")
    else:
        print("YES")

if __name__ == "__main__":
    main()

Measured memory_bytes: 12432
L,R = map(int,input().split())
if L==R:
  print(L%2019 * L%2019)
  exit()
if R-L >= 2019:
  print(0)
  exit()

l = L%2019
r = R%2019
res = 2018
for i in range(l, r+1):
  for j in range(i+1,r+1):
    if (i*j)%2019==  0:
      print(0)
      exit()

    res = min(res, (i*j)%2019)

print(res)

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

int main()
{
  int a, b;
  cin >> a >> b;
  
  if (a == 0 || b == 0)
  {
    cout << "Zero";
    return 0;
  }
  else if (a < 0 && b > 0)
  {
    cout << "Zero";
    return 0;
  }
  else if (a < 0 && b < 0)
  {
    if ((b - a) % 2 == 0)
    {
      cout << "Negative";
      return 0;
    }
    else
    {
      cout << "Positive";
      return 0;
    }
  }
  else
  {
    cout << "Positive";
    return 0;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld double
#define ff first
#define ss second
ll mod = 1000000007;
ll dp[2][10000000+1];
ll ans[10];
void fun(){
	ll h,w,n;
	cin>>h>>w>>n;
	set<pair<int,int>> s,t;
	ll tot=max(0LL,h-2)*max(0LL,w-2);
	for(int i=0;i<n;++i){
		int x,y;
		cin>>x>>y;
		s.insert({x,y});
		t.insert({x,y});t.insert({x,y-1});t.insert({x,y-2});
		t.insert({x-1,y});t.insert({x-1,y-1});t.insert({x-1,y-2});
		t.insert({x-2,y});t.insert({x-2,y-1});t.insert({x-2,y-2});
	}
	for(auto p:t){
		ll cnt=0;
		int x=p.ff,y=p.ss;
		if(x<1 or x>h-2 or y<1 or y>w-2) continue;
		for(int i=0;i<=2;++i){
			for(int j=0;j<=2;++j){
				if(s.count({x+i,y+j})) ++cnt;
			}
		}
		ans[cnt]++;
	}
	ll sum=0;
	for(int i=1;i<=9;++i) sum+=ans[i];
	ans[0]=tot-sum;
	for(int i=0;i<10;++i) cout<<ans[i]<<"\n";
	return;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t=1; //cin>>t;
	while(t--){
		fun();
	}
	return 0;
}



Measured memory_bytes: 50456
# D - Maze Master
from collections import deque, defaultdict

INF = 1 << 30
MOD = 10 ** 9 + 7
dxy = [(-1, 0), (0, -1), (0, 1), (1, 0)]


def bfs(sx: int, sy: int):
    queue = deque([(sx, sy)])
    dist = defaultdict(lambda: INF)
    dist[sx * MOD + sy] = 0
    while queue:
        x, y = queue.popleft()
        for dx, dy in dxy:
            nx, ny = x + dx, y + dy
            if S[nx][ny] == ".":
                if dist[x * MOD + y] + 1 < dist[nx * MOD + ny]:
                    dist[nx * MOD + ny] = dist[x * MOD + y] + 1
                    queue.append((nx, ny))
    return max(dist.values())


def main():
    global S
    H, W, *S = open(0).read().split()
    H, W = int(H) + 2, int(W) + 2
    S = ["#" * W] + ["#" + s + "#" for s in S] + ["#" * W]  # put sentinels
    ans = max(bfs(i, j) for i, s in enumerate(S[1:H + 1], 1) for j, c in enumerate(s[1:W + 1], 1) if c == ".")
    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;
int n;
int k;
vector <int> h(100000);
vector <int> cost(100000);

int dp(int n, int k)
{
    if(cost.at(n) != -1)
        return cost.at(n);
    cost.at(n) = dp(n-1, k) + abs(h.at(n) - h.at(n - 1));

    for(int i=2; i<=k; i++)
    {
        cost.at(n) = min(cost.at(n), dp(n-i, k) + abs(h.at(n) - h.at(n-i)));
    }
    return cost.at(n);
}

void init(int k){
    cost.at(0) = 0;
    for (int i=1; i<k; i++)
    {
        cost.at(i) = cost.at(i-1) + abs(h.at(i) - h.at(i-1));
        for(int j=2; j <= i; j++)
        {
            cost.at(i) = min(cost.at(i), cost.at(i-j) + abs(h.at(i) - h.at(i-j)));
        }
    }
}

int main()
{
    cin >> n;
    cin >> k;
    for (int i=0; i<n; i++)
    {
        cin >> h.at(i);
        cost.at(i) = -1;

    }
    init(k);
    cout << dp(n-1, k) << endl;
}


Measured memory_bytes: 10368
#include<iostream>
using namespace std;
int H, W, x[120][120];
int main() {
	for (int i = 0; i < 120; i++) { for (int j = 0; j < 120; j++)x[i][j] = 2; }
	cin >> H >> W; for (int i = 1; i <= H; i++) { for (int j = 1; j <= W; j++) { cin >> x[i][j]; } }
	int cnt = 0, e = 0;
	while (true) {
		if (e == H*W)break; e++;
		bool flag = false;
		for (int i = 1; i <= H; i++) {
			for (int j = 1; j <= W; j++) {
				if (flag == true)continue;
				if (x[i][j] == 1 && (x[i][j - 1] == 2 || x[i][j + 1] == 2) && x[i - 1][j] == 2) {
					cnt++; x[i][j] = 2;
					if (x[i - 1][j] != 2) { x[i - 1][j] = 1 - x[i - 1][j]; }
					if (x[i + 1][j] != 2) { x[i + 1][j] = 1 - x[i + 1][j]; }
					if (x[i][j - 1] != 2) { x[i][j - 1] = 1 - x[i][j - 1]; }
					if (x[i][j + 1] != 2) { x[i][j + 1] = 1 - x[i][j + 1]; }
					flag = true;
				}
			}
		}
		if (flag == true)continue;
		for (int i = 1; i <= H; i++) {
			for (int j = 1; j <= W; j++) {
				if (flag == true)continue;
				if (x[i][j] == 0 && (x[i][j - 1] == 2 || x[i][j + 1] == 2) && x[i - 1][j] == 2) {
					x[i][j] = 2;
					if (x[i - 1][j] != 2) { x[i - 1][j] = 1 - x[i - 1][j]; }
					if (x[i + 1][j] != 2) { x[i + 1][j] = 1 - x[i + 1][j]; }
					if (x[i][j - 1] != 2) { x[i][j - 1] = 1 - x[i][j - 1]; }
					if (x[i][j + 1] != 2) { x[i][j + 1] = 1 - x[i][j + 1]; }
					flag = true;
				}
			}
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3184
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	sc.Split(bufio.ScanWords)

	N, A, B := getInt(), getInt(), getInt()
	vmax := 0
	h := make([]int, N)
	for i := 0; i < N; i++ {
		h[i] = getInt()
		if vmax < h[i] {
			vmax = h[i]
		}
	}

	r := (vmax + B - 1) / B
	l := 0
	diff := A - B
	for l+1 < r {
		mid := (l + r) / 2
		dmg := B * mid
		ex := mid
		f := true
		for i := 0; i < N; i++ {
			if h[i] > dmg {
				d := h[i] - dmg
				ex -= (d + diff - 1) / diff
			}
			if ex < 0 {
				f = false
				break
			}
		}
		if f {
			r = mid
		} else {
			l = mid
		}
	}

	out(r)
}


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

using namespace std;

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

struct Era {
  string name;
  int y, gy;
};

vector<Era> era;

int main() {
  int n, q;
  while (true) {
    cin >> n >> q;
    if (n == 0 && q == 0) break;
    era.clear();
    rep (i, n) {
      Era e;
      cin >> e.name >> e.y >> e.gy;
      era.push_back(e);
    }
    rep (i, q) {
      int y;
      cin >> y;
      rep (j, n) {
	if (era[j].gy - era[j].y < y && y <= era[j].gy) {
	  cout << era[j].name << " " << y - (era[j].gy - era[j].y) << endl;
	  goto end;
	}
      }
      cout << "Unknown" << endl;
    end:;
    }
  }
}

Measured memory_bytes: 1284
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    N, K = map(int, input().split())
    l_list = list(sorted(list(map(int, input().split()))))
    print(sum(l_list[-K:]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.lang.Math.*;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int w = in.nextInt();
        int h = in.nextInt();
        int n = in.nextInt();
        int xl = 0;int xr=w; int yl =0;int yup = h;
        for(int i=0;i<n;i++){
            int x = in.nextInt();
            int y = in.nextInt();
            int a = in.nextInt();
            if (a == 1 && xl<=x){
                xl=Math.min(xr,x);
            }
            else if (a==2 && xr>=x){
                xr=Math.max(xl,x);
            }
            else if (a==3 && yl<=y){
                yl=Math.min(yup,y);
            }
            else if (a==4 && yup>=y){
                yup=Math.max(yl,y);
            }
        }
        int width = xr-xl;
        int hight = yup-yl;
        int area = width*hight;
        System.out.println(area);


    }
}

Measured memory_bytes: 21716
//ABC114A
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
using namespace std;

int main(){
	int x;
	cin >> x;
	if(x == 7 || x == 5 || x == 3){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF (int)1e9  //
#define LINF (ll)4e18  //
#define MOD (int)(1e9)+7
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define PI 3.1415926535898

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

int main() {
    string s;
    cin >> s;
    string t = "CODEFESTIVAL2016";

    int cnt = 0;

    rep(i, s.length()) {
        if (s[i] != t[i]) cnt++;
    }

    cout << cnt << endl;

    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    int k = scan.nextInt();
	    scan.close();
	    for(int i=a;i<=b;i++) {
	    	if(i<a+k || b-k<i)System.out.println(i);
	    }
	}

}

Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <list>
#include <iomanip>

using namespace std;

#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
#define rep(i,a,n) for(Int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(Int (i)=(a); (i)<=(n); (i)++)
const int MAX_N = 1000000;
const Int MAX_N_Int = 1000000000000;

template <typename T>
void printV(const std::vector<T>& v, const char * const separator = " ")
{
    if(!v.empty())
    {
        std::copy(v.begin(),
                  --v.end(),
                  std::ostream_iterator<T>(std::cout, separator));
        std::cout << v.back() << "\n";
    }
}

bool isPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
Int gcd(Int a, Int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

Int lcm(Int a, Int b) {
    return a / gcd(a, b) * b;
    //a*bは64bit integer overflow
}

int Max(int a, int b, int c) {
    int temp = max(a, b);
    return max(temp, c);
}

int Min(int a, int b, int c) {
    int temp = min(a, b);
    return min(temp, c);
}

bool integer(double num) {
    return floor(num) == num;
}

Int fact(int num) {
    if (num == 0)
        return 1;
    else
        return num * fact(num - 1);
}

Int yakusu(int n) {
    int cnt = 0;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            cnt++;
            if (i * i != n) cnt++;
        }
    }
    return cnt;
}


Int fact_mod(Int n, Int mod) {
    Int f = 1; repq(i,2,n) f = f * (i % MOD) % MOD;
    return f;
}

// 繰り返し二乗法 (modの世界での累乗)
Int mod_pow(Int x, Int n, Int mod) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % mod;
        x = (x * x) % mod;
        n >>= 1;
    }
    return res;
}

// 組み合わせ nCr を求める
Int combination_mod(Int n, Int r, Int mod) {
    if(r > n-r) r = n-r;
    if(r == 0) return 1;
    Int a = 1;
    rep(i, 0, r) a = a * ((n-i) % mod) % mod;
    Int b = mod_pow(fact_mod(r, mod), mod-2, mod);
    return (a % mod) * (b % mod) % mod;
}

Int cntZero(string s){
    int cnt=0;
    reverse(s.begin(),s.end());
    for (int i = 0; i < s.length(); ++i) {
        if(s[i]=='0')cnt++;
        else break;
    }
    return cnt;
}

int main() {
    //COMinit();
    IOS;
    prec;
    Int a,b,c,d,n,m,k,x,y=0,ans=0,ans1=0;
    string str,s="",t,u;
    cin>>n>>k;
    if(2*k-1<=n)cout<<"YES";
    else cout<<"NO";


    cout<<endl;
    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

typedef long long cat;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

cat DFS(int R, int par, vector< vector< pair<int, cat> > > &G, int goal) {
	if(goal == R) return 0;
	ALL_THE(G[R], it) if(par != it->ff) {
		cat c = DFS(it->ff, R, G, goal);
		if(c == -1) continue;
		c = max(c, it->ss);
		return c;
	}
	return -1;
}

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int W, B;
	cin >> W >> B;
	char c[100][100];
	for(int i = 0; i < 100; i++) {
		for(int j = 0; j < 100; j++) c[i][j] = (i < 50) ? '.' : '#';
	}
	for(int i = 0; i < B-1; i++) {
		bool stop = false;
		for(int j = 0; j < 100; j += 2) {
			for(int k = 0; k < 40; k += 2) if(c[k][j] == '.') {
				c[k][j] = '#';
				stop = true;
				break;
			}
			if(stop) break;
		}
	}
	for(int i = 0; i < W-1; i++) {
		bool stop = false;
		for(int j = 0; j < 100; j += 2) {
			for(int k = 99; k >= 60; k -= 2) if(c[k][j] == '#') {
				c[k][j] = '.';
				stop = true;
				break;
			}
			if(stop) break;
		}
	}
	cout << "100 100\n";
	for(int i = 0; i < 100; i++) {
		for(int j = 0; j < 100; j++) cout << c[i][j];
		cout << "\n";
	}
	return 0;}

// look at my code
// my code is amazing


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
	long long  a,n,m;
	long long  t = 5;
	int i;
	cin >> n;
	for (i = 0; i < 5; ++i) {
		cin >> a;
		if (i == 0)m = a;
		if (a < m) {
			m = a;
		}
	}
	t += (n%m!=0)? n/m:(n/m)-1;
	
	cout << t << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>

//using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
template<typename T> void chadd(T& a, T b) { a = a + b; }

namespace {  // 名前なし名前空間
	// gcd, lcm は C++17 でstdに標準入りしたので言語のバージョンに注意
	// 最大公約数
	ll gcd(ll a, ll b) {
		if (b == 0) return a;
		return gcd(b, a % b);
	}

	// 最小公倍数
	ll lcm(ll a, ll b) {
		return a / gcd(a, b) * b;
	}
}

int main() {

	int n;
	std::cin >> n;

	int ans = 0;
	Rep(i, 1, (n + 1) / 2) {
		if (i != n - i) ans++;
	}

	std::cout << ans << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<cstdio>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>

#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
const ll mod = 998244353;


ll N,ans=INF;
int cntw[300001];
string S;


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

	FOR(i, 1, N+1) {
		cntw[i] = cntw[i - 1];
		if (S[i - 1] == 'W')cntw[i]++;
	}

	FOR(i, 1, N+1) {
		ans = min(ans, cntw[i - 1] + N - i - cntw[N] + cntw[i]);
	}
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 1796