akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int getCnt(int n) {
    int ret = 0;
    REP(i, 1, n+1) {
        if(n%i == 0) ++ret;
    }
    return ret;
}

int main(){
    int n;
    cin >> n;
    int ans = 0;
    REP(i, 1, n+1) {
        if(i%2 == 1 && getCnt(i) == 8) {
            ++ans;
            // cout << i << endl;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

unordered_map<int, long long> dp;

long long dfs(vector<int>& num, int idx, int now, int target) {
    long long ans=0;

    auto itr=dp.find(idx*100+now);

    if(itr!=dp.end()) return itr->second;

    if((int)num.size()==idx) {
        if(now==target) return 1;
        else return 0;
    }

    if(now+num[idx]<=20) {
        ans+=dfs(num,idx+1,now+num[idx],target);
    }
    if(now-num[idx]>=0) {
        ans+=dfs(num,idx+1,now-num[idx],target);
    }

    return dp[idx*100+now]=ans;
}

int main()
{
    int N;
    int target;
    long long ans=0;

    vector<int> num;

    cin >> N;

    num.resize(N-1);

    for(int i=0; i<N-1; ++i) {
        cin >> num[i];
    }
    cin >> target;

    ans=dfs(num,1,num[0],target);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3148
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

double startTime;
double getCurrentTime() {
	return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}

const int INF = 1111;
const int N = 111;
char s[N][N];
int n, m;
int dp[N][N];

int main()
{
	startTime = (double)clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++)
		scanf("%s", s[i]);
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			dp[i][j] = INF;
	dp[0][0] = (s[0][0] == '.' ? 0 : 1);
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++) {
			if (i + 1 < n)
				dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + (int)(s[i][j] != s[i + 1][j]));
			if (j + 1 < m)
				dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + (int)(s[i][j] != s[i][j + 1]));
		}
	int ans = (dp[n - 1][m - 1] + 1) / 2;
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    long long x, y;
    cin >> x >> y;

    if(x > 0 && y > 0){
        if(x >= y){
            cout << 2 + x - y;
        }
        else{
            cout << y - x;
        }
    }
    else if(x < 0 && y > 0){
        if(abs(x) > y){
            cout << 1 - x - y;
        }
        else{
            cout << 1 + y + x;
        }
    }
    else if(x > 0 && y < 0){
        if(x > abs(y)){
            cout << 1 + x + y;
        }
        else{
            cout << 1 - y - x;
        }
    }
    else if(x < 0 && y < 0){
        if(y > x){
            cout << y - x;
        }
        else{
            cout << 2 - y + x;
        }
    }
    else{
        if(y > x){
            cout << y - x;
        }
        else{
            cout << 1 + x - y;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <functional>
using namespace std;
int main() {
	int n,k,ans = 0,a,s = 0;
	cin >> n >> k;
	vector<int> num(n,0);
	for (int i = 0; i < n;i++) {
		cin >> a;
		num[a - 1]++;
		if (num[a-1] == 1) {
			s++;
		}
	}
	sort(num.begin(),num.end(),greater<int>());	
	while(k < s) {
		ans += num[s-1];
		s--;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
n = int(input())
x = list(map(int, input().split()))
y = x[:]
y.sort()
medi1, medi2 = y[n//2-1], y[n//2]

for i in range(n):
	if x[i] <= medi1:
		print(medi2)
	else:
		print(medi1)


Measured memory_bytes: 25220
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())



void init() {

}

void input() {

}

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

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


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

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	int c = 0;
	int d = 0;
	int x = 0;
	int y = 0;
	for (int i = 1; i <= n; i++) {
		int j = i;
		x += j % 10;
		while (j / 10 >= 1) {
			j -= j % 10;
			j /= 10;
			x += j % 10;
		}
		if (a <= x && x <= b) {
			y += i;
		}
		x = 0;
	}
	cout << y << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#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 For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}
template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}
template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

int main(){
    int l,r,d;cin >> l >> r >> d;
    int ans = 0;
    for(int i=l;i<=r;++i){
        if(i%d==0) ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3616
#include<iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
#include <string>
#include<limits>
#include<cstdlib>
#include<functional>
#include<cassert>
#include <cstdio>
#include <stack>
#include <queue>
#include <map>
//#include <bits/stdc++.h>//atcoderでsqrtを使うときに必要
#define fi(p) for(int i=0;i<(p);i++)
#define ce(d) cout<<d<<endl;
#define ll long long
#define sorts(c) sort((c).begin(),(c).end());

using namespace std;

void solve() {
	int a, b, c;
	cin >> a >> b >> c;
	ce(c)
	ce(a)
	ce(b)
}

int main()
{
	solve();

	int a;//止める用
	cin >> a;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
a = [0 for _ in range(n)]
b = a[:]
for i in range(n):
    a[i],b[i] = map(int,input().split())
a.sort()
b.sort()

ans = 0
if n % 2 == 0:
    l = a[n//2-1] + a[n//2]
    h = b[n//2-1] + b[n//2]

    ans += h - l + 1
else:
    l = a[n//2]
    h = b[n//2]

    ans += h - l + 1



print(ans)

Measured memory_bytes: 25368
#include<bits/stdc++.h>
using namespace std;
int a[200005],b[200005],ans,n;
vector<int>ve;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)scanf("%d",&b[i]);
    long long tmp=0;
    for(int i=0;i<=29;i++){
        ve.clear();
        int mod=(1<<(i+1));
        for(int j=1;j<=n;j++)ve.push_back(b[j]%mod);
        mod/=2;
        sort(ve.begin(),ve.end());
        tmp=0;
        for(int j=1;j<=n;j++){
            int tmpl,tmpr;
            tmpl=lower_bound(ve.begin(),ve.end(),mod*1-a[j]%(mod*2))-ve.begin()-1;
            tmpr=lower_bound(ve.begin(),ve.end(),mod*2-a[j]%(mod*2))-ve.begin()-1;
            tmp+=tmpr-tmpl;
            tmpl=lower_bound(ve.begin(),ve.end(),mod*3-a[j]%(mod*2))-ve.begin()-1;
            tmpr=lower_bound(ve.begin(),ve.end(),mod*4-a[j]%(mod*2))-ve.begin()-1;
            tmp+=tmpr-tmpl;
        }
        if(tmp%2==1)ans=(1<<i)|ans;
    }
    printf("%d\n",ans);

}

Measured memory_bytes: 5784
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>

using namespace std;

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

class C{
	public:
	int x,y;
	C(int x,int y):x(x),y(y){}
	bool operator<(const C& test)const{
		if(x==test.x)return y>test.y;
		return x>test.x;
	}
	C(){}
};

C wood[3001];

bool ishav(int n, C test){
	return binary_search(wood,wood+n,test);
}


int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0)break;
		rep(i,n){
			int a,b;
			cin>>a>>b;
			
			wood[i] = C(a,b);
		}
		sort(wood,wood+n);
		
		int ans = 0;
		rep(i,n){
			reps(j,i+1,n){
				int dx = wood[i].x-wood[j].x;
				int dy = wood[i].y-wood[j].y;
				if(ishav(n,C(wood[i].x-dy, wood[i].y+dx)) && ishav(n, C(wood[j].x-dy, wood[j].y+dx))){
					ans = max(ans, dx*dx + dy*dy);
				}else if(ishav(n,C(wood[i].x+dy, wood[i].y-dx)) && ishav(n, C(wood[j].x+dy, wood[j].y-dx))){
					ans = max(ans, dx*dx + dy*dy);
				}
			}
		}
		
		cout<<ans<<endl;
	}
}

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

int main() {
  int A, B, K; cin >> A >> B >> K;
  for(int i=A; i<=min(A+K-1, B); i++){
    cout << i << endl;
  }
  if(A+K-1<B){
    for(int i=max(A+K, B-K+1); i<=B; i++){
      cout << i << endl;
    }
  }
}

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

int main(){
  int N, M; cin >> N >> M;
  vector<pair<int,int>> stu(N);
  vector<pair<int,int>> chp(M);
  for(int i=0;i<N;i++){
    cin >> stu.at(i).first >> stu.at(i).second;
  }
  for(int i=0;i<M;i++){
    cin >> chp.at(i).first >> chp.at(i).second;
  }
  vector<int> ans(N);
  for(int i=0;i<N;i++){
    int MIN=1e9;
    int ANS=M;
    for(int j=0;j<M;j++){
      int k;
      k=abs(stu.at(i).first-chp.at(j).first)+abs(stu.at(i).second-chp.at(j).second);
      if(MIN>k){
        ANS=j;
        MIN=k;
      }
    }
    ans.at(i)=ANS+1;
  }
  for(int i=0;i<N;i++){
      cout << ans.at(i) << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef  long long int ll;
#define len(x)           x.length()
#define pb                push_back
#define mp                make_pair
#define all(x)            (x).begin(),(x).end()
#define M                 1000000007
#define MM                998244353
#define ff                first
#define ss                second
#define pii               pair<int,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define GCD(x,y)          (__gcd((x), (y)))
#define LCM(x,y)          (((x)/__gcd((x), (y)))*(y))
#define mem0(x)           memset(x, 0, sizeof (x))
#define mem1(x)           memset(x, -1, sizeof (x))
#define IOS ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);

//coded by Avijit Mandal 

int main(){
   IOS;
   ll i,j,k,t1,t2,n,m;
 cin>>n;ll sum=0;
   if(n/500 !=0)sum+=1000*(n/500),n=n%500;
   if(n/5 !=0)sum+=5*(n/5);
   cout<<sum<<endl;
   



}


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

#define   M             100005
#define   ll            long long
#define   PI            atan(1.0)*4
#define   mst(x,v)      memset(x,v,sizeof(x))
#define   inf           (int)1e9

typedef   pair<int,int> P;

/*
int dfs(double x) {
	printf("%.0lf\n",x);
	double temp=ceil(log10(x));
	int i;
	for(i=9;i>=0;i--) {
		if( i*pow(10,temp)+x < n) {
			ans+=i;
			break;
		}
	}
	if(i==0) return ans;
	dfs(i*pow(10,temp)+x);
}
*/
ll ans,n,ans2,t2,ch,temp;
int main() {

	scanf("%lld",&n);
	if(n<10) printf("%lld\n",n);
	else{
		t2=n;
		while(t2) {
			ch=t2%10;
			t2/=10;
			ans2+=ch;
		}
		
		
		temp=ceil(log10(n));
		temp--;
		n/=pow(10,temp);
		printf("%lld\n",max(n-1+temp*9,ans2));
	}
}

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

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

int main(){
    ll A,V,B,W,T;
    cin>>A>>V;
    cin>>B>>W;
    cin>>T;
    ll dis=abs(A-B);
    if(W>=V) cout<<"NO"<<endl;
    else{
        if(dis<=T*(V-W)) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define int long long
#define INF 1000000000000000000
using namespace std;

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }
template<typename T>
void debug(vector<vector<T>> m){ REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;} }



signed main(){

    int N, K; cin >> N >> K;
    vec A(N); readv(A);

    int x = 0, ans = 0;
    IREP(i, 60){
        int M = -1, b;
        REP(t, 2){
            if(x + (t << i) > K) continue;
            int tmp = 0;
            REP(j, N) tmp += (t ^ ((A[j] >> i) & 1));
            //cout << t << "," << tmp << endl;
            if(tmp > M){
                M = tmp;
                b = t;
            }
        }
        x += (b << i);
        ans += (M << i);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))


min_diff = 10**5
min_i = 0
for idx, height in enumerate(H):
    temperature = T - 0.006*height
    diff = abs(temperature - A)
    if min_diff > diff:
        min_i = idx
        min_diff = diff

print(min_i+1)

Measured memory_bytes: 3064
### main

qn = gets.strip.to_i

qn.times do
  cn, an, nn = gets.strip.split(' ').map{|s| s.to_i}

  can_n = [cn, an, nn].min
  cn -= can_n
  an -= can_n
  nn -= can_n

  cca_n = [cn / 2, an].min
  cn -= cca_n * 2
  an -= cca_n

  ccc_n = cn / 3

  puts (can_n + cca_n + ccc_n)
end

Measured memory_bytes: 6104
a = int(input())
b = list("abcdefghijklmnopqrstuvwxyz")
c = [[0 for _ in range(a)]for _ in range(26)]
for i in range(a):
    d = input()
    for j in range(len(d)):
        for k in range(len(b)):
            if d[j] == b[k]:
                c[k][i] += 1
d = ""
for i in range(len(c)):
    d += b[i] * min(c[i])
print(d)


Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define rep(I,N) up(I,0,N-1)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<"\n";}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<"\n";}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<"\n";}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<"\n";}
inline void                                              out(ld p){printf("%.12Lf\n",p);}
template<class T>inline void outml(T p){for_each(all(p),out<decltype(p[0])>);}//ml=multi line
template<class T>inline void outol(T V){auto n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}//ol=one line
inline void solve(void){
  long double m=100.0;
  long X,y=0;
  in(X);
  while(1){
    if((long)m>=X){
      out(y);
      return;
    }
    m*=1.01;
    m=long(m);
    y++;
  }
}
int main(void){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 3612
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

ll cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
int main(void){
    int n, m;
    string s;
    cin >> n >> m >> s;
    reverse(all(s));

    int now = 0;
    vector<int> ans;
    while(now < n){
        int next = -1;
        //cout << now << endl;
        for(int i = m; i >= 1; i--){
            if(now + i > n) continue;
            if(s[now + i] != '1'){
                ans.push_back(i);
                next = now + i;
                break;
            }
        }
        if(next == -1){
            cout << -1 << endl;
            return 0;
        }
        now = next;
    }

    reverse(all(ans));
    rep(i, ans.size()){
        cout << ans[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1144
n, m = gets.chomp.split.map(&:to_i)
arr = Array.new(m, true)
n.times do 
	ngo = gets.chomp.split.map(&:to_i)
	ngo = ngo.slice(1,ngo.length-1)
	1.upto(m) do |i|
		arr[i-1] = false if ngo.index(i) == nil
	end
end
#p arr
puts arr.count{|a| a}


Measured memory_bytes: 14296
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const int MOD = 1e9 + 7;
using namespace std;
typedef long long ll;

map<ll, int> mp;
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	if (k == 1) cout << 0 << endl;
	else cout << n - k << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

// AtCoder
// #include <atcoder/all>
// using namespace atcoder;

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...)
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fls(x) (64 - __builtin_clzll(x))
#define pcnt(x) __builtin_popcountll(x)
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a; cin >> a; cout << 1 - a << "\n";
    /***************************************************/
    /* Submit this code from the browser if using ACL! */
    /***************************************************/
    return 0;
}

Measured memory_bytes: 3612
//long time no ac
#include<bits/stdc++.h>
using namespace std;


#define 	SPEED 		ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define 	ll          long long int
#define 	pb          push_back
#define		endl		'\n'
#define 	pii         pair<int,int>
#define 	vi          vector<int>
#define 	vll         vector<ll>
#define 	all(a)      (a).begin(),(a).end()
#define 	sz(x)       (ll)x.size()
#define 	hell        1000000007
#define 	rep(i,n)	for(i=0;i<n;i++)
#define 	repe(i,a,b)	for(i=a;i<b;i++)
#define 	lbnd        lower_bound
#define 	ubnd        upper_bound
#define 	bs          binary_search
#define 	mp          make_pair


int main()
{
	SPEED;
	ll n,k,t,c=0,i,cs=0;
	t=1;

	//cin>>t;
	string s;
	while(t--)
	{
		cin>>s;

		rep(i,s.length())
		{
			if(s[i]=='W')
			{
				c+=(i-cs);
				cs++;
			}
		}
		
		cout<<c;
		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 720
# O(log(B))で求める場合

import math

# f(x) = 0からxまでのxor
def f(x):
    if x <= 0:
        return 0
    x += 1
    digit = math.ceil(math.log2(x)) + 1

    ret = 0
    for d in range(digit):
        loop = 1 << (d + 1)
        count = (x // loop) * (loop // 2)
        count += max(0, x % loop - loop // 2)

        if count % 2 == 1:
            ret += 1 << d
    return ret



A, B = map(int, input().split())
print(f(A - 1) ^ f(B))


Measured memory_bytes: 3064
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
counter = Counter(A)
B = [1] * (max(A) + 1)
for a in A:
    for k in range(a  * 2,len(B),a):
            B[k] = 0
print(sum(B[a] == 1 and counter[a] == 1 for a in A))


Measured memory_bytes: 38360
#include <iostream>
#include<stdio.h>
#include<map>
#include<vector>
using namespace std;
int main() {
	int a;
	map<string,int> cnt;
	char ch;
	string blood;
	cnt["A"]=0;cnt["B"]=0;cnt["AB"]=0;cnt["O"]=0;
	vector<int> bo(51,false);
	while(cin>>a>>ch>>blood){
		if(bo[a])continue;
		bo[a]=true;
		cnt[blood]++;
	}
	cout<<cnt["A"]<<endl<<cnt["B"]<<endl<<cnt["AB"]<<endl<<cnt["O"]<<endl;
	return 0;
}


Measured memory_bytes: 3100
N, M = map(int, input().split())
K = []; S = []
for _ in range(M):
    k, *s = map(int, input().split())
    K.append(k); S.append(s)
P = list(map(int,input().split()))

ans = 0
for i in range(2**N):
    flag = 0
    stat = str(bin(i)[2:])
    stat = stat.rjust(N, "0")
    for j in range(M):
        p = 0
        for l in S[j]:
            p += int(stat[l-1])
        if p % 2 != P[j]:
            flag = 1
    if flag == 0:
        ans += 1

print(ans)


Measured memory_bytes: 42092
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
if (A[0]-B[0] == A[1]-B[1] and A[0]-B[0] == A[2]-B[2]):
    F=0
else:
    F=1
if F == 1:
    print ('No')
else:
    if (A[0]-C[0] == A[1]-C[1] and A[0]-C[0] == A[2]-C[2]):
        F=0
    else:
        F=1
    if F == 1:
        print ('No')
    else:
        if (A[0]-A[1] == B[0]-B[1] and A[0]-A[1] == C[0]-C[1]):
            F=0
        else:
            F=1
        if F == 1:
            print('No')
        else:
            if (A[0]-A[2] == B[0]-B[2] and A[0]-A[2] == C[0]-C[2]):
                F=0
            else:
                F=1
            if F == 1:
                print('No')
            else:
                print('Yes')


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
  long long a,b,c;
  cin >> a >> b >> c;

  if(a % 2 == 1 || b % 2 == 1 || c % 2 == 1) {
    cout << "0" << endl;
    return 0;
  }

  if(a == b && b == c) {
    cout << "-1" << endl;
    return 0;
  }

  long long count = 0;
  long long tmp_a,tmp_b,tmp_c;
  while(true) {
    tmp_a = a;
    tmp_b = b;
    tmp_c = c;
    a = tmp_b/2 + tmp_c/2;
    b = tmp_c/2 + tmp_a/2;
    c = tmp_a/2 + tmp_b/2;
    count++;
    if(a % 2 == 1 || b % 2 == 1 || c % 2 == 1) break;
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long


void solve(long long N, std::vector<long long> A){
    multiset<int> st;
    for(int i = N - 1; i >= 0;  --i) {
        auto it = st.upper_bound(A[i]);

        if (it != st.end()) {
            st.erase(it);
        }
        st.insert(A[i]);
    }
    cout << st.size() << endl;
}

signed main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 5760
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 5e1 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	vector<int> vx, vy;
	vector<pair<int, int>> vp;
	int n, k;
	cin >> n >> k;
	for (int i = 0; i < n; i++)
	{
		int x, y;
		cin >> x >> y;
		vx.push_back(x);
		vy.push_back(y);
		vp.emplace_back(x, y);
	}
	LL ans = 4 * INF * INF;
	sort(vx.begin(), vx.end());
	sort(vy.begin(), vy.end());
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			for (int s = 0; s < n; s++)
			{
				for (int t = s + 1; t < n; t++)
				{
					int lx = vx[i], rx = vx[j];
					int ly = vy[s], ry = vy[t];
					int sum = 0;
					for (auto &p : vp)
					{
						if (p.first >= lx && p.first <= rx && p.second >= ly && p.second <= ry) sum++;
					}
					if (sum >= k)
					{
						ans = min(ans, 1LL * (rx - lx)*(ry - ly));
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <deque>
using namespace std;

int main() {
    int K;
    int cnt = 0;

    deque <string> que;
    vector <string> ans;

    for (char ch = '1'; ch <= '9'; ++ch) {
        string str;
        str += ch;
        que.push_back(str);
        ans.push_back(str);
        ++cnt;
    }

    cin >> K;

    while (!que.empty() && cnt < K) {
        string str = que.front();
        que.pop_front();

        for (char ch = '0'; ch <= '9'; ++ch) {
            if (abs(ch - str[str.size()-1]) <= 1) {
                string news = str + ch;
                que.push_back(news);
                ans.push_back(news);
                ++cnt;
            }
        }
    }

    cout << ans[K-1] << endl;

    return 0;
}

Measured memory_bytes: 7412
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	ll k,n;
	cin >> k >> n;
	vector <ll> a(n);
	for(ll i =0; i< n;i++) {
		cin >> a[i];
	}
	vector <ll> b(n);
	for(ll i =1; i< n;i++) {
		b[i-1] = a[i] - a[i-1];
	}
	
	b[n -1] =a[0] +(k - a[n -1]);


	ll m = 0 ;
	ll maxVal = 0;
	for(ll i =0; i< n;i++) {
		m = max(m,b[i]);
		if (m == b[i]) {
			maxVal = i;
		}
	}
	ll ans =0;
	for(ll i =0; i< n;i++) {
		if (i != maxVal) {
		ans += b[i];
		}
	}

	cout << ans << endl; 
}


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

using namespace std;

int main()
{
    #ifdef HOME
        freopen("input.txt", "rt", stdin);
    #endif // HOME
    int n;
    cin >> n;
    int a = n / 10;
    int b = n % 10;
    if (a == 9 || b == 9)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double

int main(void){
	int N; cin >> N;
	vector<bool> ok(N, false);
	for (int i = 0; i < N; ++i){
		int d1, d2; cin >> d1 >> d2;
		ok[i] = d1 == d2;
	}
	for (int i = 2; i < N; ++i){
		if (ok[i] && ok[i - 1] && ok[i - 2]){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

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

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)
#define EREP(i,n,m) for(int i=n;i<=m;i++)
#define erep(i,n) EREP(i,0,n)

typedef pair<int,int> P;

unsigned int dp[101][101];

int main(void){
  int n; cin>>n;
  vector<P> v(n);
  rep(i,n) cin>>v[i].first>>v[i].second;

  erep(i,n){
    erep(j,n) dp[i][j] = INT_MAX;
    dp[i][i] = 0;
  }

  REP(i,1,n){ //???????±????
    EREP(j,0,n-i){ //????§???????????±????
      REP(k,j,j+i){ //????????????????±????
        int cost = v[j].first * v[k].second * v[k+1].first * v[j+i].second;
        dp[j][j+i] = min(dp[j][j+i],cost+dp[j][k]+dp[k+1][j+i]);
      }
    }
  }

  cout<<dp[0][n-1]<<endl;

  return 0;
}

Measured memory_bytes: 1220
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define pb push_back
#define bug cout<<"BUG"
#define MAX 1000000007
#define nln cout<<"\n"
#define File_Input freopen("input.txt", "r", stdin)
#define File_Output freopen("output.txt", "w", stdout);
//bool mp[64000001];

int main(){
    fastio;
    ll t, ans;
    cin>>t;

    ll a[t+1], c[t+1] = {0};
    for(ll i=1; i<=t; i++){
      cin>>a[i];
      c[i] = c[i-1]+a[i];
    }
    ll x = a[1]%MAX * a[2]%MAX;
    x  = x%MAX;
    ans = x;
    for(ll i=3; i<=t; i++){
      ll temp = c[i-2]%MAX * abs(a[i]-a[i-1])%MAX;
      temp = temp%MAX;

      if(a[i]>a[i-1]){
        x = x + temp;
        x = x%MAX;
      }else{ //if(a[i]<a[i-1]){
        x = x - temp + MAX;
        x = x%MAX;
      }
      ll z = a[i]%MAX * a[i-1]%MAX;
      z = z%MAX;
      x += z;
      x = x%MAX;
      ans += x;
      ans = ans%MAX;


    }

    cout<<ans;

}


























Measured memory_bytes: 6748
using System;
using System.Collections.Generic;

class Program {
    const int mod = 1000000007;

    static void Main() {
#if USE_IDE
        var exStdIn = new System.IO.StreamReader("./../../TestStdin.txt");
        Console.SetIn(exStdIn);
#endif
        var n = int.Parse(Console.ReadLine());
        List<Food> foods = new List<Food>();
        for (int i = 0; i < n; i++) {
            var ints = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            foods.Add(new Food() {t = ints[0], a = ints[1], sum = ints[0] + ints[1]});
        }

        foods.Sort((a, b) => b.sum - a.sum);

        long ans = 0;
        for (int i = 0; i < n; i++) {
            if (i % 2 == 0) {
                ans += foods[i].t;
            } else {
                ans -= foods[i].a;
            }
        }

        Console.WriteLine(ans);
    }

    class Food {
        public int t;
        public int a;
        public int sum;
    }
}

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

using namespace std;


int main () {


	int n;
	scanf("%d", &n);

	vector <int> a (n + 1);

	for (int i = 1; i <= n; ++i) {
		int x; scanf("%d", &x);
		a[x] = i;
	}

	for (int i = 1; i <= n; ++i) {
		printf ("%d%c", a[i], (i == n ? '\n' : ' '));
	}

	return 0;
}





Measured memory_bytes: 1152
#include<iostream>
using namespace std;
int main() {
	int room[5][4][11];//部屋番号
	int b = 0, f = 0, r = 0, v = 0;//情報
	int n;//情報の数
	cin >> n;
	//初期化
	for (int i = 0; i <5; i++)
	{
		for (int j = 0; j < 4; j++)
		{
			for (int ii = 0; ii < 11; ii++)
			{
				room[i][j][ii] = 0;
			}
		}
	}
	//入力
	for (int i = 0; i < n; i++)
	{
		cin >> b >> f >> r >> v;
		room[b][f][r] += v;
	}
	//１棟出力
	for (int ii = 1; ii <=4; ii++)
	{
		for (int i = 1; i <= 3; i++)
		{
			for (int j = 1; j <= 10; j++)
			{
				cout << " " << room[ii][i][j];
			}
			cout << endl;
		}
		if (ii==4)
		{
			break;
		}
		cout << "####################\n";
	}
}


Measured memory_bytes: 3096
import java.util.ArrayDeque;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		char s[] = in.next().toCharArray();
		char t[] = in.next().toCharArray();
		in.close();

		int row = t.length;
		int col = s.length;
		int tb[][] = new int[row + 1][col + 1];
//		for ( int i = 0; i <= row; i++ )
//			tb[i][0] = 0;
//		for ( int i = 0; i <= col; i++ )
//			tb[0][i] = 0;

		for ( int r = 0; r < row; r++ ) {
			for ( int c = 0; c < col; c++ ) {
				if ( t[r] == s[c] ) {
					tb[r + 1][c + 1] = tb[r][c] + 1;
				} else {
					tb[r + 1][c + 1] = Math.max(tb[r + 1][c], tb[r][c + 1]);
				}
			}
		}

		int r = row;
		int c = col;
		ArrayDeque<Character> stack = new ArrayDeque<Character>();
		stack.add(' ');
		while ( tb[r][c] != 0 ) {

			// 左上に行けるとき
			if ( tb[r - 1][c - 1] == tb[r][c] ) {
				r -= 1;
				c -= 1;
			} else
			// 上にだけ行けるとき
			if ( tb[r - 1][c] == tb[r][c] ) {
				r -= 1;
			} else
			// 左にだけ行けるとき
			if ( tb[r][c - 1] == tb[r][c] ) {
				c -= 1;
			} else
			// 行き止まり
			{
				stack.add((Character) s[c - 1]);
				r -= 1;
				c -= 1;
			}
		}

		while ( stack.size() > 0 ) {
			System.out.print(stack.pollLast());
		}
	}
}


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

vector<long long int> init() {
	vector<bool>prime( 50001, 1 );
	vector<long long int>ret;
	prime[0] = 0;
	prime[1] = 0;
	for( size_t i = 2; i <= sqrtl( 50001 ); i++ ) {
		if( prime[i] ) {
			int j = 1;
			while( i*++j < 50001 ) {
				prime[i*j] = 0;
			}
		}
	}
	for( size_t i = 0; i < 50001; i++ ) {
		if( prime[i] ) {
			ret.emplace_back( i );
		}
	}
	return ret;
}

int main() {
	auto prime = init();
	vector<long long int>ans( 50001 );
	for( size_t i = 0; i < prime.size(); i++ ) {
		for( size_t j = i; j < prime.size(); j++ ) {
			if( prime[i] + prime[j] < 50001 ) {
				ans[prime[i] + prime[j]]++;
			}
		}
	}
	long long int N;
	while( cin >> N, N ) {
		cout << ans[N] << endl;
	}
}

Measured memory_bytes: 3196
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mpp make_pair
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    fast;
    ll n,x,t;
    cin>>n>>x>>t;
    if(n%x==0)
    {
        cout<<(n/x)*t<<endl;
    }
    else
    {
       cout<<((n/x)+1)*t<<endl;
    }

}


Measured memory_bytes: 3640
def check(x, y):
    return 0 <= x <= 9 and 0 <= y <= 9


def small(x, y, area):
    if check(x+1, y):
        area[x+1][y] += 1
    if check(x, y+1):
        area[x][y+1] += 1
    if check(x-1, y):
        area[x-1][y] += 1
    if check(x, y-1):
        area[x][y-1] += 1
    area[x][y] += 1
    return area


def mediam(x, y, area):
    area = small(x, y, area)
    if check(x+1, y+1):
        area[x+1][y+1] += 1
    if check(x+1, y-1):
        area[x+1][y-1] += 1
    if check(x-1, y+1):
        area[x-1][y+1] += 1
    if check(x-1, y-1):
        area[x-1][y-1] += 1
    return area


def large(x, y, area):
    area = mediam(x, y, area)
    if check(x+2, y):
        area[x+2][y] += 1
    if check(x, y+2):
        area[x][y+2] += 1
    if check(x-2, y):
        area[x-2][y] += 1
    if check(x, y-2):
        area[x][y-2] += 1
    return area

area = [[0 for i in range(10)] for j in range(10)]

while True:
    try:
        x, y, s = map(int, input().split(','))
    except:
        break

    if s == 1:
        area = small(x, y, area)
    if s == 2:
        area = mediam(x, y, area)
    if s == 3:
        area = large(x, y, area)

max = 0
cnt = 0

for i in range(10):
    for j in range(10):
        if area[i][j] == 0:
            cnt += 1
        if area[i][j] > max:
            max = area[i][j]
print(cnt)
print(max)

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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, m;
  std::cin >> n >> m;
  std::vector<std::set<int64_t>> k(m);
  for (auto &i : k) {
    int64_t j;
    std::cin >> j;
    for (int64_t k = 0; k < j; k++) {
      int64_t s;
      std::cin >> s;
      i.insert(s - 1);
    }
  }
  std::vector<int64_t> p(m);
  std::cin >> p;

  int64_t count = 0;

  for (int64_t i = 0; i < (1 << n); i++) {
    std::vector<int64_t> f(n);
    bool flag = true;
    for (int64_t j = 0; j < n; j++) {
      if (((1 << j) & i) == 0) {
        f[j] = 0;
      } else {
        f[j] = 1;
      }
      //  std::cout << f[j] << ",";
    }
    // std::cout << ":" << std::endl;
    for (int64_t j = 0; j < m; j++) {
      int64_t v = 0;
      for (const auto h : k[j]) {
        v += f[h];
      }
      //      std::cout << v << std::endl;
      v %= 2;
      if (v != p[j]) {
        flag = false;
      }
    }
    if (flag) {
      count++;
    }
  }

  std::cout << count << std::endl;

  return 0;
}


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

vector<int> a(5);

int main() {
	rep(i,5) cin >> a[i];
	sort(a.rbegin(), a.rend());
	rep(i,5) cout << a[i] << (i==4 ? '\n' : ' ');
}


Measured memory_bytes: 3096
MOD = 10**9 + 7
def main():
    n, m = map(int, input().split())
    s = list(map(int, input().split()))
    t = list(map(int, input().split()))
    dp = [[0]*(m+1) for _ in range(n+1)]
    for si in range(1, n+1):
        for ti in range(1, m+1):
            if s[si-1] == t[ti-1]:
                dp[si][ti] += 1
                dp[si][ti] += dp[si-1][ti-1]
            dp[si][ti] += dp[si-1][ti] + dp[si][ti-1]
            dp[si][ti] -= dp[si-1][ti-1]
            dp[si][ti] %= MOD
    print(dp[n][m] + 1)
#    for i in range(n+1):
#        print(dp[i])

if __name__ == "__main__":
    main()


Measured memory_bytes: 72284
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <deque>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define ctoi(c) c - '0'
#define tos(s) to_string(s)

typedef long long ll;


int main() {
    ll a;
    double b;
    cin >> a >> b;
    cout << a * ll(b*100+0.01) / 100 << endl;
    return 0;
}

/*
ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC                                                                              
                                   ******,  .,, .,, ,,,    ****.**              
                                   ** . .,,,,,,,,,,,,,,,,,,,,,. .,*             
                                   **,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.            
                                .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.        
                                .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.        
                    ****      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,      
              ***************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,    
         ********************,,,,,,,,,,,,,,@@@,,,,,,,,,,,/@@@,,,,,,,,,,,,,,,    
        ******************,,,,,,,,,,,,,,,,,,(,,.         ,,,,,,,,,,,,,,,,,,,    
       ********************,,,,,,,,,,,*,,,,,.     %&&&     .,,,,*,,,,,,,,,,,,.  
       ***,,,,,,,,,,,,,,*,,,,,,,,,,,,,,,,,,,,               ,,,,,,,,,,,,,,,,,   
       ,,,,,,,,,,,,,,,,,,,**,,,,,,,,,,.......      ##(     ........,,,,,,,,,,.  
     .,,,,,,,,,,,,,,,,,,**,,,,,,,,,,..............    ..............,,,,,,,,    
    .,,,,,,,,,,,,,,,,,,,**,,,,,,,,,.................................,,,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,***,,,,,,,....................................,,,,,,,,,  
   ,,,,,,,,,,,,,,,,,,,,**,,,,,,,,.....................................,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,,**,,,,,,,,....................................,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.....................................,,,,,     
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...................................,.,,,,,     
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,.....................................,,,        
     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................................,,,        
      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,...................................,          
       ..,,,,,,,,,,,,,,,,,,,,,,,,,,.................................,           
       .........**.....       ,,,,,..............................               
        .......*......                  ****,**,       ,..****                  
        .......*,....                   .......        ......                   
          .......*....                   .....          .....                   
                                         ......          .....                  
*/

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

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main(){
    int x[26] = {};
    string s;
    cin >> s;
    for (char c : s) x[c - 'a'] = 1;

    REP(i,26){
        if (x[i] == 0){
            cout << (char)('a' + i) << endl;
            return 0;
        }
    }
    cout << "None" << endl;

    return 0;
}

Measured memory_bytes: 512