akhauriyash/Code-Regression huggingface dataset:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,a,b = li()
s = ns()

cnt = 0
frank = 1

for i, si in enumerate(s):
    if si == 'a':
        if cnt < a+b:
            cnt += 1
            print("Yes")
        else:
            print("No")
            
    elif si == 'b':
        if cnt < a+b and frank <= b:
            cnt += 1
            frank += 1
            print("Yes")
        else:
            print("No")
            
    else:
        print("No")

Measured memory_bytes: 4016
#include<iostream>
#include<climits>
#include<numeric>
#include<algorithm>
#include <sstream>
#include<cstring>
#include<cmath>
#include<iterator>
#include<utility>
#include<array>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<list>
#include<forward_list>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vlli vector<long long int>
#define vvi vector<vector<int>>
#define vpii vector<pair<int,int>>
#define vs vector<string>
#define lin1(x) ll int x; x = scan();
#define lin2(x,y) ll int x, y; x = scan(), y = scan();
#define lin3(x,y,z) ll int x, y, z; x = scan(), y = scan(), z = scan();
#define pb(x) push_back(x)
#define makep(x,y) make_pair(x,y)
#define mx(a,b) (a)>(b)?(a):(b)
#define mn(a,b) (a)<(b)?(a):(b)
#define fori(s,e) for(i=s;i<=e;i++)
#define forj(s,e) for(j=s;j<=e;j++)
#define fork(s,e) for(k=s;k<=e;k++)
#define rep(i,s,e) for(int i=s;i<=e;i++)
#define brep(i,s,e) for(int i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x));
#define bits1(x) __builtin_popcount(x)
#define pi 3.14159265358979323846264338327950
#define MOD7 1000000007
#define MOD9 1000000009
#define fast std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;

int main()
{
#ifdef RAHUL
    freopen("input.txt","r",stdin);
#endif
ll int t;
cin>>t;
string s;
cin>>s;
int count=0;
for (int i = 0; i < s.length(); ++i)
{
	/* code */
	if (s[i]!=s[i+1])
	{
		/* code */
		count++;
	}
}
cout<<count<<endl;
return 0;

}

Measured memory_bytes: 760
#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;

struct PartialPersistentUnionFind {
	std::vector<std::vector<std::pair<int, int>>> history;
	std::vector<int> data, time;
	int now = 0;
	
	PartialPersistentUnionFind(int n) {
		history.assign(n, std::vector<std::pair<int, int>>(1, {0, -1}));
		time.assign(n, 1 << 30);
		data.assign(n, -1);
		now = 0;
	}
	
	int unite(int x, int y) {
		x = find(++now, x);
		y = find(now, y);
		if(x == y) return now;
		if(data[x] > data[y]) std::swap(x, y);
		data[x] += data[y];
		data[y] = x;
		history[x].push_back({now, data[x]});
		time[y] = now;
		return now;
	}
	
	int find(int t, int k) {
		if(time[k] > t) return k;
		return find(t, data[k]);
	}
	
	bool same(int t, int x, int y) {
		return find(t, x) == find(t, y);
	}
	
	int size(int t, int x) {
		x = find(t, x);
		return -std::prev(lower_bound(begin(history[x]), end(history[x]), std::make_pair(t, 0)))->second;
	}
};

int main(){
	int n, m; cin >> n >> m;
	std::vector<std::pair<int, std::pair<int, int>>> vec(m);
	for(int i = 0; i < m; i++) cin >> vec[i].second.first >> vec[i].second.second >> vec[i].first;
	sort(begin(vec), end(vec));
	
	int now = 1;
	i64 cost = 0;
	std::vector<int> pos;
	PartialPersistentUnionFind uf(n);
	for(int i = 0; i < m; i++) {
		i64 c = vec[i].first;
		auto p = vec[i].second;
		int x = p.first - 1, y = p.second - 1;
		
		if(uf.same(now, x, y)) continue;
		uf.unite(x, y); ++now;
		pos.push_back(c);
		cost += c;
	}
	
	int q; cin >> q;
	while(q--) {
		int x, y; cin >> x >> y; x--; y--;
		
		int ok = 0, ng = now;
		while(std::abs(ok - ng) > 1) {
			int mid = (ok + ng) / 2, sz = -1;
			
			if(!uf.same(mid, x, y)) ok = mid;
			else ng = mid;
		}
		
		cout << cost - pos[ok] << endl;
	}
	return 0;
}


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

using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep3(i, s, n, d) for (int i = (s); i < (int)(n); i += (d))
#define allpt(v) (v).begin(), (v).end()
#define allpt_c(v) (v).cbegin(), (v).cend()
#define allpt_r(v) (v).rbegin(), (v).rend()

const int mod = 1e9 + 7;
const string wsp = " ";
const string tb = "\t";
const string rt = "\n";

template <typename T>
void show1dvec(const vector<T> &v)
{
    if (v.size() == 0)
        return;
    int n = v.size() - 1;
    rep(i, n) cout << v[i] << wsp;
    cout << v[n] << rt;
    return;
}

