alexjercan/bugnet huggingface dataset:
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

// 競技プログラミング用のテンプレート
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <stdlib.h>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)

using namespace std;
// エイリアス
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

// 定数
const int intmax = numeric_limits<int>::max();
const ll llmax = numeric_limits<ll>::max();
const ll mod = 1e9 + 7;
const double pi = M_PI;

int main() {
  ll a;
  string b;
  cin >> a >> b;
  int temp = b[0] - '0';
  int temp2 = stoi(b.substr(2, 2));
  cout << a * temp + (a * temp2) / 100 << endl;
}


Error: WA

Fixed submission:

// 競技プログラミング用のテンプレート
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)

using namespace std;
// エイリアス
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

// 定数
const int intmax = numeric_limits<int>::max();
const ll llmax = numeric_limits<ll>::max();
const ll mod = 1e9 + 7;
const double pi = M_PI;
const ll limit = 1e18;

int main() {
  int n;
  cin >> n;
  vl a(n, 0);
  rep(i, n) {
    cin >> a[i];
    if (a[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  ll result = 1;
  rep(i, n) {
    if (result <= limit / a[i]) {
      result *= a[i];
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << result << endl;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

void solve() {
  long long a;
  long double b;
  cin >> a >> b;
  long long c = round(b * 100);
  a *= c;
  a /= 100;
  cout << a;
}

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


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

void solve() {
  string a;
  double b;
  cin >> a >> b;
  b *= 100;
  int c = (int)b;
  string x = to_string(c);
  if (x == "1") {
    cout << 0;
    return;
  }
  int n = (int)a.size();
  int xz = (int)x.size();
  vector<int> ans(max(n, xz));
  int r = (int)x.size() - 1;
  for (int i = xz - 1; i >= 0; i--) {
    for (int j = n - 1; j >= 0; j--) {
      int t = x[i] - '0';
      int q = a[j] - '0';
      int z = t * q;
      ans[j + r] += z;
      ans[j - 1 + r] += ans[j + r] / 10;
      ans[j + r] = (ans[j + r] % 10);
    }
    r--;
  }
  for (auto x : ans) {
    cout << x;
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define nl '\\n'

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  setprecision(10);
  cout << fixed;
  ll a, b, c, d, ans;
  scanf("%lld %lld.%lld", &a, &b, &c);
  d = b * 100 + c;
  ans = a * d / 100;
  cout << ans << nl;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define nl '\\n'

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  setprecision(10);
  cout << fixed;
  ll a;
  float b;
  cin >> a >> b;
  ll c = b * 100;
  assert((float)b * 100 == c);
  ll ans = a * (c) / 100;
  cout << ans << nl;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

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

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a;
  cin >> a;
  long long b[a + 1];
  float p = 1.0 / 100;
  for (int i = 1; i <= a; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= a; i++) {
    if (b[i] == 0) {
      cout << 0;
      return 0;
    }
  }
  for (int i = 1; i <= a; i++) {
    p = p * b[i];
    cout << p << endl;
    if (p > 1) {
      cout << -1;
      return 0;
    }
  }
  cout << (long long)p * 100;
  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A;
  double B;
  cin >> A >> B;
  long long x = (B + 0.001) * 100;
  long long ans = (A * x) / 100;
  cout << ans << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  long long a, c;
  double b;
  while (1) {
    cin >> a >> b;
    c = a * b * 100;
    cout << c / 100 << endl;
  }
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll A, B1;
  long double B;
  cin >> A >> B;
  // B1 = B*100;
  // A *= B1;
  // string str;
  // str = to_string(A);
  // if(A == 0 || B1 == 0 || A < 100){
  //     cout << 0 << endl;
  // }else{
  //     cout << str.substr(0,str.size()-2) << endl;
  // }
  A = A * B;
  cout << A << endl;

  return 0;
}

Error: 0

Fixed submission:

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

int main() {
  ll A;
  double B;
  cin >> A >> B;
  if (A > 10000000000) {
    // double a10 = A/10;
    // stringstream stream;
    // stream << fixed << setprecision(13) << a10;
    // string s = stream.str();
    string str;
    str = to_string(A);
    ll ab = stoi(str.substr(0, str.size() - 5));

    ll un = stoi(str.substr(str.size() - 5));
    // cout << ab << endl;
    // cout << un << endl;
    ab *= B * 100000;
    double d = un * B;
    double integral_part = 0;
    double fractional_part = modf(d, &integral_part);
    ab += integral_part;
    cout << ab << endl;
  } else {
    A = A * B;
    cout << A << endl;
  }

  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
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;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<long long, long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
  long double a, b;
  cin >> a >> b;
  cout << (ll)(a * b) << endl;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
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;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<long long, long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
  int N;
  cin >> N;
  vecl A(N);
  REP(i, N) cin >> A[i];
  ll ans = 1;
  REP(i, N) if (A[i] == 0) {
    cout << 0 << endl;
    return 0;
  }
  REP(i, N) {
    ans *= A[i];
    if (ans > 1000000000000000000 || ans < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int main() {
  // ios_base::sync_with_stdio(false);
  // cin.tie(NULL);
  // cout.tie(NULL) ;

  ll a;
  double b;
  cin >> a >> b;
  ll ans = a * (int)b;
  // cout << ans ;
  string s = to_string(b);
  string t = s.substr(2, 2);
  // << t;
  ll fac = (stoll(t)) * a;
  string sf = to_string(fac);
  if (sf.size() > 2) {
    sf.pop_back();
    sf.pop_back();
    ll add = (stoll(sf));
    cout << ans + add;
  } else
    cout << ans;

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll a;
  double b;
  cin >> a >> b;
  ll ans = a * (int)b;
  // cout << ans ;
  string s = to_string(b);
  string t = s.substr(2, 2);
  ll fac = ((ll)stoll(t)) * a;
  string sf = to_string(fac);
  sf.pop_back();
  sf.pop_back();
  ll add = ((ll)stoll(sf));
  cout << ans + add;

  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <map>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const double pi = acos(-1);
int main() {
  ll a;
  string b;
  cin >> a >> b;
  string b100;
  bool first = false;
  bool point = false;
  int afterpoint = 0;
  for (int i = 0; i < b.size(); i++) {
    if (b[i] == '.') {
      point = true;
      continue;
    }
    if (first || b[i] != '0') {
      first = true;
      b100 += b[i];
    }
    if (point) {
      afterpoint++;
      if (afterpoint == 2)
        break;
    }
  }
  if (b100 == "")
    b100 = "0";
  ll ans = a * stoi(b100) / 100;
  cout << ans << endl;
}

Error: 0

Fixed submission:

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <map>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const double pi = acos(-1);
int main() {
  ll a;
  string b;
  cin >> a >> b;
  string b100;
  bool first = false;
  bool point = false;
  int afterpoint = 0;
  for (int i = 0; i < b.size(); i++) {
    if (b[i] == '.') {
      point = true;
      continue;
    }
    if (first || b[i] != '0') {
      first = true;
      b100 += b[i];
    }
    if (point) {
      afterpoint++;
      if (afterpoint == 2)
        break;
    }
  }
  ll ans = a * stoi(b100) / 100;
  cout << ans << endl;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(v) v.begin(), v.end()
typedef long long ll;

int main() {
  ll a;
  string b;
  cin >> a >> b;
  string b1 = b.substr(0, 1);
  string b2 = b.substr(2);
  int bnum = stoi(b1) * 100 + stoi(b2);

  dunk(a * bnum / 100);

  return 0;
}


Error: 0

Fixed submission:

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(v) v.begin(), v.end()
typedef long long ll;

int main() {
  int a;
  string b;
  cin >> a >> b;
  string b1 = b.substr(0, 1);
  string b2 = b.substr(2);
  int bnum = stoi(b1) * 100 + stoi(b2);

  dunk(a * bnum / 100);

  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define Bye return 0
#define ll long long

using namespace std;

void solve() {
  long long a, mult;
  string b;
  cin >> a >> b;
  int b_c = (b[0] - '0') * 100 + (b[2] - '0') * 10 + (b[3] - '0');
  mult = (long long)(a * b_c) / 100;

  cout << mult << endl;
}

int main() {
  solve();
  Bye;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define Bye return 0
#define ll long long

using namespace std;

void solve() {
  long long a;
  double b;
  cin >> a >> b;

  ll mult = (a * (b * 1ll * 100)) / 100;

  string str;
  str = to_string(mult);

  for (int i = 0; str[i] != '.'; i++)
    printf("%c", str[i]);
}

int main() {
  solve();
  Bye;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll a;
  double b;
  cin >> a >> b;
  ll c = b * 100 + 0.5;
  ll ans = a * c / 100;
  cout << ans << endl;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int64_t n;
  cin >> n;
  int64_t ans = 1;
  vector<int64_t> vec(n);
  for (int64_t i = 0; i < n; i++) {
    cin >> vec[i];
    ans *= vec[i];
  }
  if (ans <= 1000000000000000000) {
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

/* https://atcoder.jp/contests/abc169/tasks/abc169_a */
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;

#define f first
#define s second
#define forn(i, a) for (int i = 0; i < (a); ++i)
#define for1(i, b) for (int i = 1; i <= (b); ++i)
#define FORd(i, a) for (int i = (a)-1; i >= 0; --i)
#define F0Rd(i, a, b) for (int i = (a)-1; i >= (a); --i)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define ins insert

const ll MAX = 1e18;

int main() {

  ll A, B;
  cin >> A >> B;
  char c;
  cin >> c;
  int D;
  cin >> D;
  B *= 100;
  B += D;
  ll X = A * B;
  X /= 100;
  cout << X << endl;
  return 0;
}


Error: WA

Fixed submission:

/* https://atcoder.jp/contests/abc169/tasks/abc169_a */
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;

#define f first
#define s second
#define forn(i, a) for (int i = 0; i < (a); ++i)
#define for1(i, b) for (int i = 1; i <= (b); ++i)
#define FORd(i, a) for (int i = (a)-1; i >= 0; --i)
#define F0Rd(i, a, b) for (int i = (a)-1; i >= (a); --i)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define ins insert

const ll MAX = 1e18;

int main() {

  int n;
  cin >> n;
  vl a(n);
  forn(i, n) { cin >> a[i]; }

  ll ans = 1;
  forn(i, n) {
    ans *= a[i];
    if (ans < 0 || ans > MAX) {
      cout << -1 << endl;
      return 0;
    }
  }

  cout << ans << endl;

  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a;
  double b;
  cin >> a >> b;
  ll c = llround(b * 100);
  cout << a * c / 100 << '\\n';
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a;
  double b;
  cin >> a >> b;
  a *= 100;
  ll c = llround(b * 100);
  cout << a / c << '\\n';
  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  long double a;
  cin >> a;
  long double b;
  cin >> b;
  cout << ll(a * b + 0.001) << endl;
}


Error: -6
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi


Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll a;
  cin >> a;
  string s;
  cin >> s;
  s = s[0] + s[2] + s[3];
  ll b = stoi(s);
  ll x = a * b;
  s = to_string(x);
  int n = (int)s.size();
  cout << s.substr(0, n - 2) << endl;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
const long long INF = 1LL << 60; // 仮想的な無限大の値;
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

int main() {
  ll a;
  string b;
  cin >> a >> b;
  auto pos = b.find('.');
  int prod = b.size() - pos - 1;
  string c = b.substr(0, pos) + b.substr(pos + 1, prod + 1);

  ll t10 = 1;
  rep(i, prod) t10 *= 10;
  ll B = stoll(c);
  ll C = a * B;
  cout << C / t10 << endl;

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
// const long long INF = 1LL<<60; // 仮想的な無限大の値;
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}

const ll INF = 1 << 18;
int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  sort(ALL(A));
  if (*A.begin() == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (*A.rbegin() > INF) {
    cout << -1 << endl;
    return 0;
  }
  ll ans = 1;
  rep(i, N) {
    ans *= A[i];
    if (ans > INF) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1, _2, _3, _4, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n, s) for (int i = a; s > 0 ? i < n : i > n; i += s)
#define rep(...) _overload3(__VA_ARGS__, per, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const int inf = 1e9 + 10, mod = 1e9 + 7;
const long long llinf = 1e18;
// head

int main() {
  long long a;
  int b;
  string bb, c;
  cin >> a >> bb;
  rep(i, bb.size()) {
    if (bb[i] != '.')
      c += bb[i];
  }
  b = stoi(c);
  cout << a * b / 100 << endl;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1, _2, _3, _4, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n, s) for (int i = a; s > 0 ? i < n : i > n; i += s)
#define rep(...) _overload3(__VA_ARGS__, per, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const int inf = 1e9 + 10, mod = 1e9 + 7;
const long long llinf = 1e18;
// head

int main() {
  int a;
  long long b;
  string bb, c;
  cin >> a >> bb;
  rep(i, bb.size()) {
    if (bb[i] != '.')
      c += bb[i];
  }
  b = stoi(c);
  cout << a * b / 100 << endl;
}
Problem p02659 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

typedef long long ll;

int main() {
  ll a;
  string s;
  cin >> a >> s;
  int cnt = 0;
  int b = 0;
  bool f = false;
  for (char c : s) {
    if (c == '.') {
      f = true;
      continue;
    }
    if (f)
      cnt++;
    b = b * 10 + (c - '0');
  }
  a *= b;
  while (cnt--)
    a /= 10;
  cout << a << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

typedef long long ll;

int main() {
  ll a;
  double b;
  cin >> a >> b;
  int cnt = 0;
  while (b - (int)(b) > 1e-3) {
    cnt++;
    b *= 10;
  }
  a *= (int)b;
  while (cnt--)
    a /= 10;
  cout << a << endl;
  return 0;
}
Problem p02659 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define LOL cout << '\\n';
#define MOD 1000000007
#define sz(x) ((int)x.size())
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define deb(x) cout << "[" << (#x) << "=" << x << "]" << '\\n';
#define deb2(x, y)                                                             \\
  cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "]" << '\\n';
#define deb3(x, y, z)                                                          \\
  cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "] ["        \\
       << (#z) << "=" << z << "]" << '\\n';

const int N = 1e5 + 7;
int n, m, k, q, l, r, x, y, z;
int a[N], b[N], c[N];
string s, t;
int ans = 0, cnt = 0, f = 0;

void solve() {
  cin >> n;
  ld bb;
  cin >> bb;
  m = (bb * 100 + .5);
  m = n * m;
  m /= 100;
  cout << m;
  LOL
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(2);
  int _ = 1; // cin>>_;
  for (int i = 1; i <= _; i++)
    solve();
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define LOL cout << '\\n';
#define MOD 1000000007
#define sz(x) ((int)x.size())
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define deb(x) cout << "[" << (#x) << "=" << x << "]" << '\\n';
#define deb2(x, y)                                                             \\
  cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "]" << '\\n';
#define deb3(x, y, z)                                                          \\
  cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "] ["        \\
       << (#z) << "=" << z << "]" << '\\n';

const int N = 1e5 + 7;
int n, m, k, q, l, r, x, y, z;
int a[N], b[N], c[N];
string s, t;
int ans = 0, cnt = 1;

void solve() {
  cin >> n;
  ld d;
  cin >> d;
  ans = d * 100;
  m = ans % 100;
  ans -= m;
  ans /= m;
  cout << ans;
  LOL
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(3);
  int _ = 1; // cin>>_;
  for (int i = 1; i <= _; i++)
    solve();
  return 0;
}