akhauriyash/Code-Regression huggingface dataset:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    h, w, k = map(int, input().split())
    masu = [list(input()) for i in range(h)]
    ans = 0
    for i in range(w+1):
        for k1 in itertools.combinations(range(w), i):
            for j in range(h+1):
                for k2 in itertools.combinations(range(h), j):
                    sushi = 0
                    for y in k2:
                        for x in k1:
                            if masu[y][x] == "#":
                                sushi += 1
                    if sushi == k:
                        ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()


Measured memory_bytes: 78916
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <list>
#include <math.h>
using namespace std;

typedef pair<int, int> P;
#define ll long long
#define mod 1000000007


int main(){

	int N;
	string S, T;
	cin >> N >> S >> T;

	vector<int> v;
	char p = S[0];
	int l = 0;
	int i = 0;
	while (1){
		i++;
		l++;
		if (i == N) break;
		if (p != S[i]){
			v.push_back(l);
			l = 0;
			p = S[i];
		}
	}
	v.push_back(l);

	long long result;
	if (v[0] == 1) result = 3;
	else
		result = 6;
	for (auto i = 1; i<v.size(); i++){
		if (v[i - 1] == 2 && v[i] == 2) result = result * 3 % mod;
		else if (v[i - 1] == 2 && v[i] == 1) continue;
		else if (v[i - 1] == 1 && v[i] == 2) result = result * 2 % mod;
		else result = result * 2 % mod;
	}

	cout << result << endl;

	return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#define N 50
int main(void)

{
  int g,n=1,r=1,p,c,i,j,card[N],save[N];
  while(1){
    scanf("%d%d",&n,&r);
    if(n == 0 && r == 0)
      break;
    g = n;
    for(i = 0;i < n;i++){
      card[i]= g;
      g--;
    }
    for(i = 0;i < r;i++){
      scanf("%d%d",&p,&c);
      g =0;
      for(j = 0;j < p-1;j++){
        save[j] = card[j];
      }
      for(j = 0;j < c;j++){
        card[j] = card[p-1+j];
      }
      for(j = 0;j < p-1 ;j++){
        card[c+j] = save[j];
      }
    }
    printf("%d\n",card[0]);
  }
  return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n,s=0,pfh=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        int tem;cin>>tem;
        s+=tem;pfh+=tem*tem;
    }
    cout<<min(n*(s/n)*(s/n)-2*s*(s/n),n*(s/n+1)*(s/n+1)-2*(s/n+1)*s)+pfh<<endl;;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
dp = [[0] * 4 for i in range(n + 2)]  # dp[i][j]=(長さiの最後の文字がjで条件を満たす文字列の数:j= 0:A 1:G 2:C 3:T)
# 番兵を2つ置いておくと都合がいい
for i in range(4):
    dp[2][i] = 1
mod = 10**9 + 7
for i in range(3, n + 2):
    for j in range(4):
        for k in range(4):
            dp[i][j] += dp[i - 1][k]
    dp[i][2] -= dp[i - 2][0] # AGCを取り除く.
    dp[i][2] -= dp[i - 2][1] # GACを取り除く.
    dp[i][1] -= dp[i - 2][0] - dp[i - 3][1] # ACGを取り除く. ただしGACGはすでに取り除いている.
    dp[i][2] -= 3 * dp[i - 3][0] # すでに取り除いているものに注意する.結果的にAGGC,ATGC,AGTCを取り除く.
print(sum(dp[-1]) % mod)

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

long long dp[5][3003];
int a[5];
int n;

int main(int argc, char const *argv[])
{
	// freopen("in", "r", stdin);
	cin >> a[1] >> a[2] >> a[3] >> n;
	dp[0][0] = 1;
	for(int i = 1; i <= 3; i++) {
		for(int j = 0; j <= n; j++) {
			if(j - a[i] >= 0) dp[i][j] += dp[i][j - a[i]];
			dp[i][j] += dp[i - 1][j];
		}
	}
	cout << dp[3][n] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n, k; ll m; cin>>n>>k>>m;
	ll comb[301][301];
	comb[0][0]=1;
	for(int i=1; i<=n; i++){
		comb[i][0]=comb[i][i]=1;
		for(int j=1; j<i; j++){
			comb[i][j]=(comb[i-1][j-1]+comb[i-1][j])%m;
		}
	}
	ll dp[301]={};
	ll s[301][301]={};
	for(int i=0; i<=k; i++) s[i][0]=1;
	for(int i=k-1; i>=0; i--){
		for(int j=1; j<=n; j++){
			dp[j]+=s[i+1][j-1];
			dp[j]%=m;
		}
		ll dp2[301];
		for(int j=1; j<=n; j++) dp2[j]=dp[j];
		for(int j=1; j<n; j++){
			for(int l=1; l<=n-j; l++){
				dp2[j+l]+=dp2[j]*dp[l]%m*comb[j+l-1][l-1];
				dp2[j+l]%=m;
			}
		}
		for(int j=1; j<=n; j++) s[i][j]+=dp2[j], s[i][j]%=m;
	}
	cout<<s[0][n]<<endl;
	return 0;
}

Measured memory_bytes: 1664
#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};

fn main() {
    input! {
        n:usize,
        a:[usize;n]
    }
    let mut ans = 0;
    for i in a.iter().step_by(2) {
        if i % 2 != 0 {
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2124
#include<iostream>
#include<algorithm>
#define LOOP(num,a) for(int i=0; i<num; a)
using namespace std;

int main(){
    int N,sum=0;
    cin >> N;
    int L[N*2];
    LOOP(N*2,++i) cin >> L[i];
    sort(L,L+N*2);
    LOOP(N*2,i+=2) sum += L[i];
    cout << sum;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define veccat(v1, v2) std::copy((v2).begin(),(v2).end(),std::back_inserter(v1)/*v1の後ろにv2を入れる*/)
#define intmax (std::numeric_limits<int64_t>::max() / 4)
using namespace std;
typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);



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

	int N, M;
	cin >> N >> M;
	vector<vector<int>>A(N, vector<int>(M));
	rep(i, N)rep(j, M)cin >> A[i][j];
	rep(i, N)rep(j, M)A[i][j]--;

	vector<pair<pair<int,int>, set<int>>>p(M);
	rep(i, M)p[i] = make_pair(make_pair(0, i), set<int>());
	rep(i, N) {
		int favorite = A[i][0];
		p[favorite].first.first++;
		p[favorite].second.insert(i);
	}
	vector<int>sports(M, 1);
	std::sort(ALL(p), greater<pair<pair<int,int>, set<int>>>());

	int ans = p[0].first.first;
	rep(i, M - 1) {
		p[0].first.first = -1;
		sports[p[0].first.second] = 0;
		auto pp = p[0].second;

		rep(i, M)swap(p[i].first.first, p[i].first.second);
		sort(ALL(p));
		rep(i, M)swap(p[i].first.first, p[i].first.second);

		for (const auto person : pp) {
			rep(j, M)if (sports[A[person][j]]) {
				p[A[person][j]].first.first++;
				p[A[person][j]].second.insert(person);
				break;
			}
		}

		std::sort(ALL(p), greater<pair<pair<int, int>, set<int>>>());
		ans = min(ans, p[0].first.first);
	}
	cout << ans << endl;

	return 0;
}





Measured memory_bytes: 5248
from sys import stdin
import collections

input = stdin.readline

Y, X = map(int, input().split())
sy, sx = map(int, input().split())
sy -= 1
sx -= 1
ey, ex = map(int, input().split())
ey -= 1
ex -= 1
grid = [[c for c in inp] for inp in stdin.read().splitlines()]
dis = [[float('inf')] * X for _ in range(Y)]

Q = collections.deque()
Q.append((sy, sx,))
dis[sy][sx] = 0
while Q:
    cy, cx = Q.popleft()
    for ny, nx in [(cy + 1, cx), (cy - 1, cx), (cy, cx + 1), (cy, cx - 1)]:
        if 0 <= ny < Y and 0 <= nx < X and grid[ny][nx] == '.' and dis[ny][nx] > dis[cy][cx]:
            Q.appendleft((ny,nx))
            dis[ny][nx] = dis[cy][cx]
    for dy in range(-2,3):
        for dx in range(-2,3):
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < Y and 0 <= nx < X and grid[ny][nx] == '.' and dis[ny][nx] > dis[cy][cx] + 1:
                Q.append((ny,nx))
                dis[ny][nx] = dis[cy][cx] + 1

print(dis[ey][ex] if dis[ey][ex] != float('inf') else -1)

Measured memory_bytes: 141108
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int n,tmp[10]={512,256,128,64,32,16,8,4,2,1};
  while(cin >> n && n!=EOF){
    int cnt[10]={0};
    for(int i=0;i<10;i++){
      if(n-tmp[i]>=0){
    n-=tmp[i];
    cnt[i]++;
      }
      if(n==0) break;
    }
    int flg=0;
    for(int i=9;i>=0;i--){
      if(cnt[i]==1){
      if(flg==1)cout << " ";
    cout << tmp[i];
    flg=1;
      }
    }
    cout << endl;
  }
}

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<map>
using namespace std;

int main(void){
    string s;cin>>s;
    map<char,int> m;
    for(int i=0;i<s.length();i++){
        m[s[i]]+=1;
    }   
    for(char c='a';c<='z';c++){
        if(m.count(c)==0){cout<<c<<endl;return 0;}
    }
    cout<<"None"<<endl;

}

Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <set>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

string fmt(int i) {
	static char buf[1024];
	sprintf(buf, "%06d", i);
	return string(buf);
}

string get_id(int p, int rnk) {
	return fmt(p) + fmt(rnk);
}

int main() {
	int n, m; cin >> n >> m;
	vector<vector<int>> vs(n);
	vector<int> ps, ys;
	for (int i = 0; i < m; i++) {
		int p, y; cin >> p >> y;
		vs[p - 1].emplace_back(y);
		ps.emplace_back(p);
		ys.emplace_back(y);
	}

	for (auto&& v : vs)
		sort(v.begin(), v.end());

	for (int i = 0; i < m; i++) {
		int p = ps[i];
		int rnk = lower_bound(vs[p - 1].begin(), vs[p - 1].end(), ys[i]) - vs[p - 1].begin() + 1;
		cout << get_id(ps[i], rnk) << "\n";
	}
}

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

int main() {
  vector<int> A(9);
  for (int i = 0; i < 9; i++) {
    cin >> A.at(i);
  }
  int N;
  cin >> N;
  
   vector<int> b(N);
  for (int i = 0; i < N; i++) {
    cin >> b.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 9; j++) {
      if (A.at(j) == b.at(i)){
        A.at(j) = 0;
      }
    }
  }
  
  int count = 0;
  if (A.at(0) == 0 && A.at(1) == 0 && A.at(2) == 0){
     count++;   
  }
  else if (A.at(3) == 0 && A.at(4) == 0 && A.at(5) == 0){
     count++;   
  }
  else if (A.at(6) == 0 && A.at(7) == 0 && A.at(8) == 0){
     count++;   
  }
  else if (A.at(0) == 0 && A.at(3) == 0 && A.at(6) == 0){
     count++;   
  }
  else if (A.at(1) == 0 && A.at(4) == 0 && A.at(7) == 0){
     count++;   
  }
  else if (A.at(2) == 0 && A.at(5) == 0 && A.at(8) == 0){
     count++;   
  }
  else if (A.at(0) == 0 && A.at(4) == 0 && A.at(8) == 0){
     count++;   
  }
  else if (A.at(2) == 0 && A.at(4) == 0 && A.at(6) == 0){
     count++;   
  }
  
  if (count == 1){
    cout << "Yes" << endl;
  }
  else if(count == 0){
    cout << "No" << endl;
  }
}
      
    

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

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

int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a>b){
		if(b>c){
			cout<<"A"<<endl;
		}else{
			if(a>c)cout<<"A"<<endl;
			else cout<<"C"<<endl;
		}
	}else{
		if(b>c){
			cout<<"B"<<endl;
		}else{
			cout<<"C"<<endl;
		}
	}
	return 0;
}


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

