akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

signed main() {
  ll N, M;
  cin >> N >> M;
  vector<vll> S;
  rep(i, M) {
    ll k;
    cin >> k;
    vll temp;
    rep(j, k) {
      ll s;
      cin >> s;
      s--;
      temp.pb(s);
    }
    S.pb(temp);
  }

  vll P(M);
  rep(i, M) {
    cin >> P[i];
  }

  ll sum = 0;
  rep(bit, powl(2, N)) {
    string bits = bitset<11>(bit).to_string();
    REVERSE(bits);
    // debug(bits);

    bool flag = true;
    rep(i, M) {
      vll s = S[i];
      ll count = 0;
      for (ll ss : s) {
        // debug(ss);
        if (bits[ss] == '1') {
          count++;
        }
      }
      // debug(i);
      // debug(count);
      if (count % 2 != P[i]) {
        flag = false;
        break;
      }
    }

    if (flag) {
      sum++;
    }
  }
  COUT(sum);

  return 0;
}

Measured memory_bytes: 640
from collections import deque
n, queries = map(int, input().split())
L = [deque() for _ in range(n)]

for _ in range(queries):
    q, *list_num = input().split()
    if q == '0':
        t = int(list_num[0])
        x = int(list_num[1])
        L[t].append(x)
    elif q == '1':
        t = int(list_num[0])
        print(*L[t])
    elif q == '2':
        s = int(list_num[0])
        t = int(list_num[1])
        if not L[s]:
            continue
        if L[t]:
            if len(L[s]) == 1:
                L[t].append(L[s][0])
            elif len(L[t]) == 1:
                L[s].appendleft(L[t][0])
                L[t] = L[s]
            else:
                L[t].extend(L[s])
        else:
            L[t] = L[s]
        L[s] = deque()


Measured memory_bytes: 30676
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}



int main() {
	while (1) {
		int n;
		cin >> n;
		if (n == 0) break;
		vi x(n, 0);
		vi y(n, 0);
		for (int i = 1; i < n; i++) {
			int a, b;
			cin >> a >> b;
			x[i] = x[a];
			y[i] = y[a];
			if (b == 0) {
				x[i]--;
			}
			else if (b == 1) {
				y[i]--;
			}
			else if (b == 2) {
				x[i]++;
			}
			else if (b == 3) {
				y[i]++;
			}
		}
		int minx = *min_element(all(x));
		int miny= *min_element(all(y));
		int maxx= *max_element(all(x));
		int maxy= *max_element(all(y));
		cout << maxx - minx + 1 << " " << maxy - miny + 1 << endl;
	}
}



Measured memory_bytes: 2972
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;


int main() {
  int n, k, m;
  long double ans = 0.0;
  cin >> n >> k;
  
  int win =0;
  
  for (int i=1; i<=n; i++) { // サイコロi
    double dm = log2((double)k/(double)i); // log2 (k/i) m回連続で表で勝ち

    if(dm<=0) { // no coin, win
      win += 1;
    } else {
      if(dm==(int)dm) m = (int)dm;
      else m = (int)dm + 1.0;
      
      ans += 1/pow((long double)2.0, (long double)m);
    }
  }
  ans /= n;
  ans += ((long double)win)/n;
  
  cout << setprecision(11) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>


int main( void )
{
	int N ;
	while( scanf( "%d" ,&N ) != EOF )
	{
		long cnt[ 4 + 1 ][ 50 + 1 ] = { 1 } ;

		int i ,j ,k ;
		for( i = 1 ; i <= 4 ; ++i )
		{
			for( j = 0 ; j <= N ; ++j )
			{
				if( cnt[ i - 1 ][ j ] > 0 )
				{
					for( k = 0 ; k <= 9 ; ++k )
					{
						if( j + k < 50 + 1 )
						{
							cnt[ i ][ j + k ] += cnt[ i - 1 ][ j ] ;
						}
					}
				}
			}
		}

		printf( "%ld\n" ,cnt[ 4 ][ N ] ) ;
	}

	return 0 ;
}


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

int main(){
  
  int N, K;
  cin >> N >> K;
  double p[200000];
  rep(i, N) cin >> p[i];
  
  rep(i, N) p[i] = p[i]/2.0 + 0.5;
  
  double sum = 0;
  rep(i, K) sum += p[i];
  double ans = sum;
  
  rep(i, N-K){
    sum -= p[i];
    sum += p[K+i];
    if(sum > ans) ans = sum;
  }
  
  cout << fixed << setprecision(6);
  cout << ans << endl;
  
}

Measured memory_bytes: 1792
#define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){

	int l;
	
	while(cin>>l,l!=0){
		int m,n;
	bool f=false;
	int g=0;
	for(int i=0;i<12;i++){
		cin>>m>>n;
		l=l-(m-n);
		if(l<=0&&!f){
			f=true;
			g=i+1;
		}
	}
		if(!f)
			cout<<"NA"<<endl;
		else
			cout<<g<<endl;
	}

}

Measured memory_bytes: 1160
import sys

input = sys.stdin.readline

n, l = list(map(int, input().split()))