template <typename T>
void show2dvec(const vector<vector<T>> &v)
{
    int n = v.size();
    rep(i, n) show1dvec(v[i]);
}

template <typename T, typename S>
void show1dpair(const vector<pair<T, S>> &v)
{
    int n = v.size();
    rep(i, n) cout << v[i].first << wsp << v[i].second << rt;
    return;
}

template <typename T, typename S>
void pairzip(const vector<pair<T, S>> &v, vector<T> &t, vector<T> &s)
{
    int n = v.size();
    rep(i, n)
    {
        t.push_back(v[i].first);
        s.push_back(v[i].second);
    }
    return;
}

template <typename T>
void maxvec(vector<T> &v)
{
    T s = v[0];
    int n = v.size();
    rep(i, n - 1)
    {
        if (s > v[i + 1])
        {
            v[i + 1] = s;
        }
        s = v[i + 1];
    }
}

template <typename T, typename S>
bool myfind(T t, S s)
{
    return find(t.cbegin(), t.cend(), s) != t.cend();
}

bool check(int y, int x, int h, int w)
{
    return 0 <= y && y < h && 0 <= x && x < w;
}

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n;
    cin >> n;
    ll total = 0;
    VL a(n), b(n + 1, 0);
    rep(i, n)
    {
        cin >> a[i];
        b[a[i]]++;
    }
    rep(i, n + 1)
    {
        total += b[i] * (b[i] - 1) / 2;
    }

    rep(i, n)
    {
        // cout << b[a[i]] << rt;
        cout << total - b[a[i]] + 1 << rt;
    }

    return 0;
}


Measured memory_bytes: 5760
#include <cstdio>
#include <cstring>
#include <vector>
#include <cassert>

using namespace std;

int num[2048][2048];
int dy[] = {0, -1, 0, 1};
int dx[] = {1, 0, -1, 0};
int m;
bool prime[1000001];
pair<int, int> pos[1002001];
pair<int, int> memo[1000001];

bool valid(int y, int x)
{
	return (0 <= y && y <= 2000 && 0 <= x && x <= 2000 && 1 <= num[y][x] && num[y][x] <= m);
}

pair<int, int> getMax(pair<int, int> pos)
{
	if (memo[num[pos.first][pos.second]].first != -1)
		return (memo[num[pos.first][pos.second]]);
	
	int y = pos.first, x = pos.second;
	pair<int, int> ret = make_pair(0, 0);
	for (int dx = -1; dx <= 1; dx++){
		if (valid(y + 1, x + dx)){
			pair<int, int> tmp = getMax(make_pair(y + 1, x + dx));
			if (ret < tmp) ret = tmp;
		}
	}
	
	if (prime[num[y][x]]){
		ret.first++;
		if (!ret.second) ret.second = num[y][x];
	}
	
	return (memo[num[pos.first][pos.second]] = ret);
}

int main()
{
	memset(num, -1, sizeof(num));
	
	int sx = 1000, sy = 1000;
	int n = 1;
	int step = 1, dir = 0;
	
	num[sy][sx] = n;
	pos[n++] = make_pair(sy, sx);
	while (n <= 1000000){
		for (int i = 0; i < step; i++){
			sy += dy[dir]; sx += dx[dir];
			num[sy][sx] = n;
			pos[n++] = make_pair(sy, sx);
		}
		dir = (dir + 1) % 4;
		for (int i = 0; i < step; i++){
			sy += dy[dir]; sx += dx[dir];
			num[sy][sx] = n;
			pos[n++] = make_pair(sy, sx);
		}
		dir = (dir + 1) % 4;
		step++;
	}
	
	for (int i = 3; i <= 1000000; i += 2) prime[i] = true;
	prime[2] = true;
	
	for (int i = 3; i * i <= 1000000; i += 2){
		if (prime[i] == true){
			for (int j = 3 * i; j <= 1000000; j += 2 * i) prime[j] = false;
		}
	}
	
	while (scanf("%d %d", &m, &n) && m){
		for (int i = 0; i <= 1000000; i++)
			memo[i].first = memo[i].second = -1;
		
		pair<int, int> ans = getMax(pos[n]);
		
		printf("%d %d\n", ans.first, ans.second);
	}
	
	return (0);
}

Measured memory_bytes: 34128
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n, k = ril()
ls = ril()
if n <= k:
    print(0)
    exit()
ls.sort()
if k > 0:
    ls = ls[:-k]
print(sum(ls))

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

int main() {
  int a, b;
  cin >> a >> b;
  if (a + b >= 24) {
    cout << a + b - 24 << endl;
  }
  else {
    cout << a + b << endl;
  }
  return 0;
}

Measured memory_bytes: 256
N,K = map(int,input().split())
h =[]
dif = []
for n in range(0,N):
    h.append(int(input()))

h.sort()

m = 10**10

for i in range(0,N-K+1):
    m = min(m,abs(h[i] - h[i+K-1]))