bool isRestorable(string &s, const string &t){
    for(int i=s.size()-1; i>=0; i--){
        unsigned int count = 0;
        for(int j=i; j>=0; j--){
            if(s[j] == '?' || s[j] == t[t.size()-1-count]) count++;
            else break;
            if(count==t.size()){
                for(unsigned int k=0; k<t.size(); k++){
                    s[j+k] = t[k];
                }
                return true;
            }
        }
    }
    return false;
}
int main(){
    string s, t; 
    cin >> s >> t;

    bool is_find =isRestorable(s,t);

    if(!is_find){
        cout << "UNRESTORABLE" << endl;
    } else {
        for(unsigned int i=0; i<s.size(); i++){
            if(s[i] == '?') s[i] = 'a';
        }
        cout << s << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/algorithm/string/replace.hpp>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::algorithm;
using namespace boost::multiprecision;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int mINF = 1e9;
const int MOD = 1e9+7;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(){
    int n,y;
    cin >> n >> y;
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n-i;j++){
            if(10000*i+5000*j+1000*(n-i-j) == y){
                cout << i << ' ' << j << ' ' << n-i-j << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1 " << endl;
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    
    int len = int(s.size());
    int a = 0;
    while (a < len) {
        if (s.at(a) == 'A') break;
        a++;
    }
    
    int z = len-1;
    while (z > a) {
        if (s.at(z) == 'Z') break;
        z--;
    }
    
    cout << z-a+1 << endl;
}


Measured memory_bytes: 640
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cctype>


using namespace std;
#define modd 1000000007


typedef pair<long long, long long> pl;


typedef string::const_iterator State;
class ParseError {};




#define ll long long




class UnionFind {
public:
	vector <ll> par;
	vector <ll> siz;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL){
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};


class SegmentTree {
private:
	int n;
	vector <ll> node;

public:
	// 元の配列　v をセグメントツリーで表現する。
	SegmentTree(vector<ll> v) {
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく。
		//セグ木全体で必要なノード数は2n-1個である。
		int sz = v.size();
		n = 1; 
		while (n < sz)n *= 2;

	}

};




long long N, M, K, a, b, c, d, e, H, W, L;
ll A[200005] = {};
ll B[100005] = {};
ll C[300005] = {};
bool f, ff;
string S,T;
set <long long>sll;
pl bufpl;
vector <long long>vl[2][100005];
vector <long long>vll[100005];
vector <pl>vpl;
vector <string> vs;
set<ll> llset;
multiset<ll> llmset;


/*
struct ST
{
	long long Kati;
	int bangou;

	bool operator<(const ST& another) const
	{
		return Kati < another.Kati;//比較
	};

};



/*vector <ST> vst;
ST st[200005];
ST bufst;
bitset<5000> bits;*/


long long modinv(long long aa, long long mm) {
	long long bb = mm, uu = 1, vv = 0;
	while (bb) {
		long long tt = aa / bb;
		aa -= tt * bb; swap(aa, bb);
		uu -= tt * vv; swap(uu, vv);
	}
	uu %= mm;
	if (uu < 0) uu += mm;
	return uu;
}



ll minn, maxx;
double ansa;
bool fl[30] = {};



string ss, sss;


int main() {


	cin >> N;

	ff = true;
	e = 1;
	cin >> A[0];
	for (int i = 1; i < N; i++) {
		cin >> A[i];
		
		if (A[i - 1] < A[i]) {
			if (ff) {
				f = false;
				ff = false;
			}
			else if (f == true) {
				f = false;
				ff = true;
				e++;
			}
		}

		if (A[i - 1] > A[i]) {
			if (ff) {
				f = true;
				ff = false;
			}
			else if (f == false) {
				f = true;
				ff = true;
				e++;
			}
		}

	}

	cout << e << endl;
	return 0;

}


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

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second > b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
    int n, m;
    cin >> n >> m;

    priority_queue<int> q;

    pair<int, int> p[n];
    for(int i = 0; i < n; i++){
        cin >> p[i].first >> p[i].second;
        p[i].first--;
    }

    sort(p, p + n);
    /*for(int i = 0; i < n; i++){
        cout << p[i].first << " " << p[i].second << endl;
    }*/

    int now = 0;
    ll ans = 0;
    int cou = 0;
    for(int i = 0; i < m; i++){
        cou = 0;
        for(int j = now; j < n; j++){
            if(p[j].first == i){
                q.push(p[j].second);
                cou++;
            }else{
                now += cou;
                break;
            }
        }

        if(q.size() != 0){
            ans += q.top();
            q.pop();
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 4688
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,c,x,y;
	cin>>a>>b>>c>>x>>y;
	c*=2;
	int ans[5]={0};
	ans[0]=a*x+b*y;
	if(x<y)
	{
		ans[1]=c*x+b*(y-x);
		ans[2]=c*y;
	}
	else
	{
		ans[1]=c*y+a*(x-y);
		ans[2]=c*x;
	}
	ans[3]=c*x+b*y;
	ans[4]=a*x+c*y;
	sort(ans,ans+5);
	cout<<ans[0]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(void){
    string s;
    cin>>s;
    int n=0;
    for(int i=0;i<s.size()/2;i++){
        if(s[i]==s[s.size()-1-i]){
            
        }else{
            n++;
        }
    }
    cout<<n;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int c=0;
    int t=n;
    while (t > 0){
        c+=t%10;
        t/=10;
    }
        if(n%c==0){
            cout<<"Yes"<<endl;
        }
        else {
            cout<<"No"<<endl;
        }
}

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

string S;

long plus_insert(vector<bool> if_insert_plus){
	if(if_insert_plus.size() == S.size() - 1){
		long ans = 0;
		string text;
		text.push_back(S[0]);
		for(int i = 0; i < S.size() - 1; i++){
			if(if_insert_plus[i]){
				ans += stol(text);
				text = "";
			}
			text.push_back(S[i + 1]);
		}
		return ans + stol(text);
	}else{
		long ans = 0;
		if_insert_plus.push_back(false);
		ans += plus_insert(if_insert_plus);
		if_insert_plus.back() = true;
		return ans + plus_insert(if_insert_plus);
	}
}

int main(){
	cin >> S;
	vector<bool> empty;
	cout << plus_insert(empty) << endl;
}

Measured memory_bytes: 256
///
// File:  a.cpp
// Author: ymiyamoto
//
// Created on Sun Dec 31 17:15:35 2017
//

#include <cstdint>
#include <iostream>

using namespace std;

int32_t main()
{
  uint32_t M;
  cin >> M;

  cout << 24 - M + 24 << endl;

  return 0;
}


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

using namespace std;

void a(){
    int N,K; cin >> N >> K;
    string S; cin >> S;

    if (S[K -1] == 'A') S[K-1] = 'a';
    if (S[K -1] == 'B') S[K-1] = 'b';
    if (S[K -1] == 'C') S[K-1] = 'c';

    cout << S;

}

void b(){
    string S; cin >> S;
    int fast = stoi(S.substr(0,2));
    int last = stoi(S.substr(2,2));

    bool may_yymm = (0 <= fast && fast <= 99)&&(1<= last && last <=12);
    bool may_mmyy = (0 <=  last && last  <= 99)&&(1<= fast && fast  <=12);

    if (may_yymm && !may_mmyy) cout << "YYMM";
    else if (!may_yymm && may_mmyy) cout << "MMYY";
    else if (may_mmyy && may_yymm) cout <<"AMBIGUOUS";
    else if (!may_mmyy && !may_yymm) cout << "NA";


}

int pow(int x){
    if (x <=0) return 1;
    return 2*(pow (x -1));
}
void c(){

    int N,K; cin >> N >> K;
    vector<int> vec;
    vec.push_back(( N >=K )?(N -K +1):0 );
    int k = K;
    while (k > 1){
        vec.push_back( max(0, min(k, N + 1) - ( (k+1)/2) ) );
        k = (k+1)/2;
    }


    long long upper = 0;
    for(int i = 0; i < vec.size(); i++){
        upper += vec[i]*pow(vec.size() - 1 - i);
    }
    double p = static_cast<double>(upper) /(N*pow(vec.size() - 1));

    cout << fixed;
    cout << setprecision(12) << p;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
Apparently, the tree supports the same operations as the set 
(at least I haven't any problems with them before), but also there are two new features — 
find_by_order() — The first returns an iterator to the k-th largest element (counting from zero)
order_of_key() — the number of items in a set that are strictly smaller than our item. 
https://codeforces.com/blog/entry/11080
using namespace __gnu_pbds; */
using namespace std;
#define test() int t;cin>>t;for(int test=1;test<=t;test++)
#define int long long
#define MOD 1000000007
#define pb push_back 
#define ins insert
#define fast(); ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ld long double
#define endl '\n'
int m(int a) {
    return ((a%MOD)+MOD)%MOD;
}
int p(int a, int b) {
    int res = 1;
    while(b > 0){
        if(b&1) res = m(m(res)*m(a));
        a = m(m(a)*m(a));
        b >>= 1;
    }
    return res;
}
signed main(){
    fast();
    int a;
    cin >> a;
    cout << a*(1+a+a*a) << endl;
    cerr << "\nTime elapsed : " << 1000 * clock() / CLOCKS_PER_SEC << " ms\n";
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define INF 1000000000000000
#define fi first
#define se second
#define all(v) v.begin(),v.end()
typedef pair<int, int> P;
int dx[] = { 0,1,0,-1 }, dy[] = { 1,0,-1,0 };
struct edge { int to, cost; };
int n, ans;
char c[334][334], b[334][334];
signed main() {
	cin >> n;
	rep(i, n)rep(j, n)cin >> c[i][j];
	rep(i, n) {
		bool ok = 1;
		rep(j, n) {
			rep(k, n) {
				b[j][(k + i) % n] = c[j][k];
			}
		}
		rep(j, n) {
			rep(k, n) {
				if (b[j][k] != b[k][j])ok = 0;
			}
		}
		ans += ok;
	}
	cout << ans * n << endl;
	return 0;
}


Measured memory_bytes: 384
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val X =ni()
    val N =ni()
    val P = na(N).toSet()
    for (i in 0 until 100) {
      if (!P.contains(X - i)) {
        out.println(X - i)
        return
      } else if (!P.contains(X + i)) {
        out.println(X + i)
        return
      }
    }
  }













































  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<LongArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }
  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}

Measured memory_bytes: 38996
//***___********* ___*****___****___***___*********//
/*  |   \  |   | |   |   |   \  |     |     |   |  **
/*  |   |  |   | |___|   |   _  |__   |___  |___|  **
/*  |   |  |   | |   \   |  | | |         | |   |  **
/*  |___/  |___| |    \  |__| | |___  ____| |   |  **
//*************************************************/
#include<bits/stdc++.h>
#define ff double
#define endl "\n"
#define M 1000000007
#define forever while(1)
#define ll long long
#define pb push_back
#define vi vector<long long>
#define mii map<int,int>
#define pii pair<int,int>
#define set_zero(arr) memset(arr,0,sizeof(arr))
#define test ll t;cin>>t;while(t--)
#include <ext/pb_ds/tree_policy.hpp>
#define REP(i,n) for(int i=0;i<(n);i++)
#include <ext/pb_ds/assoc_container.hpp>
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define buffer cin.ignore(numeric_limits<streamsize>::max(),'\n');
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;

int read()
{
	char ch=getchar();int f=0;
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') {f=f*10+(ch^48);ch=getchar();}
	return f;
}
bool comp(string a,string b){return a<b;}

int main()
{
    int n;
    cin>>n;
    int arr[n+10];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    int ans=1;
    int m = arr[0];
    for(int i=1;i<n;i++){
        if(arr[i]<m)
            ans++;
        m=min(m,arr[i]);
    }
    cout<<ans<<endl;
return 0;
}




Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define mod 1000000007
#define MOD 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 2e9
#define common cout << "Case #" << w+1 << ": "  



int main()
{
    int n;
    cin >> n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
        cin >> v[i];
    sort(v.begin(),v.end());
    lli ans=0;
    for(int i=0;i<n-2;i++)
    {
        for(int j=i+1;j<n-1;j++)
        {
            for(int k=j+1;k<n;k++)
            {
                int a=v[i],b=v[j],c=v[k];
                if(a!=b and b!=c and a!=c)
                {
                    if(a+b>c)
                        ans+=1;
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define int long long

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    rep(i, 6) {
        if (s[i] == '1') ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int N = Integer.valueOf(s);
		Set<String> hash_Set = new HashSet<String>(); 
		
		while(N-- > 0) {
			String t = sc.nextLine();
			hash_Set.add(t);
		}
		System.out.println(hash_Set.size());
	}
}

class FastReader {
	BufferedReader bf;
	StringTokenizer st;

	public FastReader() {
		bf = new BufferedReader(new InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(bf.readLine());
			} catch (Exception e) {
				System.out.println(e);
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}

	String nextLine() {
		String str = "";
		try {
			str = bf.readLine();
		} catch (Exception e) {
			System.out.println(e);
		}
		return str;
	}
}



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

// Type alias
using ll=long long;
using ld=double;

using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;

using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using vpld=vector<ld>;
using vti3=vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max() / 2;
const ll mod = 1e9+7;

// Macro
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;--i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,a,b) for(int i=int(b-1);i>=int(a);--i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

#define ALL(a) a.begin(),a.end()

// Funtcions
ll pow(ll base, ll i, ll mod){
  ll a = 1;
  while(i){
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b){
  while(b){
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
template<typename T> bool chmin(T& a, const T& b) {
  if (a > b) return a = b, true; else return false;
}

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

int dp[3001][3001];
void solve(){
  string s, t;
  cin >> s >> t;

  rep(i, s.size()+1) dp[i][0] = 0;
  rep(j, t.size()+1) dp[0][j] = 0;

  rep(i, s.size()){
    rep(j, t.size()){
      if(s[i] == t[j])
        dp[i+1][j+1] = dp[i][j] + 1;
      else
        dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j]);
    }
  }

  int ss = s.size();
  int tt = t.size();
  int state = 0;
  string ans = "";
  while(ss != 0 && tt != 0){
    switch(state){
      case 0:
        if(dp[ss][tt] != dp[ss-1][tt]){
          state = 1;
          ans += s[ss-1];
        }
        ss--;
        break;
      case 1:
        if(dp[ss][tt] != dp[ss][tt-1]){
          state = 0;
          ans += t[tt-1];
        }
        tt--;
        break;
    }
  }
  reverse(ALL(ans));
  cout << ans << endl;
}

int main(){
// FastIO
//ios_base::sync_with_stdio(false);
cin.tie(NULL);
  solve();
  return 0;
}

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

#define ed cout<<"\n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long 
#define ffor(i,a,b) for(ll i=(a);i<(ll)(b);++i)
#define rep(i, n) ffor(i,0,n)
#define All(obj) (obj).begin(),(obj).end()
#define INF ((ll)1e9+7)
#define c(a) cout<<a<<"\n";
using namespace std;
const int N = 100005;

int main() {
	speed;
	int n;
	cin >> n;
	vector<int>a(n);
	vector<int>left_max(n);
	vector<int>right_max(n+1);
	rep(i, n) {
		cin >> a[i];
		if (i != 0) {
			left_max[i] = max(left_max[i - 1], a[i-1]);
		}
	}
	for (int i = n - 2; i >= 0; i--) {

		right_max[i] = max(right_max[i + 1], a[i+1]);
	}
	rep(i, n) {
		int ans = max(left_max[i], right_max[i]);
		c(ans);
	}
	ed;
	return 0; 
}



Measured memory_bytes: 3968
import java.util.Scanner;

public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
}


Measured memory_bytes: 21972
open Printf open Scanf
open Array

let calc c =
  let r = if c mod 2 = 0 then c-1 else c in
  let pairs = (r+1)/2 in
  (if pairs mod 2 = 0 then 0 else 1) lxor (if r=c-1 then c else 0)

let () = scanf " %d %d" @@ fun a b ->
  print_int @@ (calc b) lxor (calc (a-1))




Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
int main(void)
{
	int q,x,d,p,i,n,t,a;
	priority_queue<int> qu[1000];

	scanf("%d %d",&n,&q);
	for(i=0;i<q;i++)	{
		scanf("%d",&a);
		if(a==0)	{
			scanf("%d %d",&t,&x);
			qu[t].push(x);
		}
		else if(a==1)	{
			scanf("%d",&t);
			if(!qu[t].empty())	printf("%d\n",qu[t].top());
		}
		else {
			scanf("%d",&t);
			if(!qu[t].empty())	qu[t].pop();
		}
	}
	return 0;
}


Measured memory_bytes: 3656
def main():
    S = input()
    memo = [True] * 26
    a = ord('a')
    for c in S:
        memo[ord(c) - a] = False
    for i in range(26):
        if memo[i]:
            print(chr(i+a))
            return
    print("None")


if __name__ == "__main__":
    main()


Measured memory_bytes: 39280
#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  int data[] = {105, 135, 165, 189, 195};
  int count = 0;
  for (int i = 0; i < 5; i++) {
    if (data[i] <= N) count++; 
  }
  cout << count << endl;
  return 0;
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

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

using namespace std;

const int inf=1001;


int min_res;
bool used[2048];

inline int hstar(int cmax,int t){
	int x=cmax,ret=0;
	while(x<t) x<<=1,ret++;
	return ret;
}

int ary[1010];

int dfs(int t,int x,int d,int len){
	if(used[t]) return min_res=d;
	const int cmax=*max_element(ary,ary+len);

	if(d+hstar(cmax,t)>=min_res) return inf;

	int ret=inf;
	
	bool made[2048];
	clr(made,false);
	
	rrep(i,len){
		const int s=ary[i];
		if(0<x+s && x+s<=2*t && used[x+s]==false && made[x+s]==false){
			made[x+s]=true;
			used[x+s]=true;
			ary[len]=x+s;
			chmin(ret,dfs(t,x+s,d+1,len+1));
			used[x+s]=false;
		}
	}

	rep(i,len){
		const int s=ary[i];
		if(0< x-s && x-s<=2*t && used[x-s]==false && made[x-s]==false){
			made[x-s]=true;
			used[x-s]=true;
			ary[len]=x-s;
			chmin(ret,dfs(t,x-s,d+1,len+1));
			used[x-s]=false;
		}
	}

	return ret;
}

int main(void){
	int n;
	while(cin >> n,n){
		clr(used,false);
		used[0]=used[1]=true;
		ary[0]=1;
		min_res=0;
		while(dfs(n,1,0,1)==inf) min_res++;
		cout  << min_res << endl;
	}
	return 0;
}

Measured memory_bytes: 3112
struct SegmentTree{
    node : Vec<i64>,
    size : usize,
}

impl SegmentTree{
    fn new(size : usize)->SegmentTree{
        let mut x:usize =1;
        while x<size{
            x*=2;
        }
        SegmentTree{
            node : vec![0;2*x-1],
            size : x,
        }
    }
    fn add(&mut self, mut k:usize,x:i64){
        k+=self.size-1;
        self.node[k]+=x;
        while k>0{
            k=(k-1)/2;
            self.node[k]+=x;
        }
    }

    fn getsum( &self,a:usize,b:usize,k:usize,l:usize,r:usize)->i64{
        if r<=a || b<=l{
            return 0;
        }
        if a<=l && r<=b{
            return self.node[k];
        }
        let lx=self.getsum(a,b,2*k+1,l,(l+r)/2);
        let rx=self.getsum(a,b,2*k+2,(l+r)/2,r);
        lx+rx
    }
    fn get_sum(&self,a:usize,b:usize)->i64{
        self.getsum(a,b,0,0,self.size)
    }
}



fn main(){
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let v:Vec<usize>=s.trim().split_whitespace()
                    .map(|e|e.parse().unwrap()).collect();
    let (n,m)=(v[0],v[1]);
    let mut sg =SegmentTree::new(n);
    for _ in 0..m {
        let mut t = String::new();
        std::io::stdin().read_line(&mut t).unwrap();
        let x:Vec<usize>=t.trim().split_whitespace()
                    .map(|e|e.parse().unwrap()).collect();
        match x[0]{
            1 => println!("{}",sg.get_sum(x[1]-1, x[2]) ),
            0 => {
                let z=x[2] as i64;
                sg.add(x[1]-1, z);

            },
            _ => println!("{}",x[0]),
        }
    }
}


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

int main(){
    int a, b;
    cin >> a >> b;
    int ans = -1;
    for (int i = 0; i < 2000; i++){
        if (i*8/100 == a && i*10/100 == b){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
 
using namespace std;
typedef long long ll;
 
int main() {
	int N, K;
	cin >> N >> K;
	vector<bool> snack(N,false);
	for (int i = 0; i<K; i++){
		int d;
		cin >> d;
		for (int j = 0; j<d; j++){
			int tn; cin >> tn;
			snack[tn-1] = true;
		}
	}
	int ans = 0;
	for (int i = 0; i<N; i++){
		if (!snack[i]){
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define int 		  long long
#define	pb 			  push_back
#define all(a)		  (a).begin(),(a).end()
#define sz(x)		  (int)x.size()
#define endl	 	  "\n"
#define inf 		  1000000007
#define FOR(i, a, b)  for(int i=a; i<b; i++)

mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count()); 
#define SHUF(v) shuffle(all(v), RNG);
// Use mt19937_64 for 64 bit random numbers. 

//int dp[500005] = {0};

void solve(){
	char c;
	cin>>c;
	cout<<((char)((int)c+1));
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	//cin>>t;
	FOR(i, 1, t+1){	
	//	cout<<"Case #"<<i<<":"<<endl;
		solve();
	}
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
	return 0;
 
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	int ans = 0;
	map<int, int> m;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		m[a]++;
	}
	for (pair<int, int> t : m)
	{
		if (t.first < t.second)
			ans += t.second - t.first;
		else if (t.first > t.second)
			ans += t.second;
	}
	cout << ans << endl;

	return 0;
}


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

int gcd(int a,int b){
  if(b>a) gcd(b,a);
  return b ? gcd(b,a%b) : a;
}

vector<pair<ll,int>> factorize(ll n){
  vector<pair<ll,int>> res;
  for(ll i=2; i*i<=n; i++){
    if(n%i != 0) continue;
    res.emplace_back(i,0);
    while(n%i==0){
      n /= i;
      res.back().second++;
    }
  }
  if(n != 1) res.emplace_back(n,1);
  return res;
}
  

main(){
  ll i,a,b;
  int count=0;
  cin >> a >> b;
  auto f=factorize(min(a,b));
  for(i=0;i<f.size();i++){
    if((a%f[i].first==0)&&(b%f[i].first==0)) count++;
  }
  cout << count+1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
double dp[4000][4000];
int main()
{
	
	ll n;double p[4000];
	
	ll i,j;cin>>n;
	for(i=0;i<n;i++)
	cin>>p[i];
	
	for(i=0;i<=n;i++)
	{
		for(j=0;j<=n;j++)
		dp[i][j]=0;
	}
	dp[0][0]=1;
	for(i=0;i<=n;i++)
	{
		for(j=0;j<=n;j++)
		{
			dp[i+1][j]+=dp[i][j]*(1-p[i]);
			dp[i+1][j+1]+=dp[i][j]*p[i];
		}
	}
	double ans=0;
	for(i=n/2+1;i<=n;i++)
	ans+=dp[n][i];
	cout.precision(11);
	cout<<ans<<fixed;
}


Measured memory_bytes: 94208
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	auto& in = cin;
	long long a, b, c, d;
	in >> a >> b >> c >> d;
	vector<long long> vec;
	vec.push_back(a * c);
	vec.push_back(a * d);
	vec.push_back(b * c);
	vec.push_back(b * d);
	sort(vec.begin(), vec.end());
	cout << vec.back();

	return 0;
}


Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main(void){
    int x,y,z,n,cache;
    cin >> n;
    int a[n] = {};
    for(x=1;x<n;x++)
        for(y=1;y<n;y++)
            for(z=1;(x*x+y*y+z*z+x*y+y*z+z*x)<=n;z++){
                // cout << x*x+y*y+z*z+x*y+y*z+z*x << endl;
                a[x*x+y*y+z*z+x*y+y*z+z*x-1]++;
            }
    for(x=0;x<n;x++)
        cout << a[x] << endl;
    return 0;
}


Measured memory_bytes: 3556
#include<iostream>
#include<cstdio>

using namespace std;

const int maxn=1e4+5;
const int NIL=-1;

struct node{
    int parent,left,right;
};

node t[maxn];
int n;

void preparse(int u)
{
    if(u==NIL){
        return ;
    }
    printf(" %d",u);
    preparse(t[u].left);
    preparse(t[u].right);
}

void inparse(int u)
{
    if(u==NIL){
        return ;
    }
    inparse(t[u].left);
    printf(" %d",u);
    inparse(t[u].right);
}

void postparse(int u)
{
    if(u==NIL){
        return ;
    }
    postparse(t[u].left);
    postparse(t[u].right);
    printf(" %d",u);
}

int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        t[i].parent=NIL;
    }
    int v,l,r;
    for(int i=0;i<n;i++){
        scanf("%d%d%d",&v,&l,&r);
        t[v].left=l;
        t[v].right=r;
        if(l!=NIL){
            t[l].parent=v;
        }
        if(r!=NIL){
            t[r].parent=v;
        }
    }
    int root;
    for(int i=0;i<n;i++){
        if(t[i].parent==NIL){
            root=i;
            break;
        }
    }
    printf("Preorder\n");
    preparse(root);
    printf("\n");
    printf("Inorder\n");
    inparse(root);
    printf("\n");
    printf("Postorder\n");
    postparse(root);
    printf("\n");
    return 0;
}
/*
9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1
*/



Measured memory_bytes: 3204
#include<bits/stdc++.h>
#define fir first
#define sec second
#define db double
#define ll long long
#define ev eg[i].v
#define pb push_back
#define mod 1000000007
#define pir pair<ll,ll>
#define Rep(i,l,r) for(int i=(l);i<=(r);++i)
#define RepD(i,r,l) for(int i=(r);i>=(l);--i)
#define RepG(i,x) for(int i=hd[x];i;i=eg[i].nxt)
using namespace std;

const int N=95;

ll f[N];
vector<pir >a[N];

int main(){
	ll q,n,m;
	f[0]=f[1]=1;
	Rep(i,2,N-5) f[i]=f[i-1]+f[i-2];
	a[1].pb(pir(1,2)),a[1].pb(pir(1,3)),a[1].pb(pir(1,4));
	Rep(i,1,N-5)
		for(int j=0;j<a[i].size();++j){
			ll x=a[i][j].fir,y=a[i][j].sec;x+=y;
			while(x<=f[i+3]+f[i]) a[i+1].pb(pir(y,x)),x+=y;
		}
	scanf("%lld",&q);
	while(q--){
		ll ans=1,res=0;
		scanf("%lld%lld",&n,&m);
		if(n>m) swap(n,m);
		while(f[ans+1]<=n&&f[ans+2]<=m) ans++;
		if(ans==1) res=n*m%mod;
		else for(int i=0;i<a[ans-1].size();++i){
			ll x=a[ans-1][i].fir,y=a[ans-1][i].sec;
			if(y<=n) res=(res+(m-x)/y)%mod;
			if(y<=m) res=(res+(n-x)/y)%mod;
		}
		printf("%lld %lld\n",ans,res);
	}
	return 0;
}


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

using namespace std;

#ifdef DGC
#include "debug.h"
#else
#define debug(...) 9715
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ld> point;
#define F first
#define S second

const int N = 7;
vector<vector<int>> m(N, vector<int>(N));

int ch()
{
	vector<set<int>> r(N), c(N);
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N; ++j)
			if (m[i][j] != 0)
			{
				r[i].insert(m[i][j]);
				c[j].insert(m[i][j]);
			}
	for (auto &i : r) if (i.size() > 3) return -1;
	for (auto &i : c) if (i.size() > 3) return -1;
	int sz = r[0].size();
	bool ok = sz > 0;
	for (auto &i : r)
		ok &= i.size() == sz;
	for (auto i : c)
		ok &= i.size() == sz;
	return ok;
}

void f(int i, int j, int id)
{
	if (i >= N || j >= N) return;

	int x = ch();
	if (x < 0) return;
	if (x)
	{
		for (int i = 0; i < N; ++i)
		{
			for (int j = 0; j < N; ++j)
				cout << (char)(m[i][j]+'a'-1);
			cout << "\n";
		}
		cout << endl;
		cout << clock() * 1000 / CLOCKS_PER_SEC << endl;
		fflush(stdout);
		exit(0);
	}

	if (j+1 < N && !m[i][j] && !m[i][j+1])
	{
		m[i][j] = id;
		m[i][j+1] = id;
		if (j+2 == N) f(i+1, 0, id+1);
		else f(i, j+2, id+1);
		m[i][j] = 0;
		m[i][j+1] = 0;
	}

	if (i+1 < N && !m[i][j] && !m[i+1][j])
	{
		m[i][j] = id;
		m[i+1][j] = id;
		if (j+1 == N) f(i+1, 0, id+1);
		else f(i, j+1, id+1);
		m[i][j] = 0;
		m[i+1][j] = 0;
	}

	if (i+1 != N || j+1 != N)
	{
		if (j+1==N) f(i+1, 0, id);
		else f(i, j+1, id);
	}
}

vector<string> a5 =
{
	"aabbc",
	"dde.c",
	"ffegg",
	"..hij",
	"..hij"
};

vector<string> a4 =
{
	"abcc",
	"abdd",
	"eefg",
	"hhfg"
};

vector<string> a3 =
{
	"aa.",
	"..b",
	"..b"
};

vector<string> a6 =
{
	"aabbcc",
	"ddeeff",
	"ghi...",
	"ghi...",
	"...jkl",
	"...jkl"
};

vector<string> a7 =
{
	"aabbcc.",
	"ddeef..",
	"gg..fhh",
	"..ij..k",
	"..ij..k",
	"....lmn",
	"....lmn"
};

int main()
{
	#ifdef DGC
		//freopen("a.in", "r", stdin);
		//freopen("b.out", "w", stdout);
	#endif

	//ios_base::sync_with_stdio(0), cin.tie(0);

	// f(0, 0, 1);
	// return 0;

	int n;
	cin >> n;
	
	if (n == 2)
	{
		cout << "-1\n";
		return 0;
	}

	if (n == 3)
	{
		for (auto i : a3)
			cout << i << "\n";
		return 0;
	}

	vector<string> ans(n, string(n, '.'));
	int p = 0;
	int c = n / 4 - (n%4 != 0);
	while (c--)
	{
		for (int i = 0; i < 4; ++i)
			for (int j = 0; j < 4; ++j)
				ans[p+i][p+j] = a4[i][j];
		p += 4;
	}

	if (n%4 == 1)
	{
		for (int i = 0; i < 5; ++i)
			for (int j = 0; j < 5; ++j)
				ans[p+i][p+j] = a5[i][j];
	}

	if (n%4 == 2)
	{
		for (int i = 0; i < 6; ++i)
			for (int j = 0; j < 6; ++j)
				ans[p+i][p+j] = a6[i][j];
	}

	if (n%4 == 3)
	{
		for (int i = 0; i < 7; ++i)
			for (int j = 0; j < 7; ++j)
				ans[p+i][p+j] = a7[i][j];
	}

	for (auto i : ans)
		cout << i << "\n";

	return 0;
}


Measured memory_bytes: 2304