t = (l//2) - n
c = (l//2) - (2*t)

if l % 2 == 1:
    print("No")
elif t < 0 or c < 0:
    print("No")
elif t > n or c > n:
    print("No")
elif t + c != n:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 9156
# -*- coding: utf-8 -*-
import numpy as np
def inpl(): return list(map(int, input().split()))
N, M, C = inpl()
B = np.array(inpl(), dtype=np.int64)
ans = 0
for _ in range(N):
    A = np.array(inpl(), dtype=np.int64)
    ans += np.sum(A*B)+C > 0
print(ans)


Measured memory_bytes: 27272
#include <bits/stdc++.h>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define REP1(i, n) for(ll i = 1; i <= n; i++)
#define REPR1(i, n) for(ll i = n; i >= 1; i--)
#define FOR1(i, m, n) for(ll i = m; i <= n; i++)
const ld INF = 1e9+123;
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin(), v.end()
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}

int main(){
    ll N;
    string t;
    cin>>N>>t;
    REP(i,t.length()){
        if(int(t[i])+N>90)t[i]=t[i]-(26-N);
        else t[i]=t[i]+(N);
    }
    
    cout<<fixed<<setprecision(10)<<t;
    //cout<<fixed<<setprecision(32)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  
  int W , H , x , y , r;
  
  scanf ("%d %d %d %d %d" , &W, &H , &x , &y , &r);
  
  if (x - r >= 0 && y - r >= 0 && x + r <= W && y + r <= H){
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  
  return 0;
}

Measured memory_bytes: 584
import sys
n = int(input()) 
i = 0 
j = 0
while(i < 100):
    j = 0
    while(j < 100):
        if 7* i + 4 * j == n:
            print("Yes")
            sys.exit()
        j+= 1
        
    i+= 1

print("No")


Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
	int n,k,d,a,i,j,cnt,flg[101]={0};
	scanf("%d %d",&n,&k);
	for(i=0;i<k;i++){
		scanf("%d",&d);
		for(j=0;j<d;j++){
			scanf("%d",&a);
			flg[a]=1;
		}
	}
	for(i=1;i<=n;i++){
		if(flg[i]==0){
			cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 1732
#include <stdio.h>

int main(void){
  	int h, w, H, W, ans;
  
  	scanf("%d %d",&H, &W);
  	scanf("%d %d",&h, &w);
	ans = H * W - w * H - (W - w) * h;
  	printf("%d", ans);
  	return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()
 
 
int main() {
  int a, b;
  cin >> a >> b;
  if(a * b % 2) cout << "Odd" << endl;
  else cout << "Even" << endl;
}

Measured memory_bytes: 256
/* ex5_3
   urah    */

#include <stdio.h>
#include<stdlib.h>

// 最大値
#define ROW 101
#define COL 101


int main(void){
    int height, width;
    int row[ROW] = {0};
    int col[COL] = {0};
    char matrix[ROW][COL];

    // 入力受け取り
    scanf("%d\t%d", &height, &width);

    // マス目の入力を受け取っていく
    for (int i=0; i < height; i++){
        for (int j=0; j < width; j++){
            scanf(" %c", &matrix[i][j]);
        }
    }

    // 黒いマスがある行または列は1にする
    for (int i=0; i < height; i++){
        for (int j=0; j < width; j++){
            if (matrix[i][j] == '#'){
                row[i] = 1;
                col[j] = 1;
            }
        }
    }

    // 行も列も1であれば出力
    for (int i=0; i < height; i++){
        if (row[i] == 1){
            for (int j=0; j < width; j++){
                if (col[j] == 1){
                    printf("%c", matrix[i][j]);
                }
            }
            printf("\n");
        }
    }

    return 0;
}

Measured memory_bytes: 128
<?php
  # めんどくせぇしどうせPHPなので果敢にevalを使う（evil <- PHPのevalが意味不明な挙動しやがるので諦めて愚直にやる
  $number = array_map("intVal", str_split(trim(fgets(STDIN))));
  $op = ["+", "-"];
  foreach($op as $x){
    foreach($op as $y){
      foreach($op as $z){
        // PHPのevalがなんか意味不明な挙動をしやがる
        // # $ans = "$number[0] $x $number[1] $y $number[2] $z $number[3]";
        // # echo "ans = $ans, sum = " . eval($ans) . PHP_EOL;
        // echo eval("return " . $ans . ";") . PHP_EOL;
        // ので諦める
        $ans = 0;
        if($x=="+"){
          $ans += ($number[0]) + ($number[1]);
        }else{
          $ans += ($number[0]) - ($number[1]);
        }
        if($y=="+"){
          $ans += ($number[2]);
        }else{
          $ans -= ($number[2]);
        }
        if($z=="+"){
          $ans += ($number[3]);
        }else{
          $ans -= ($number[3]);
        }
        if($ans == 7){
          echo "${number[0]}${x}${number[1]}${y}${number[2]}${z}${number[3]}" . "=7" . PHP_EOL;
          exit();
        }
      }
    }
  }
?>

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

grid = []

for _ in range(50):
    grid.append(["#"]*100)
for _ in range(50):
    grid.append(["."]*100)
    
for i in range(A-1):
    grid[2*(i//50)][(i*2)%100] = "."

for i in range(B-1):
    grid[99 - 2*(i//50)][(i*2)%100] = "#"
    
print("100 100")
for i in grid:
    p = "".join(i)
    print(p)

Measured memory_bytes: 3064
#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 pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n;
    cin >> n;
    VI x(n), y(n);
    REP(i,n) cin >> x[i] >> y[i];
    if (n % 2){
        cout << "NA" << endl;
        return 0;
    }
    int xa = x[0]+x[n/2], ya = y[0]+y[n/2];
    bool f = 1;
    REP(i,n/2){
        if (x[i]+x[n/2+i] != xa || y[i]+y[n/2+i] != ya) f = 0;
    }
    if (f) printf("%.10f %.10f\n", xa/2.0, ya/2.0);
    else cout << "NA" << endl;
    return 0;
}

Measured memory_bytes: 3192
#include <stdio.h>

void pri(int x)
{
	int j;
	for (j=0;j<x+2;j++)
		printf("#");
	printf("\n");
}

int main()
{

	int h, w, i, j;
	char str[100][100];
	while (scanf("%d %d", &h, &w)!=EOF) {
		for (i=0;i<h;i++) {
			getchar();
			for (j=0;j<w;j++)
			{
				scanf("%c", &str[i][j]);
			}
		}
		
		pri(w);
		for (i=0;i<h;i++) {
			printf("#");
			for (j=0;j<w;j++) {
				printf("%c", str[i][j]);
			}
			printf("#\n");
		}
		pri(w);
	}
	return 0;
}


 

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=9000000009;


signed main(){
  int n,m;
  while(cin>>n>>m,n){
    vector<int> taro(n),hana(m);
    int t=0,h=0;
    REP(i,n){
      cin>>taro[i];
      t+=taro[i];
    }
    REP(i,m){
      cin>>hana[i];
      h+=hana[i];
    }
    vector<pair<int,pair<int,int>>> ans;
    bool f=false;
    bool odd=(abs(t-h)%2==1?true:false);
    if(t>=h){
      int tmp=(t-h)/2;
      REP(i,n){
        REP(j,m){
          if(taro[i]-tmp==hana[j]){
            //cout<<i<<' '<<j<<endl;
            ans.PB(MP(taro[i]+hana[j],MP(taro[i],hana[j])));
            f=true;
          }
        }
      }
    }else{
      int tmp=(h-t)/2;
      REP(i,m){
        REP(j,n){
          if(hana[i]-tmp==taro[j]){
            ans.PB(MP(taro[j]+hana[i],MP(taro[j],hana[i])));
            f=true;
          }
        }
      }
    }
    sort(ALL(ans));
    if(f&&!odd)cout<<ans[0].SC.FR<<' '<<ans[0].SC.SC<<endl;
    else cout<<-1<<endl;
  }
  return 0;
}



Measured memory_bytes: 3380
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a <= b:
    if a + t * v >= b + t * w:
        print('YES')
    else:
        print('NO')
else:
    if a - t * v <= b - t * w:
        print('YES')
    else:
        print('NO')     

Measured memory_bytes: 9188
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;++i)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const int MOD = 1e9 + 7;



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

	vector<int> from(202020);
	vector<int> to(202020);
	rep(i, 0, m) {
		int a, b;
		cin >> a >> b;
		if (a == 1)from[b]++;
		else if (b == n)to[a]++;
	}

	rep(i, 0, 202020) {
		if (from[i] != 0 && to[i] != 0) {
			cout << "POSSIBLE" << endl;
			exit(0);
		}
	}

	cout << "IMPOSSIBLE" << endl;




	return 0;
}

Measured memory_bytes: 1792
require 'pp'
# IS_DEBUG = true
IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end

N,d=gets.chomp.split(' ').map{|n| n.to_i}
A = {}
0.upto(N-1){|d|
	tmp=gets.chomp.to_i
	if(A[tmp].nil?)
		A[tmp]=1
	else
		A[tmp]^=1
	end
}
cnt = 0
A.each{|k,v|
	v==1 ? cnt+=1 : cnt
}
puts cnt

Measured memory_bytes: 8700
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using vect=vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() 
#define higher(v,x) high2way(v,x)-v.begin()-1 
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
#define gcd(x,y) __gcd(x,y)
#define erase(s) s.erase(s.end()-1) //文字列sの末尾削除

ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*y/z;
}
ll primejudge(ll n){
  if(n<2)return 0;
  else if(n==2)return 1;
  else if(n%2==0)return 0;
  double sqrtn=sqrt(n);
  Loop(i,3,sqrtn+1){
     if(n%i==0){
        return 0;
     }
     i++;
  }
  return 1;
}
string RLE(string s){
  ll n=s.size();
  char now='.';
  ll count=1;
  string press;
  loop(i,n){
    if(s[i]!=now){
      if(i){
        press+=now;
        press+=to_string(count);
      }
      now=s[i];
      count=1;
      continue;
    }
    else count++;
  }
  press+=now;
  press+=to_string(count);
  return press;
}
// index が条件を満たすかどうか
bool isOK(vec a,ll index,ll key) {
    if(a[index]>=key)return true;
    else return false;
}

// 汎用的な二分探索のテンプレ
ll binary_search(vec a,ll key) {
    ll ng=-1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll ok=(ll)a.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
    /* ok と ng のどちらが大きいかわからないことを考慮 */
    while(abs(ok-ng)>1){
        ll mid=(ok+ng)/2;
        if(isOK(a,mid,key))ok=mid;
        else ng=mid;
    }
    return ok;
}

int main() {
  cout << fixed << setprecision(30);
  ll a,b;
  cin>>a>>b;
  ll c=gcd(a,b);
  if(c==1){
    putout(1);
    return 0;
  }
  if(primejudge(c)){
    putout(2);
    return 0;
  }
  ll ans=1;
  Loop(i,2,1000001){
    if((ll)sqrt(c)<i)break;
    if(primejudge(i)){
      if(c%i==0){
        ans++;
        while(c%i==0){
        c/=i;
        }
      }
    }
  }
  if(primejudge(c))ans++;
  putout(ans);
}

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

int main(){
  ll n,k;
  cin>>n>>k;
  ll a[100005];
  rep(i,n) cin>>a[i];
  ll ans=0;
  for(int i=40;i>=0;i--){
    ll cnt=0;
    rep(j,n){
      cnt+=a[j]>>i&1;
    }
    if(k>=(1ll<<i)&&cnt<n-cnt){
      k-=1ll<<i;
      cnt=n-cnt;
    }
    ans+=cnt<<i;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 1024
#include <iostream>
#include <stack>
#include <string>
using namespace  std;

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

  stack<int> sknCal;
  string sCal;
  
  while (cin >> sCal)
  {
    if (sCal == "+" || sCal == "-" || sCal == "*")
    {
      int nNum1 = sknCal.top(); sknCal.pop();
      int nNum2 = sknCal.top(); sknCal.pop();
      int nRes;
      if      (sCal == "+")
        nRes = nNum2 + nNum1;
      else if (sCal == "-")
        nRes = nNum2 - nNum1;
      else if (sCal == "*")
        nRes = nNum2 * nNum1;
      else;
      
      sknCal.push(nRes);
    }
    else
    {
      int nNum = stoi(sCal);
      sknCal.push(nNum);
    }
  }

  cout << sknCal.top() << endl;
  sknCal.pop();

  return 0;
}

Measured memory_bytes: 1200
#include<bits/stdc++.h>
#define LL long long
#define dl double
template <class T>
void rd(T &x){
  x=0;T f=1;char ch=getchar();
  while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
  while(ch<='9' && ch>='0')x=x*10+ch-'0',ch=getchar();x*=f;
}
using namespace std;
const int N=2e5+10;
int n;
char s[N];
int cnt1,cnt2;
int ans1,ans2;
int fst(int x,int mod){
 int ans=1,now=2;
 while(x){
  if(x&1)ans=1ll*ans*now%mod;
  now=1ll*now*now%mod;x>>=1;
 }
 return ans;
}
void work(int x,int &y){
 for(int i=0;i<n;i++)y=(y*2+s[i]-'0')%x;
}
int ghb(int x){
 int cnt=0;
 while(x){
  if(x&1)cnt++;
  x/=2;
 }
 return cnt;
}
void get(int x){
 int ans=1;
 while(x)x%=ghb(x),ans++;
 printf("%d\n",ans);
}
int main(){
 // freopen("in.txt","r",stdin);
 // freopen("o.txt","w",stdout);
 rd(n);scanf("%s",s);
 for(int i=0;i<n;i++)cnt1+=s[i]-'0';
 cnt2=cnt1;cnt1--;cnt2++;
 if(cnt1 > 0)work(cnt1,ans1);
 work(cnt2,ans2);
 for(int i=0;i<n;i++){
  if(cnt1==0 && s[i]=='1'){printf("0\n");continue;}
  if(s[i] == '0')get((ans2+fst(n-i-1,cnt2))%cnt2);
  else get((ans1-fst(n-i-1,cnt1)+cnt1)%cnt1);
 }
 return 0;
}
/**/

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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int n; cin >> n;
    int u, v; cin >> u >> v; u--, v--;
    vector<vector<int>> g(n);
    for (int i = 0; i < n - 1; i++) {
        int a, b; cin >> a >> b; a--, b--;
        g[a].emplace_back(b), g[b].emplace_back(a);
    }

    vector<pair<int, int>> d(n, make_pair(-1, -1));
    queue<int> q;
    // v からの距離
    d[v].first = 0; q.emplace(v);
    while (!q.empty()) {
        int now = q.front(); q.pop();
        for (auto &nxt: g[now]) {
            if (d[nxt].first >= 0) continue;
            d[nxt].first = d[now].first + 1;
            q.emplace(nxt);
        }
    }
    // u からの距離
    d[u].second = 0; q.emplace(u);
    while (!q.empty()) {
        int now = q.front(); q.pop();
        for (auto &nxt: g[now]) {
            if (d[nxt].second >= 0) continue;
            d[nxt].second = d[now].second + 1;
            q.emplace(nxt);
        }
    }

    sort(d.begin(), d.end(), greater<pair<int, int>>());
    for (auto &e: d) {
        if (e.first > e.second) {
            cout << e.first - 1 << endl;
            return 0;
        }

    }
    return 0;
}


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

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }


#define int long long
const int INF = 1001001001;

signed main(){

    int n;cin >> n;
    vector<int> h(n);
    for(int i = 0, i_len = (int)n; i < i_len; ++i) cin >> h[i];

    vector<int> dp(n+1, INF);

    dp[0] = 0;
    dp[1] = (int)abs(h[0] - h[1]);
    /*
    dp[2] = (int)abs(h[1] - h[2]);
    dp[2] = (int)abs(h[0] - h[2]);
    amin(dp[2], dp[1] + (int)abs(h[1] - h[2]));
    amin(dp[2], dp[0] + (int)abs(h[0] - h[2]));

    amin(dp[i], dp[i-1] + (int)abs(h[i-1] - h[i]));
    amin(dp[i], dp[i-2] + (int)abs(h[i-2] - h[i]));
    */

    for(int i = 0; i < n; ++i){
        amin(dp[i+1], dp[i] + (int)abs(h[i+1] - h[i]));
        amin(dp[i+2], dp[i] + (int)abs(h[i+2] - h[i]));        
    } 


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

Measured memory_bytes: 1792
def dfs(now, d):
    visited[now] = True
    if d == k / 2  : return
    for nx in g[now]:
        if not visited[nx]:
            dfs(nx, d + 1)

n, k = map(int, raw_input().split())
g = [[] for _ in xrange(n)]
for i in xrange(n - 1):
    a, b = map(int, raw_input().split())
    a -= 1; b -= 1;
    g[a].append(b)
    g[b].append(a)
    
ans = n
if k % 2 == 1:
    for i in xrange(n):
        for j in g[i]:
            visited = [False] * n
            visited[i] = True
            visited[j] = True
            dfs(i, 0)
            dfs(j, 0)
            ans = min(ans, n - sum(visited))
    print ans
else:
    for i in xrange(n):
        visited = [False] * n
        visited[i] = True
        dfs(i, 0)
        ans = min(ans, n - sum(visited))
    print ans


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

using namespace std;

int main(void) {
	int num, i = 0, buf, val, ans = 1;
	cin >> num;
	val = num / 2 + num % 2;
	vector<int> d(val, 0);
	for (; i < num; i++) {
		scanf("%d", &buf);
		d[buf / 2]++;
	}
	i = 1;
	while (i < val && d[i] == 2) { i++; }
	if (i != val) {
		printf("0\n");
		return 0;
	}
	for (i = 0; i < num / 2; i++) {
		ans <<= 1;
		ans %= 1000000007;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll n;
    cin >> n;
    double ans = 0;
    rep(i, n) {
        double x;
        string u;
        cin >> x >> u;
        if (u == "JPY") ans += x;
        else ans += x * 380000.0;
    }
    cout.precision(20);
    cout << ans << endl;
}


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

int main()
{

    string s,t;
    ll c=0;
    cin>>s>>t;
    for(ll i=0;i<s.size();i++)
        if(s[i]==t[i])c++;
    cout<<c;
    return 0;
}


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


typedef long long ll;
#define reg register
#define rep(a,b,c) for(reg int a=b,a##end=c;a<=a##end;++a)
#define drep(a,b,c) for(reg int a=b,a##end=c;a>=a##end;--a)

char IO;
int rd(){
	int s=0,f=0;
	while(IO=getchar(),IO<'0'||IO>'9')if(IO=='-')f=1;
	do s=(s<<1)+(s<<3)+(IO^'0');
	while(IO=getchar(),IO>='0'&&IO<='9');
	return f?-s:s;
}


const int N=1e5+10,K=20;

int n;
ll a[N];
ll ans[N];

int main(){
	int cur=1;
	ll sum=0;
	rep(i,1,n=rd()) {
		a[i]=rd()*2ll;
		sum=a[i]-sum;
		cur=-cur;
	}
	ans[1]=sum/2;
	rep(i,2,n) ans[i]=a[i-1]-ans[i-1];
	rep(i,1,n) printf("%lld",ans[i]),putchar(i==n?'\n':' ');
}















Measured memory_bytes: 2816
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
#define PI 3.14159265
using namespace std;
const int MAX = 1e5 + 10;
const ll MOD = 1e9 + 7;
int N, M, K, L, Q;
int jump[MAX][33];
int A[MAX];

int func(int i, int j) {
	if (j == 0) return jump[i][0];
	int &ret = jump[i][j];
	if (ret != -1) return ret;
	return ret = func(func(i, j - 1), j - 1);
}

int main()
{
	int i, j, k, x, a, b;
	memset(jump, -1, sizeof(jump));
	scanf("%d", &N);
	for (i = 1; i <= N; ++i) scanf("%d", A + i);
	scanf("%d%d", &L, &Q);
	for (i = 1; i <= N; ++i) {
		auto it = upper_bound(A + 1, A + 1 + N, A[i] + L);
		--it;
		jump[i][0] = it - A;
	}
	j = 0;
	while (N > (1 << j)) j++;
	for (i = 1; i <= N; ++i) func(i, j);
	
	for (i = 1; i <= Q; ++i) {
		scanf("%d%d", &a, &b);
		if (a > b) swap(a, b);
		int days = 0;
		for (k = j; k >= 0; --k) {
			if (jump[a][k] < b) {
				a = jump[a][k];
				days += (1 << k);
			}
		}
		printf("%d\n", days + 1);
	}
}

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

template <class T>
inline void read(T &x) {
    x = 0;
    char c = getchar();
    bool f = 0;
    for (; !isdigit(c); c = getchar()) f ^= c == '-';
    for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
    x = f ? -x : x;
}

template <class T>
inline void write(T x) {
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    T y = 1;
    int len = 1;
    for (; y <= x / 10; y *= 10) ++len;
    for (; len; --len, x %= y, y /= 10) putchar(x / y + 48);
}

int a[3];

int main() {
	for (int i = 0; i < 3; ++i) read(a[i]);
	sort(a, a + 3);
	write(a[0] + a[1]);
	putchar('\n');
	return 0;
}

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

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N, M;
    cin >> N >> M;
    int days = 0;
    FOR(i, 0, M) {
        int a;
        cin >> a;
        days += a;
    }

    cout << max(-1, N - days) << endl;
    return 0;
};


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
typedef long long ll;
using namespace std;
const int INF = 1e9;

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

    int now = 1;
    int ans = 0;

    while(now<b){
        now += a-1;
        ++ans;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
int abs(int a,int b){
  int c=max(a,b)-min(a,b);
  return c;
}
signed main(){
  int a,b;
  cin>>a>>b;
  cout<<(a-1)*(b-1)<<"\n";
} 


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);
    static int V;
    static int[][] G = new int[105][105];
    static final int INF = 1 << 31 - 1;

    public static void main(String[] args) {
        V = sc.nextInt();

        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                G[i][j] = INF;
            }
        }

        int u, k, v, c;
        for (int i = 0; i < V; i++) {
            u = sc.nextInt();
            k = sc.nextInt();
            for (int j = 0; j < k; j++) {
                v = sc.nextInt();
                c = sc.nextInt();
                G[u][v] = c;
            }
        }

        int[] ans = solveDijkstra(0);
        for (int i = 0; i < V; i++) {
            System.out.println(String.format("%d %d", i, ans[i]));
        }
    }

    static int[] solveDijkstra(int start) {

        int[] cost = new int[V];
        boolean[] used = new boolean[V];

        for (int i = 0; i < V; i++) {
            cost[i] = INF;
            used[i] = false;
        }

        cost[start] = 0;

        while (true) {
            int v = -1;
            for (int u = 0; u < V; u++) {
                if (used[u]) {
                    continue;
                }
                if (v == -1 && cost[u] != INF) {
                    v = u;
                    continue;
                }
                if (v != -1 && cost[u] < cost[v]) {
                    v = u;
                }
            }

            if (v == -1) {
                break;
            }

            used[v] = true;
            for (int u = 0; u < V; u++) {
                cost[u] = Math.min(cost[u], cost[v] + G[v][u]);
            }
        }

        return cost;
    }
}

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

int main(){
    int N,M;cin>>N>>M;
    vector<set<int> > G(N);
    vector<int> v(N);
    FOR(i,0,N) v[i]=i;
    int a,b;
    FOR(i,0,M){
        cin>>a>>b;a--;b--;
        G[a].insert(b);
        G[b].insert(a);
    }
    int res=0;
    do{
        bool f =true;
        FOR(i,0,N-1){
            if(G[v[i]].find(v[i+1])==G[v[i]].end())f=false; 
        }
        if(f) res++;
    }while(next_permutation(v.begin()+1,v.end()));
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
(defun solver ()
  (let* ((n (read)) (m (read)) (x (read))
         (ai (make-array 110 :initial-element 0))
         (cost1 0) (cost2 0))
    (loop repeat m do
          (setf (aref ai (read)) 1))
    (loop for i from x to n do
          (when (= (aref ai i) 1) (incf cost1)))
    (loop for i from x downto 1 do
          (when (= (aref ai i) 1) (incf cost2)))
    (if (> cost1 cost2)
        (format t "~a~%" cost2)
        (format t "~a~%" cost1))))

(solver)

Measured memory_bytes: 12644
#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
bool is_prime(int x){
if(x<=1)return false;
for(int i=2;i*i<=x;i++){
    if(x%i==0)return false;
    }
    return true;
}
int main(){
    int n;cin>>n;
    while(!is_prime(n))n++;
    cout<<n<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);

		int a=sc.nextInt();
		int b=sc.nextInt();

		if((a+b)%2==0) {
			System.out.println((a+b)/2);
		}else if((a+b)%2!=0) {
			System.out.println("IMPOSSIBLE");
		}

	}

}


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



int main() 
{
  ll N,K; cin>>N>>K;
  vector<ll> A(N);
  rep(i,N)
  {
    cin>>A.at(i);
    A.at(i)--;
  }
  vector<ll> path(N,-1);
  ll saki;
  rep(i,K+1)
  {
    if(i==0)
    {
      path.at(0)=0;
      saki=0;
      continue;
    }
    saki=A.at(saki);
    if(path.at(saki)!=-1)
    {
      ll roop=i-path.at(saki);
      K=(K-path.at(saki))%roop;
      rep(i,K)
      {
        saki=A.at(saki);
      }
      cout<<saki+1<<endl;
      return 0;
    }
    path.at(saki)=i;
  }
  cout<<saki+1<<endl;
  return 0;
}







Measured memory_bytes: 6408
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_sz_asc(const void* a, const void* b) {
    return *((size_t*)a) < *((size_t*)b) ? -1 : 1;
}

int compare_sz_desc(const void* a, const void* b) {
    return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}

int compare_i64_asc(const void* a, const void* b) {
    return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}

int compare_i64_desc(const void* a, const void* b) {
    return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1;
}

int compare_c_asc(const void* a, const void* b) {
    return *((char*)a) < *((char*)b) ? -1 : 1;
}

int compare_c_desc(const void* a, const void* b) {
    return *((char*)a) > * ((char*)b) ? -1 : 1;
}

static size_t combSz(const size_t n, const size_t r) {
    size_t result = 1;

    for (size_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t combU64(const uint64_t n, const uint64_t r) {
    uint64_t result = 1;

    for (uint64_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static size_t gcdZu(size_t m, size_t n) {
    size_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

static uint64_t gcdU64(uint64_t m, uint64_t n)
{
    uint64_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

static size_t D[200000];
static size_t T[200000];

int main(void) {
    size_t N, M;

    scanf("%zu\n", &N);
    for (size_t i = 0; i < N; i++) {
        scanf("%zu", &(D[i]));
        scanf(i < N - 1 ? " " : "\n");
    }
    scanf("%zu\n", &M);
    for (size_t i = 0; i < M; i++) {
        scanf("%zu", &(T[i]));
        if (i < M - 1) {
            scanf(" ");
        }
    }

    if (N < M) {
        puts("NO");
    }
    else {
        qsort(D, N, sizeof(size_t), compare_sz_asc);
        qsort(T, M, sizeof(size_t), compare_sz_asc);

        bool ableToMatch = true;

        size_t dPos = 0;
        for (size_t t = 0; t < M; t++) {
            while (true) {
                if (T[t] < D[dPos]) {
                    ableToMatch = false;
                    break;
                }
                else if (T[t] == D[dPos]) {
                    dPos++;
                    break;
                }

                dPos++;

                if (dPos == N) {
                    ableToMatch = false;
                    break;
                }
            }
        }

        puts(ableToMatch ? "YES" : "NO");
    }

    return 0;
}


Measured memory_bytes: 4860
from collections import Counter
n = int(input())
s = input()
mod = 10**9 + 7
q  =[c for c in s]
p = Counter(q)
#print(p)
ans = 1
for key in p:
    #print(p[key])
    ans *= (p[key]+1)
    ans%= mod

print(ans-1)

Measured memory_bytes: 49392
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main(){
    char c;
    cin >> c;
    int a = c - 'A';
    if(a > 26) cout << "a" << endl;
    else cout << "A" << endl;

}

Measured memory_bytes: 3536
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(str, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
import math
from decimal import Decimal

A, B = mi()
A = Decimal(A)
B = Decimal(B)
print(A * B//1)

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

#define ll long long
#define int long long
#define loop(i,s,e) for(int i=s;i<e;i++)
#define rloop(i,s,e) for(int i=e;i>=s;i--)
#define fr first
#define sc second
#define pb push_back
#define  vii vector<int>
#define vll vector<ll>
#define vpii vector<pair<int ,int >>
#define vpll vector<pair<ll, ll> >
#define  pii pair<int,int>
#define lb(v,x) lower_bound(v.begin(),v.end(),x);
#define ub(v,x) upper_bound(v.begin(),v.end(),x);
const long mod =1e9+7;
const int N = 2e5+10;
const long long inf= 1e18;

ll gcd(ll a ,ll b){if(b==0) return a;return gcd(b,a%b);}
ll mul(ll a ,ll b){return (a%mod * b%mod )%mod;}
ll mpower(ll a, ll b){if(b==0) return 1;ll temp=mpower(a,b/2);if(b%2==0){return mul(temp,temp);}else{	return mul(mul(temp,temp) , a);}}
ll inv(ll a){return mpower(a,mod-2);}
ll ncr(ll n, ll r){if(r==0)return 1;ll ans=n%mod;ans=mul(ans,ncr(n-1,r-1));ans=mul(ans,inv(r));	return ans;}
ll power(ll a, ll b){if(b==0) return 1;ll temp=power(a,b/2);if(b%2==0)return temp*temp;else return temp*temp*a;}
ll add(ll a, ll b){return (a%mod + b%mod)%mod;}


void solve()
{
  int n,k,d;cin>>n>>k;
  set<int> st;
  while(k--)
  {
      int x;
      cin>>x;
      while(x--)
      {
          int tmp;
          cin>>tmp;
          st.insert(tmp);
      }
  }
  cout<<n-st.size();
  

    
}

int32_t main()
{
	ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;//cin>>t;
	while(t--){
        solve();
	}
}

Measured memory_bytes: 3644
n, m = gets.split.map(&:to_i)
r = Array.new(0)
sum = 1
a = Array.new(0)
b = Array.new(0)
m.times do |i|
	a, b = gets.split.map(&:to_i)
	r[i] = [a,b]
end

r.sort!.reverse!

k = 0
count = 0

r.each do |i|
	if r[k][0] >= i[1]
		sum += 1
		k = count	
	end
	count += 1
end

puts sum





Measured memory_bytes: 10616
//Coronados de gloria vivamos, o juremos con gloria morir
#include <bits/stdc++.h>

using namespace std;

#ifdef ACMTUYO
#define mine(x) x
#else
#define mine(x)
#endif


#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n);i++)
#define dforn(i,n) for(int i=(int)((n)-1);i>=0;i--)
#define dforsn(i,s,n) for(int i=(int)((n)-1);i>=(int)(s);i--)
#define all(c) begin(c), end(c)
#define esta(x,c) ((c).find(x) != end(c))


#define wbe(f, c, as...) f(all(c), ##as)
#define wbeb(f, c, d, as...) f(all(c), begin(d), ##as)
#define L(r, as...) [&](as){return r;}

#define LEA mine(freopen("in.txt", "r", stdin))

#define dbgi(a) << #a << " = " << (a) <<
#define dbg1(a, z...) 	dbgi(a) ""
#define dbg2(a, z...)  	dbgi(a) ", " dbg1(z)
#define dbg3(a, z...)  	dbgi(a) ", " dbg2(z)
#define dbg4(a, z...)  	dbgi(a) ", " dbg3(z)
#define dbg5(a, z...)   dbgi(a) ", " dbg4(z)

#define dbgx(v1, v2, v3, v4, v5, v6, z...) v6
#define dbg(z...)  mine( cerr dbgx(z, dbg5(z), dbg4(z), dbg3(z), dbg2(z), dbg1(z)) << endl );

#define raya mine(cerr << "----------" << endl)

// TYPEDEFS
typedef long long tint;
typedef vector<int> vint;
typedef vector<vector<int>> grint;
typedef pair<int,int> pint;
typedef long double tdbl;

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back

const double PI=acos(-1.0);

int main(int argc, char **argv) {
	//        LEA;
	ios_base::sync_with_stdio(0);

	int n, l;

	cin >> n >> l;

	vector<string> ss;

	forn(i,n){
		string s;
		cin >> s;
		ss.pb(s);
	}

	sort(all(ss));

	string res = "";

	for(string s: ss){
		res+=s;
	}

	cout << res << endl;


	return 0;
}


Measured memory_bytes: 256
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

a, op, b = map(str, input().split())

if (op=="+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))


Measured memory_bytes: 9164
a,b = map(int,input().split())
s = input().split('-')

if len(s) != 2:
    print('No')
    exit()
else:
    if a == len(s[0]):
        if b == len(s[1]):
            print('Yes')
            exit()
        else:
            print('No')
            exit()
    else:
        print('No')
        exit()

Measured memory_bytes: 3060
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <bitset>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;
// const ll mod =  998244353 ;
const ll mod =  1000000007 ;
const ll inf = 1e18;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};


#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define REP_REV(i, n) for (ll i = n-1; i >= 0; --i)
#define REP_FROM_REV(i, j, n) for (ll i = n-1; i >= j; --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) ll(x.size())
template<typename T> inline T chmax(T& a, const T b) { return a = (a < b) ? b : a; }
template<typename T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

ll power(ll base, ll exponent){ if(exponent % 2){ return power(base, exponent - 1) * base % mod; }else if(exponent){ ll root_ans = power(base, exponent / 2); return root_ans * root_ans % mod; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
template<typename T> ll sum(T begin, T end) {return accumulate(begin, end, 0ll);}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

using Pair = pair<ll, ll>;



signed main() {
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin >> n;
    vector<Pair> a;
    REP_REV(i, n) {
        REP_FROM_REV(j, i + 1, n) {
            if(i + j == n - 1 - n % 2) continue;
            a.emplace_back(i, j);
        }
    }
    cout << sz(a) << endl;
    for(auto x : a) {
        cout << x.first + 1 << " " << x.second + 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			int[] hw = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int h = hw[0];
			int w = hw[1];
			Queue<Pair<int, int>> next = new Queue<Pair<int, int>>();
			bool[,] done = new bool[h, w];
			for (int i = 0; i < h; i++) {
				string b = Console.ReadLine();
				for (int j = 0; j < w; j++) {
					if (b[j] == '#') {
						done[i, j] = true;
						next.Enqueue(new Pair<int, int>(i, j));
					}
				}
			}

			int ans = 0;
			while (next.Count > 0) {
				++ans;
				Queue<Pair<int, int>> temp = new Queue<Pair<int, int>>();
				while (next.Count > 0) {
					var xy = next.Dequeue();
					int i = xy.F;
					int j = xy.S;
					if (i > 0) {
						if (done[i - 1, j] == false) {
							temp.Enqueue(new Pair<int, int>(i - 1, j));
							done[i - 1, j] = true;
						}
					}

					if (j > 0) {
						if (done[i, j - 1] == false) {
							temp.Enqueue(new Pair<int, int>(i, j - 1));
							done[i, j - 1] = true;
						}
					}

					if (i < h - 1) {
						if (done[i + 1, j] == false) {
							temp.Enqueue(new Pair<int, int>(i + 1, j));
							done[i + 1, j] = true;
						}
					}

					if (j < w - 1) {
						if (done[i, j + 1] == false) {
							temp.Enqueue(new Pair<int, int>(i, j + 1));
							done[i, j + 1] = true;

						}
					}
				}

				next = temp;
			}

			Console.WriteLine(ans - 1);
		}
	}

	class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
	{
		public T F; public U S;
		public Pair(T f, U s) { this.F = f; this.S = s; }
		public int CompareTo(Pair<T, U> a) => F.CompareTo(a.F) != 0 ? F.CompareTo(a.F) : S.CompareTo(a.S);
		public override string ToString() => $"{F} {S}";
	}
}


Measured memory_bytes: 51392