print(m)


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n  ;
	cin >> n ;
	bool ok = false;
	while (n) {
		int rem = n % 10 ;
		n /= 10;
		if (rem == 7) {
			ok = true;
			break;
		}
	}
	if (ok) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}


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

int main()
{
  int ans  = 0;
  int i;
  string s;
  string t;
  cin >> s >> t;
  for (i = 0; i < 3; i++) {
    if (s[i] == t[i])
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,ans=0;
    int i;
    cin >> n;
    vector<int> a(n);
    for(i=0;i<n;i++){
        cin >> a.at(i);
        if((i+1)%2!=0 && a.at(i)%2!=0)
        ans++;
    }
    cout << ans;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

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

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

using namespace std;

#define mp make_pair
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define allarr(a) a , a + n
#define ll long long
#define ull unsigned long long 
#define pb push_back
#define fastio ios_base::sync_with_stdio(false) ; cin.tie(NULL); cout.tie(NULL)
typedef pair<int, int> pi;
typedef pair<ll,ll> pll; 
typedef pair<int,pi> trp ;
typedef vector<pi> vpi;
typedef vector<pll> vpll ;
// int ab  (int  x ) { return (x>0?x:-x); }
int main(){
	int n , m ; 
	cin >> n >>  m ; 

	vector<pi> jobs (n); 
	for(pi& p : jobs ){
		cin >> p.fi >> p.se ;
		p.fi = m-p.fi ; 
	}
	sort(all(jobs)); 

	reverse(all(jobs)); 
	int j = 0 ;
	ll ans = 0 ;
	priority_queue<int> money ;
	for(int i = m ; i >= 0 ; i-- ){
		while( jobs[j].fi >= i && j < n){
			money.push(jobs[j].se); 
			j++ ; 
		}
		if( ! money.empty() ){
			ans += (ll)money.top(); 
			money.pop(); 
		}
	}cout << ans << endl; 

}

Measured memory_bytes: 1660
package main

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

func main() {
	hash := make(map[string]int64, 0)
	N := getStdinInt64()
	var i int64 = 0
	for i = 0; i < N; i++ {
		s := getStdin()
		hash[sortString(s)]++
	}

	var ans int64 = 0
	for _, val := range hash {
		if val > 1 {
			ans += sumfrom1(val - 1)
		}
	}
	fmt.Println(ans)
}

func sumfrom1(val int64) int64 {
	var a int64 = 0
	var i int64 = 0
	for i = 0; i < val; i++ {
		a += i + 1
	}
	return a
}

func sortString(w string) string {
	s := strings.Split(w, "")
	sort.Strings(s)
	return strings.Join(s, "")
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}


Measured memory_bytes: 21956
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main()
{
  int N;
  cin >> N;
  rep(i, N)
  {
    int a;
    cin >> a;
    if (a % 2)
    {
      cout << "first" << endl;
      return 0;
    }
  }
  cout << "second" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#include<stack>
#include<set>
#include<limits>
#include <complex>
#include<cstdlib>
using namespace std;
vector<long long int> divisor(long long int n) {
	vector<long long int> res;
	for (long long int i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			res.push_back(i);
			if (i * i != n) res.push_back(n / i);
		}
	}
	sort(begin(res), end(res));
	return res;
}

int main() {
	int a = 1;
	while (1) {

		int W; cin >> W;

		if (W) {
			int N; cin >> N;
			vector<int>vs, ws;
			for (int i = 0; i < N; ++i) {
				string st; cin >> st;
				auto it = st.find(',');
				int a = stoi(st.substr(0, it));
				int b = stoi(st.substr(it + 1, st.size() - it - 1));
				vs.push_back(a);
				ws.push_back(b);
			}
			vector<vector<int>>dp(N + 1, vector<int>(W + 1,0));
			for (int i = 0; i < N; ++i) {
				for (int j = 0; j <= W; ++j) {
					if (j + ws[i] <= W) {
						dp[i + 1][j + ws[i]] = max(dp[i + 1][j + ws[i]], dp[i][j] + vs[i]);
					}
					dp[i + 1][j] = max(dp[i][j], dp[i + 1][j]);
				}
			}
			int amax = -1;
			int amin = 999999;
			for (int i = 0; i <= W; ++i) {
				amax = max(amax, dp[N][i]);
			}
			for (int i = 0; i <= W; ++i) {
				if (dp[N][i] == amax) {
					amin = i; break;
				}
			}
			cout << "Case " << a << ":" << endl;
			cout << amax << endl;
			cout << amin << endl;
			a++;
		}
		else {
			break;
		}
	}





	return 0;
}

Measured memory_bytes: 6708
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
const int MOD=1e9+7;
const int INF=1e20;

signed main(){
    string S;cin>>S;
    REP(i,S.size()){
        if(i%2==0)cout<<S[i];
    }
    cout<<endl;
}

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

#define ll long long
#define f first
#define se second
#define pb push_back
#define mp make_pair
#define boost cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0)
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>

using namespace std;

const int N = 1e5 + 100, mod = 1e9, inf = 1e9 + 7;
int a[N], b[N], c[N], n, dp[N][4];

ll bin_pow(int x, int y){
    if(y == 0)
        return 1;
    if(y == 1)
        return x;
    if(y % 2 == 0){
        ll z = bin_pow(x, y / 2);
        return (z * z) % mod;
    }
    return (bin_pow(x, y - 1) * x) % mod;
}


int main(){
    boost;
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i] >> b[i] >> c[i];
    }
    for(int i = 1; i <= n; i++){
        dp[i][1] = max(dp[i - 1][2], dp[i - 1][3]) + a[i];
        dp[i][2] = max(dp[i - 1][1], dp[i - 1][3]) + b[i];
        dp[i][3] = max(dp[i - 1][1], dp[i - 1][2]) + c[i];
    }
    cout << max({dp[n][1], dp[n][2], dp[n][3]});
    return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
#include <climits>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

class cell{
public:
	int x,y;
	cell(int _x, int _y){
		x=_x; y=_y;
	}
};

int main(){
	int n;
	const int dx[] = {-1,0,1,0};
	const int dy[] = {0,1,0,-1};
	
	while(scanf("%d",&n),n){
		vector<cell> v;
		v.push_back(cell(0,0));
		int min_x=0, min_y=0, max_x=0, max_y=0;
		rep(i,n-1){
			int m,d; scanf("%d%d",&m,&d);
			int x = v[m].x + dx[d];
			int y = v[m].y + dy[d];
			//printf("debug::i:%d  %d %d\n",i,x,y);
			v.push_back( cell(x,y) );
			min_x = min(min_x, x); min_y = min(min_y, y);
			max_x = max(max_x, x); max_y = max(max_y, y);
		}
		printf("%d %d\n",max_x-min_x+1, max_y-min_y+1);
	}
	return 0;
}

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

int main(void) {
    char str;
    while(1) {
        scanf("%c",&str);
        if(str=='\n') break;
        if(isupper(str)) {
            str=tolower(str);
        }
        else if(islower(str)) {
            str=toupper(str);
        }
        printf("%c",str);
    }
    cout<<"\n";
    return 0;
}

Measured memory_bytes: 3140
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // get value from StandardIn
    int bingo[] = new int[9];
    int ans[][] = new int[3][3];
    for(int i=0; i<9; i++){
      bingo[i] = Integer.parseInt(sc.next());
    }
    int n = Integer.parseInt(sc.next());
    for(int i=0; i<n; i++){
      int num = Integer.parseInt(sc.next());
      for(int j=0;j<9;j++){
        // System.out.println(j/3 +" "+j%3);
        if(bingo[j]==num){
          ans[j/3][j%3] = 1;
          break;
        }
      }
    }
    // System.out.println(ans[0][0] +" "+ ans[0][1] +" "+ ans[0][2]);
    // System.out.println(ans[1][0] +" "+ ans[1][1] +" "+ ans[1][2]);
    // System.out.println(ans[2][0] +" "+ ans[2][1] +" "+ ans[2][2]);
    int total[] = new int[8];
    for(int i=0; i<3; i++){
      total[0] += ans[0][i];
      total[1] += ans[1][i];
      total[2] += ans[2][i];
      total[3] += ans[i][0];
      total[4] += ans[i][1];
      total[5] += ans[i][2];
    }
    total[6] = ans[0][0] + ans[1][1] + ans[2][2];
    total[7] = ans[0][2] + ans[1][1] + ans[2][0];
    for(int i=0; i<8; i++){
      // System.out.println(total[i]);
      if(total[i] == 3){
        System.out.println("Yes");
        System.exit(0);
      }
    }
    System.out.println("No");
  }
}


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


int main() {
  unsigned int N, Y;
  cin >> N >> Y;
  int result[3];
  bool flg = false;
  for (int i=0; i<=N; ++i) {
    if (flg) {
      break;
    }
    for (int j=0; i+j<=N; ++j) {
      unsigned int total = i * 10000 + j * 5000;
      if (Y < total) {
        break;
      }
      for (int k=0; i+j+k<=N; ++k) {
        unsigned int total = i * 10000 + j * 5000 + k * 1000;
        if (total == Y && i + j + k == N) {
          flg = true;
          result[0] = i;
          result[1] = j;
          result[2] = k;
          break;
        }
      }
    }
  }
  if (!flg) {
    cout << "-1 -1 -1" << endl;
  } else {
    cout << result[0] << " " << result[1] << " " << result[2] <<endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<sstream>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<vector>
#include<queue>
#include<set>
#include<numeric>

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto n :(array))

typedef long long ll ;
typedef vector<int> vi ;
typedef vector<ll> vl ;
typedef map<string,int> dict;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
double eps = 1e-10 ;

template <typename T>
void out(vector < T > v)
{
  for(size_t i = 0; i < v.size(); i++)
  {
    debug(v[i]);
  }
}

template<typename T>
string ntos( T i ) {
  ostringstream s ;
  s << i ;
  return s.str() ;
}

template<typename T>
T ston(string str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int num;
  char a;
  double wei, hei;
  while(cin >> num >>a >> wei >> a >> hei){
    if(wei/(hei*hei) >= 25){
      cout << num << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3152
n = int(input())
S = [int(x) for x in input().split()]

q = int(input())
T = [int(x) for x in input().split()]

ans = 0
for i in range(q):
    L = 0
    R = n
    while L + 1 < R:
        M = (L + R) // 2
        if S[M] <= T[i]:
            L = M
        else:
            R = M

    find = S[L] == T[i]
    ans = ans + find
print(ans)



Measured memory_bytes: 16896
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N, M, Q;
    cin >> N >> M >> Q;
    int L, R, p, q, X[501][501] = {}, C[501][501];
    
    for(int i=0;i<M;i++){
        cin >> L >> R;
        X[L][R]++;
    }

    for(int i=1;i<=N;i++){
        for(int j=i;j<=N;j++){
            C[i][j] = C[i][j-1] + X[i][j];
        }
    }
        
    for(int i=0;i<Q;i++){
        cin >> p >> q;
        int ans = 0;
        for(int i=p;i<=q;i++)
            ans += C[i][q];
        cout << ans << endl;
    }
    
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
int n,x,y,k;
long long ans=0;
const int inf = 0x3f3f3f3f;
#define ft first
#define se second
const int maxn=100007;
pair <int,int> r[maxn];
pair <int,int> c[maxn];
struct Node{
	int u,v,cst;
}ege[2*maxn+1000];
Node make_node(int a,int b,int c){
	Node node;
	node.u=a;
	node.v=b;
	node.cst=c;
	return node;
}
int f[maxn],rnk[maxn];
int fnd(int x){
	if (f[x]==x)return x;
	return f[x]=fnd(f[x]);
}
void merge(int x,int y){
	x=fnd(x);
	y=fnd(y);
	if (rnk[x]>rnk[y])f[y]=x;
	else {
		f[x]=y;
		if (rnk[x]==rnk[y])rnk[y]++;
	}
}
bool cmp(Node a,Node b){
	return a.cst<b.cst;
}
void K(){
	for (int i=1;i<=k;++i){
		if (fnd(ege[i].u)==fnd(ege[i].v))continue;
		ans+=ege[i].cst;
		merge(ege[i].u,ege[i].v);
//		printf("%lld\n",ans);
	}
	printf("%lld\n",ans);
}
int main(){
	scanf("%d",&n);
	for (int i=0;i<n;++i){
		scanf("%d%d",&x,&y);
		r[i]=make_pair(x,i);
		c[i]=make_pair(y,i);
	}
	sort(r,r+n);
	sort(c,c+n);
	for (int i=1;i<n;++i){
		ege[++k]=make_node(r[i-1].se,r[i].se,abs(r[i].ft-r[i-1].ft));
		ege[++k]=make_node(c[i-1].se,c[i].se,abs(c[i].ft-c[i-1].ft));
	}
	sort(ege+1,ege+1+k,cmp);
	memset(f,inf,sizeof f);
	for (int i=0;i<n;++i)f[i]=i,rnk[i]=1;
	K();
	return 0;
}

Measured memory_bytes: 4992
package main

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

func main() {
	var sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		a[i], _ = strconv.Atoi(sc.Text())
	}
	
	ans := int64(0)
	absMin := 1000000001
	neg := 0

	for i := 0; i < n; i++ {
		var tmp int
		if a[i] < 0 {
			tmp = -a[i]
			neg++
		} else {
			tmp = a[i]
		}
		ans += int64(tmp)

		if tmp < absMin {
			absMin = tmp
		}
	}

	if neg % 2 != 0 {
		ans -= int64(absMin) * 2
	}

	fmt.Println(ans)
}


Measured memory_bytes: 3072
#include <iostream>
#include <string>
#include <algorithm>
#include <cassert>
#include <limits>
#include <numeric>
#include <type_traits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <complex>
#include <climits>
#include <time.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

ll gcd(ll a, ll b) {
 	while (a && b) {
 		if (a >= b) a %= b;
 		else b %= a;
  	}
  	return a + b;
}
ll ketasum(ll n) { //桁の数字全ての和を返す 例: 112 -> 4
	ll sum=0;
	if (n<0) return 0;
	while (n>0) {
		sum += n%10;
		n /= 10;
	}
	return sum;
}

typedef pair<ll, ll> pair_t;

bool comp(const pair_t &a, const pair_t &b) {
        return a.first < b.first;
}

void sort2vectors(vector<ll> &av, vector<ll> &bv)
{ // ふたつの配列をまとめてそーと A[2,1] B[3,4] -> 1,4 2,3
        ll n = av.size();
        vector<pair_t> p(n);
        vector<ll> av2(n), bv2(n);
        for (ll i = 0; i < n; i++)
                p[i] = make_pair(av[i], bv[i]);
        sort(p.begin(), p.end(), comp);
        for (ll i = 0; i < n; i++) {
                av2[i] = p[i].first;
                bv2[i] = p[i].second;
        }
        av = av2;
        bv = bv2;
}
ll facctorialMethod(ll k){ //階乗
	ll s;
	if(k > 1){
		s = k*facctorialMethod(k-1);
	} else {
		s = 1;
	}
	return s;
}

map< int64_t, ll > prime_factor(int64_t n) {
	map< int64_t, ll > ret;
 	for(int64_t i = 2; i * i <= n; i++) {
    	while(n % i == 0) {
      		ret[i]++;
      		n /= i;
    	}
  	}
  	if(n != 1) ret[n] = 1;
  	return ret;
}
const ll mod = 1000000007;
const ll INF = 1e9;

// 変数定義start(vectorはresizeしようね)
ll N;
string S;
// 変数定義end

void solve(){
	cin >> N >> S;
	for(;;){
		bool flag = false;
		REP(i, S.size()-1){
			if(S.substr(i, 1) == S.substr(i+1,1)){
				S.erase(i, 1);
				flag = true;
			}
		}
		if(!flag){
			break;
		}
	}
	cout << S.size() << endl;
}

int main(){

	//clock_t start = clock();

	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	//clock_t end = clock();

	//const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;
	//printf("time %lf[ms]\n", time);
}

Measured memory_bytes: 512
#include <iostream>

// using namespace 
using namespace std;

// typedef
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int, int> PII;

// macro
#define REP(index, num) for (auto index = 0; index < num; index++)
#define FOR(index, num) for (auto index = 1; index <= num; index++)

#define MAX_HEIGHT 60
#define MAX_WIDTH 60
#define INF (int)1e9

// global
int a, b, c;

int main()
{
  cin >> a >> b >> c;
  
  cout << a * b / 2 << endl;

}


Measured memory_bytes: 256
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    A=int(input())
    B=int(input())
    print('GREATER' if A>B else 'LESS' if A<B else 'EQUAL')

resolve()

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

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	n--, k--;
	cout << (n + k - 1) / k << endl;
	return 0;
}

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

int sumDigits (int n){
    int sum = 0;
    while (n > 0){
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

int main(){
    int N, A, B;
    cin >> N >> A >> B;
    int total = 0;
    for (int i = 1; i <= N; ++i){
        int sum = sumDigits(i);
        if (sum >= A && sum <= B) total += i;
    }

    cout << total << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<queue>
#include<vector>
#include<algorithm>
#include<tuple>
#include<numeric>
#include<map>
#include<cmath>
#define ll long long
#define mod 1000000000+7
#define rep(i,n) for(int i=0;i<(int) (n);i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
using namespace std;
int main() {
	int n,ans=0,val=0;
	cin >> n;
	vector<int>h(n);
	rep(i, n)cin >> h[i];
	reverse(h.begin(), h.end());

	for (int i = 1; i <= n;i++) {
		if (h[i-1] <= h[i])val++;
		else val = 0;
		ans = max(ans, val);
	}

	cout << ans;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define il inline
#define vd void
typedef long long ll;
il ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int x[200010],y[200010];
struct card{int x,t;}s[400010];
il bool operator<(const card&a,const card&b){return a.x<b.x;}
int main(){
#ifdef WOSHISB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n=gi(),m=0;
	for(int i=1;i<=n;++i){
		x[i]=gi(),y[i]=gi();if(x[i]>y[i])std::swap(x[i],y[i]);
		s[++m]=(card){x[i],i},s[++m]=(card){y[i],i};
	}
	std::sort(s+1,s+m+1);
	ll ans=1e18;
	if(s[1].t!=s[m].t){//最大值和最小值放一个集合，要最小化另一个集合
		int t[200010]={0},sum=0;//另一个集合来自每一个卡包里的卡数量和来自的卡包数量
		int Lmin=s[1].x,Lmax=s[m].x,Rlen=2e9;
		for(int l=2,r=2;l<m;++l){
			while(r<m&&sum!=n){
				if(!t[s[r].t])++sum;
				++t[s[r].t];
				++r;
			}
			if(sum!=n)break;
			Rlen=std::min(Rlen,s[r-1].x-s[l].x);
			--t[s[l].t];
			if(!t[s[l].t])--sum;
		}
		ans=1ll*(Lmax-Lmin)*Rlen;
	}
	//最大值和最小值放不同的集合
	int Lmin=2e9,Lmax=0,Rmin=2e9,Rmax=0;
	for(int i=1;i<=n;++i){
		Lmin=std::min(x[i],Lmin);
		Lmax=std::max(x[i],Lmax);
		Rmin=std::min(y[i],Rmin);
		Rmax=std::max(y[i],Rmax);
	}
	ans=std::min(ans,1ll*(Lmax-Lmin)*(Rmax-Rmin));
	printf("%lld\n",ans);
	return 0;
}


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

namespace CSharpSample01
{
	class Program
	{
		static void Main(string[] args)
		{
			var inputNum = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

			var a = inputNum[0];
			var b = inputNum[1];
			var c = inputNum[2];
			var d = inputNum[3];

			long[] answerArray = new long[4];


			answerArray[0] = a * c;
			answerArray[1] = a * d;
			answerArray[2] = b * c;
			answerArray[3] = b * d;

			long answer = answerArray.Max();
			Console.WriteLine(answer);

		}

	}
}

Measured memory_bytes: 19064
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define MOD 1000000007
#define endl "\n"
#define sz(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
#define trace(x) cerr << #x << ": " << x << " " << endl;
#define prv(a) for(auto x : a) cout << x << ' ';cout << '\n';
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define OTP(s) cout<<s<<endl;
#define FOR(i,j,k,l) for(int i=j;i<k;i+=l)
#define REP(i,j) FOR(i,0,j,1)
inline ll add(ll a, ll b){a += b; if(a >= MOD)a -= MOD; return a;}
inline ll sub(ll a, ll b){a -= b; if(a < 0)a += MOD; return a;}
inline ll mul(ll a, ll b){return (ll)((ll) a * b %MOD);}
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

ll min(ll a,ll b)
{
    return a>b?b:a;
}
ll max(ll a,ll b)
{
    return a>b?a:b;
}

ll dp[200000],h[200000];   
int main()
{
    IOS
    ll n;
    cin>>n;
    REP(i,n)
    {
        cin>>h[i+1];
    }
    h[0]=0;
    dp[0]=0;
    dp[1]=0;
    dp[2]=abs(h[2]-h[1]);
    for(int i=3;i<=n;i++)
    {
        dp[i]=min(dp[i-1]+abs(h[i-1]-h[i]),dp[i-2]+abs(h[i-2]-h[i]));
        // cout<<i<<" "<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
}

Measured memory_bytes: 1792
h, w = map(int, input().split())
chiz = [[] for _ in range(w)]
for _ in range(h):
    tmp_list = input()
    for i in range(w):
        chiz[i].append(tmp_list[i])
rsw_w = [[0]*h for _ in range(w)]
rsw_h = [[0]*h for _ in range(w)]
for j in range(h):
    for i in range(w):
        if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1
for j in range(h):
    for i in reversed(range(w)):
        if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j])
for i in range(w):
    for j in range(h):
        if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1
for i in range(w):
    for j in reversed(range(h)):
        if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1])
res = 0
for j in range(h):
    for i in range(w):
       res = max(res,rsw_w[i][j]+rsw_h[i][j]-1)
print(res)

Measured memory_bytes: 345392
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int main(){
    Hello
    int one = 0, zero = 0;
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '1') one++;
        else zero++;
    }
    cout << min(one, zero) * 2;
    return 0;
}


Measured memory_bytes: 3740
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	VI P(N);
	REP(i, N) {
		cin >> P[i];
	}
	int ans = 0;
	int mi = INF;

	REP(i, N) {
		if (mi > P[i]) {
			ans++;
			mi = min(mi, P[i]);
		}
	}
	cout << ans << endl;




	return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"INF " : cout<<v[i]<<" "; } cout<<endl;}
#define t1(x)                cerr<<#x<<" : "<<x<<endl
#define t2(x, y)             cerr<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define t3(x, y, z)          cerr<<#x<<" : " <<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl
#define t4(a,b,c,d)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<endl
#define t5(a,b,c,d,e)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<endl
#define t6(a,b,c,d,e,f)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<" "<<#f<<" : "<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define t(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define _ cerr<<"here"<<endl;
#define __ {ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

using namespace std;
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){ return out<<"("<<a.first<<", "<<a.second<<")";}
template <int> ostream& operator<<(ostream& os, const vector<int>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { if(v[i]!=INF) os << v[i]; else os << "INF";if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; ;if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 


int main()
{
  __;
  string s;
  cin >> s;
  int n = s.size();
  string t1,t2,t3,t4,t;
  for(int i=0;i<s.size();i++)
  {
    if(i<n/2)
    {
      t1 += s[i];
      t2 += s[i];
      t += s[i];
    }
    else if ( i > n/2)
    {
      t3 += s[i];
      t4 += s[i];
      t += s[i];
    }
    else t += s[i];
  }

  reverse(t2.begin(), t2.end());
  reverse(t4.begin(),t4.end());
  reverse(t.begin(), t.end());

  if( s == t && t1 == t2 && t3 == t4) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
s = input()
K = int(input())

n = len(s)

dp = [[[0] * 2 for _ in range(4)] for _ in range(105)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(4):
        for k in range(2):
            nd = int(s[i])
            for d in range(10):
                ni = i+1; nj = j; nk = k
                if d != 0:
                    nj += 1
                if nj > K:
                    continue
                if k == 0:
                    if d > nd:
                        continue
                    if d < nd:
                        nk = 1
                dp[ni][nj][nk] += dp[i][j][k]

ans = dp[n][K][0] + dp[n][K][1]
print(ans)

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

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

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

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

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

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

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

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

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int a,b,c,d,l,r;cin>>a>>b>>c>>d;l=a+b,r=c+d;
  l>r ? cout<<"Left"<<endl : l<r ? cout<<"Right"<<endl : cout<<"Balanced"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;


int main() {
	int d, n, a;
	scanf("%d %d", &d, &n);
	if (n != 100) {
		a = (int)pow(100, d)*n;
		printf("%d\n", a);
	}
	else {
		a = (int)pow(100, d)*(n+1);
		printf("%d\n", a);
	}
}

Measured memory_bytes: 256
def countBit( n ):
    c=0
    while 1:
        c += n&1
        if n<=0:
            return c
        n //= 2


n,m = map(int,input().split())

S=[0]*m
for i in range(m):
    K = list(map(int,input().split()))
    for j in range(1,len(K)):
        S[i]+=1<<(K[j]-1)

P = list(map(int,input().split()))

ac=0
for i in range(2**n):
    c=0
    for j in range(m):
        if countBit(S[j]&i)%2==0 and P[j]==0:
            c+=1
        elif countBit(S[j]&i)%2==1 and P[j]==1:
            c+=1
        else:
            break

    if c==m :
        # print(bin(i),bin(S[j]),i,c)
        ac+=1
print(ac)
        

Measured memory_bytes: 9148
/* Dsingh_24 */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
	ll n,i,j,ans=0;
	cin>>n;
	ll a[n+1];
	vi o,e,f;
	map<ll,ll>m;
	for(i=0;i<n;i++){
		cin>>a[i];
		m[a[i]]=i%2;
	}
	sort(a,a+n);
	for(i=0;i<n;i+=2){
		if(m[a[i]]==1)ans++;
	}
	cout<<ans;
}

Measured memory_bytes: 7296
#include <bits/stdc++.h>
#define double long double
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main() {
	int d;
	cin>>d;
	if(d==25)puts("Christmas");
	else if(d==24)puts("Christmas Eve");
	else if(d==23)puts("Christmas Eve Eve");
	else puts("Christmas Eve Eve Eve");
}


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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);

int main() {
    ios_base::sync_with_stdio(false);
    int n,r; cin >> n >> r;
    cout << r + max(0,(100*(10-n))) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
    #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
        

fast();
//ll t;cin>>t;while(t--)
{
    ll n,k;
    cin>>n>>k;
    ll a[n];
    
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll sum=0;
    for(ll i=0;i<k;i++)
    {
          sum+=a[i];
    }

    vi v;
    v.pb(sum);
    //cerr<<"Sum "<<sum<<endl;
    for(ll i=k;i<n;i++)
    {
        sum=(sum+a[i]-a[i-k]);
        v.pb(sum);
        /*if(pre!=-1)
        {
            if(sum>pre)
                Yes
            else
                No
        }*/
       // pre=sum;

    }
    //for(auto t:v)cerr<<t<<" ";cerr<<endl;
        for(int i=1;i<(int)v.size();i++)
        {
            if(v[i]>v[i-1])
                Yes
            else
                No
        }


    
}
return 0;
}


Measured memory_bytes: 6884
#include<bits/stdc++.h>
#define LLI long long int
#define LI long int
#define INF 100010001000
using namespace std;
string str;
char c;
int ans,now;

int main(){
    cin >> str;
    c=str[0];
    for(int i=1;i<str.size();i++){
        if(str[i]!=c){
            c=str[i];
            ans++;
        }
    }
    cout << ans << endl;

return 0;
}


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

int main(void){
    vector <int> a;
    int q;
    cin >> q;
    for(int i=0; i<q; i++){
        int query_num;
        cin >> query_num;
        if(query_num == 0){
            int x;
            cin >> x;
            a.push_back(x);
        }
        else if(query_num == 1){
            int q;
            cin >> q;
            cout << a[q] << "\n";
        }
        else{
            a.pop_back();
        }
    }
    return 0;
}


Measured memory_bytes: 3924
#include <iostream>
using namespace std;
int a[114514];
int main(){
    int n,iwa=0;
    cin>>n;
    for(int i=0;i<n;i++){cin>>a[i];}
    for(int i=0;i<n;i++){iwa+=a[i];}
    cout<<iwa-n<<endl;
}





Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <set>
#include <cmath>
#include <map>
#include <cstring>
#include <stack>
#include <cstdio>
#include <complex>
#include <iomanip>
#include <cstring>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define show(x) cout << #x << " = " << x << endl;
int main(){
    string a,b;
    cin >> a >> b;
    rep(i,a.size()){
        cout << a[i];
        if(i<b.size())cout << b[i];
    }
    cout << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static Input in = new Input(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String alpha = in.next();
        if (alpha.charAt(0) < 'a')
            out.println("A");
        else
            out.println("a");

        out.flush();
    }

    static class Input {
        private BufferedReader br;
        private String[] buff;
        private int index = 0;

        Input(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        String next() {
            while (buff == null || index >= buff.length) {
                buff = nextLine().split(" ");
                index = 0;
            }
            return buff[index++];
        }
        byte nextByte() {
            return Byte.parseByte(next());
        }
        short nextShort() {
            return Short.parseShort(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        float nextFloat() {
            return Float.parseFloat(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }
    }
}



Measured memory_bytes: 32784