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

#include <bits/stdc++.h>

using namespace std;
int main() {
  string s;
  cin >> s;

  for (int i = 0; i < (s.length()) / 2; i++) {
    if (s[i] != s[s.length() - i - 1]) {
      cout << "No";
      return 0;
    }
  }
  for (int i = 0; i < (s.length()) / 4; i++) {
    if (s[i] != s[(s.length()) / 2 - i - 1]) {
      cout << "No";
      return 0;
    }
  }
  for (int i = ((s.length()) / 2 + 2); i < 3 * (s.length()) / 4; i++) {
    if (s[i] != s[s.length() - i - 1]) {
      cout << "No";
      return 0;
    }
  }

  cout << "Yes";
  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
int main() {
  string s;
  cin >> s;

  for (int i = 0; i < (s.length()) / 2; i++) {
    if (s[i] != s[s.length() - i - 1]) {
      cout << "No";
      exit(0);
    }
  }
  for (int i = 0; i < (s.length()) / 4; i++) {
    if (s[i] != s[(s.length()) / 2 - i - 1]) {
      cout << "No";
      exit(1);
    }
  }
  for (int i = ((s.length()) / 2 + 2); i < 3 * (s.length()) / 4; i++) {
    if (s[i] != s[s.length() - i - 1]) {
      cout << "No";
      exit(2);
    }
  }

  cout << "Yes";
  return 0;
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long int
#define loop for (int i = 0; i < n; i++)
using namespace std;
string reverese(string n) {
  string st = "";
  for (int i = n.length() - 1; i >= 0; i--)
    st += n[i];
  return st;
}
int main() {
  string k;
  cin >> k;
  int flag = 1;
  int n = k.length();
  if ((k.substr(0, n / 2) == reverese(k.substr(0, n / 2))) and
      (k.substr(((n + 3) / 2) - 1, n - 1) ==
       reverese(k.substr((((n + 3) / 2) - 1), n - 1))))
    if (k == reverese(k))
      flag = 2;
  if (flag == 2)
    puts("Yes");
  else
    puts("No");
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
#define loop for (int i = 0; i < n; i++)
using namespace std;
string reverese(string n) {
  string st = "";
  for (int i = n.length() - 1; i >= 0; i--)
    st += n[i];
  return st;
}
int main() {
  string k;
  cin >> k;
  int flag = 1;
  int n = k.length();
  if (n % 2 == 0)
    flag = 1;
  else if ((k.substr(0, n / 2) == reverese(k.substr(0, n / 2))) and
           (k.substr(((n + 3) / 2) + 1, n) ==
            reverese(k.substr((((n + 3) / 2) + 1), n))))
    flag = 2;
  if (flag == 2)
    puts("Yes");
  else
    puts("No");
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
int main() {
  string s;
  cin >> s;
  int n = s.size();
  string t = "Yes";
  rep(i, n) {
    if (s[i] != s[n - i - 1]) {
      t = "No";
      break;
    }
  }
  rep(i, (n - 1) / 2) {
    if (s[i] != s[(n - 1) / 2 - 1 - i]) {
      t = "No";
      break;
    }
  }
  rep(i, (n - 1) / 2) {
    if (s[(n - 1) / 2 - 1 - i] != s[n - i - 1]) {
      t = "No";
      break;
    }
  }
  cout << t << endl;
}


Error: WA

Fixed submission:

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
int main() {
  string s;
  cin >> s;
  string t = "Yes";
  int n = s.size();
  rep(i, n) {
    if (s[i] != s[n - i]) {
      t = "No";
      break;
    }
  }
  rep(i, n) {
    if (s[i] != s[(n - 1) / 2 - i]) {
      t = "No";
      break;
    }
  }
  rep(i, n) {
    if (s[(n + 1) / 2 + i] != s[n - i]) {
      t = "No";
      break;
    }
  }
  cout << t << endl;
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

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

bool kaibun(string s) {
  string t = s;
  bool res = false;
  reverse(t.begin(), t.end());
  if (s == t) {
    res = true;
  } else {
    res = false;
  }
  return res;
}

int main(void) {
  bool ans;
  string s;
  cin >> s;
  bool ans1 = kaibun(s);
  int n = s.size();

  string t = s.substr(0, (n - 1) / 2);
  bool ans2 = kaibun(t);

  string u = s.substr((n + 1) / 2);
  bool ans3 = kaibun(u);

  if (ans1 && ans2 && ans3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Error: 0

Fixed submission:

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

bool kaibun(string s, string t) {
  bool res = false;
  reverse(t.begin(), t.end());
  if (s == t) {
    res = true;
  } else {
    res = false;
  }
  return res;
}

int main(void) {
  bool ans;
  string s;
  cin >> s;
  string t = s;
  bool ans1 = kaibun(s, t);

  s = s.substr(0, (s.size() - 1) / 2);
  t = s;
  bool ans2 = kaibun(s, t);

  s = s.substr((s.size() + 3) / 2);
  t = s;
  bool ans3 = kaibun(s, t);

  if (ans1 && ans2 && ans3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  string arr;
  cin >> arr;
  int l = arr.length();
  bool isCorrect = true;
  int half = l / 2;
  for (int i = 0; i < half; i++) {
    int j = l - i - 1;
    int i2 = half + 1 + i;
    int j3 = half - i - 1;
    if (arr.at(i) == arr.at(j) && arr.at(i) == arr.at(j3) &&
        arr.at(i2) == arr.at(j)) {
      continue;
    }
    isCorrect = false;
    printf("No\\n");
    break;
  }
  if (isCorrect) {
    printf("Yes\\n");
  }
}

Error: 0

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  string arr;
  cin >> arr;
  int l = arr.length();

  int half = l / 2;
  for (int i = 0; i < half; i++) {
    int j = l - i - 1;
    int i2 = half + 1 + i;
    int j3 = half - i - 1;
    if (arr.at(i) == arr.at(j) && arr.at(i) == arr.at(j3) &&
        arr.at(i2) == arr.at(j)) {
      continue;
    }
    printf("No\\n");
    return (1);
  }
  printf("Yes\\n");
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

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

bool isPalin(string S) {
  for (int i = 0; i < S.length(); i++) {
    if (S[i] != S[S.length() - i - 1]) {
      return false;
    }
  }
  return true;
}

int main(void) {
  string S;
  cin >> S;

  int N = S.length();

  bool strongPalindrome = true;

  // 1st condition
  if (!isPalin(S)) {
    cout << "No" << endl;
    return 0;
  }

  // 2nd condition
  if (!isPalin(S.substr(0, (N - 1) / 2))) {
    cout << "No" << endl;
    return 0;
  }

  // 3rd condition
  if (!isPalin(S.substr((N + 3) / 2 - 1))) {
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;
}


Error: 0

Fixed submission:

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

bool isPalin(string S) {
  for (int i = 0; i < S.length(); i++) {
    if (S[i] != S[S.length() - i - 1]) {
      return false;
    }
  }
  return true;
}

int main(void) {
  string S;
  cin >> S;

  int N = S.length();

  bool strongPalindrome = true;

  // 1st condition
  if (!isPalin(S)) {
    cout << "No" << endl;
    return 0;
  }

  // 2nd condition
  if (!isPalin(S.substr(0, (N - 1) / 2))) {
    cout << "No" << endl;
    return 0;
  }

  // 3rd condition
  if (!isPalin(S.substr((N + 3) / 2 + 1))) {
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  string T;
  T = "Yes";
  int len = S.size();
  for (int i = 0; i < (len - 1) / 2; i++) {
    if (S.at(i) != S.at(((len - 2) / 2) - i) || S.at(i) != S.at(len - 1 - i)) {
      T = "No";
      cout << "No" << endl;
      break;
    }
  }
  if (T == "Yes") {
    cout << "Yes" << endl;
  }
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 7)


Fixed submission:

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

int main() {
  string S;
  cin >> S;
  int len = S.size();
  for (int i = 0; i < (len + 1) / 2; i++) {
    if (S.at(i) == S.at(((len - 2) / 2) - i) && S.at(i) == S.at(len - 1 - i)) {
      continue;
    } else {
      cout << "No" << endl;
      break;
    }
    cout << "Yes" << endl;
  }
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

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

string S;

bool check(string str) {
  int len = str.length();
  int af = len / 2;
  for (int i = 0; i < af; i++) {
    if (str[i] != str[len - i - 1]) {
      return false;
    }
  }
  return true;
}

void Main() {
  int len = S.length();
  int af = len / 2;
  if (check(S) && check(S.substr(0, af))) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return;
}

int main() {

  cin >> S;
  Main();
  return 0;
}

Error: 1

Fixed submission:

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

string S;

bool check(string str) {
  int len = str.length();
  int af = len / 2;
  for (int i = 0; i < af; i++) {
    if (str[i] != str[len - i - 1]) {
      return false;
    }
  }
  return true;
}

void Main() {
  int len = S.length();
  int af = len / 2;
  if (check(S) && check(S.substr(0, af))) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return;
}

int main() {

  cin >> S;
  Main();
  return 1;
}
Problem p02730 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
bool f(string s) {
  string t = s;
  reverse(t.begin(), t.end());
  return s == t;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  bool ans = f(s);
  ans &= f(s.substr(0, n / 2));
  ans &= f(s.substr((n + 1) / 2));
  cout << (ans ? "Yes" : "No") << endl;
}

Error: WA

Fixed submission:

/******************************************
 * AUTHOR : Dharmveer Jakhar *
 * Handle : dvjakhar *
 * INSTITUTION : IIT (BHU) Varanasi *
 ******************************************/
#include <bits/stdc++.h>
using namespace std;
#define N 100005
#define mod 1000000007
#define dd double
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define debug(x) cout << (#x) << " is " << (x) << endl
#define lb(arr, n, x) lower_bound(arr, arr + n, x) - arr
#define ub(arr, n, x) upper_bound(arr, arr + n, x) - arr
#define endl "\\n"
#define PI 3.14159265358979323846 /* pi */
#define sqr(x) (x) * (x)
#define all(v) ((v).begin()), ((v).end())
#define degreesToRadians(angleDegrees)                                         \\
  (angleDegrees * PI / 180.0) // Converts degrees to radians.
#define radiansToDegrees(angleRadians)                                         \\
  (angleRadians * 180.0 / PI) // Converts radians to degrees.

typedef long long ll;
typedef long double ld;
// Calculation of (x^y)%mm

ll mod_exp(ll x, ll y, ll mm) {
  if (y == 0)
    return (1);
  else if (y % 2 == 0)
    return (mod_exp((x * x) % mm, y / 2, mm));
  else
    return ((x * mod_exp((x * x) % mm, (y - 1) / 2, mm)) % mm);
}

bool is_palindrome(string s) {
  string t = s;
  reverse(all(t));
  return s == t;
}

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

#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif

  string s;
  cin >> s;
  bool ans = is_palindrome(s);
  int n = s.length();
  ans &= is_palindrome(s.substr(0, n / 2));
  ans &= is_palindrome(s.substr((n + 1) / 2, n));

  cout << (ans ? ("Yes") : "No") << endl;
  return 0;
}
Problem p02731 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>

int main() {
  long long l;
  std::cin >> l;

  std::cout << std::setprecision(7) << std::fixed << std::pow(l, 3) / 27
            << std::endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>

int main() {
  long long l;
  std::cin >> l;

  l *= 1e3;
  long long ans = 0;
  for (long long a = 0; a < l; ++a) {
    for (long long b = 0; b < l - a; ++b) {
      ans = std::max(ans, a * b * (l - a - b));
    }
    //        std::cout << ans << std::endl;
  }

  std::cout << std::setprecision(7) << std::fixed << ans / 1e9 << std::endl;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  double a;
  cin >> a;
  double tt = double(a * a * a / 27);
  printf("%.12f\\n", tt);
  return 0;
}

Error: 1

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  float a;
  cin >> a;
  float tt = a / 3;
  float res = tt * tt;
  res *= tt;
  cout << res << endl;
  return res;
}
Problem p02731 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  double l;
  cin >> l;
  printf("%.12f\\n", pow(l / 3, 3.0));
}

Error: TLE

Fixed submission:

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

int main() {
  double l;
  cin >> l;
  double maxi = 0;
  for (double i = 0; i <= l / 3; i += 0.001) {
    for (double j = 0; j <= (l - i) / 2; j += 0.001) {
      maxi = max(maxi, i * j * (l - i - j));
    }
  }
  cout << maxi << endl;
}
Problem p02731 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
double v(double x, double a) {
  return x * (a - x) / 2.0 * (a - x - (a - x) / 2.0);
}
int main() {
  double l;
  std::cin >> l;
  double v_max = 0.0;
  for (double i = 0.0; i <= l / 3.0; i += 0.0001) {
    if (v_max < v(i, l)) {
      v_max = v(i, l);
    }
  }
  printf("%20.11f", v_max);
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
double volum(double x, double y, double a) { return x * y * (a - x - y); }
int main() {
  double l;
  std::cin >> l;
  double v_max = 0.0;

  for (double i = 0; i < l; i += 0.000001) {
    for (double j = 0; j < l - i; j += 0.000001) {
      if (v_max < volum(i, j, l)) {
        v_max = volum(i, j, l);
      }
    }
  }
  std::cout << v_max << std::endl;
  return 0;
}
Problem p02731 (C++) — buggy submission, verdict: Runtime Error

// AnkitCode99 here....
// every ups and downs matter!

#include <bits/stdc++.h>

#define endl "\\n"
typedef long long int ll;
#define MOD 1000000007
#define pll pair<ll, ll>
#define pb push_back
// max xor btw range of two numbers..
#define max_XOR(a, b) (1 << int(log2(a ^ b) + 1)) - 1
#define vl vector<ll>
#define inf ll(1e18)
#define all(v) v.begin(), v.end()
#define Ryuga                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
#define rep(i, a, b) for (long long int i = a; i < b; i++)
#define nrep(i, a, b) for (long long int i = a; i >= b; i--)
#define ceil(a, b) a / b + ((a % b == 0) ? 0 : 1)

using namespace std;

const ll sz = 100005;
const ll szz = 1000006;

int main() {
  Ryuga;

  ll L;
  cin >> L;
  cout << fixed << setprecision(12) << (L * L * L) / 27.0;

} // Goodbye...

Error: WA

Fixed submission:

// AnkitCode99 here....
// every ups and downs matter!

#include <bits/stdc++.h>

#define endl "\\n"
typedef long long int ll;
#define MOD 1000000007
#define pll pair<ll, ll>
#define pb push_back
// max xor btw range of two numbers..
#define max_XOR(a, b) (1 << int(log2(a ^ b) + 1)) - 1
#define vl vector<ll>
#define inf ll(1e18)
#define all(v) v.begin(), v.end()
#define Ryuga                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
#define rep(i, a, b) for (long long int i = a; i < b; i++)
#define nrep(i, a, b) for (long long int i = a; i >= b; i--)
#define ceil(a, b) a / b + ((a % b == 0) ? 0 : 1)

using namespace std;

const ll sz = 100005;
const ll szz = 1000006;

int main() {
  Ryuga;

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("op.txt", "w", stdout);
#endif

  ll L;
  cin >> L;
  cout << fixed << setprecision(12) << (L * L * L) / 27.0;

} // Goodbye...
Problem p02731 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

#include <algorithm>

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef long long ll;

const int MOD = 1000000007;
const int INF = 1000000007;
const ll INFLL = 1000000000000000007LL;

void solve() {
  int L;
  cin >> L;
  double d = (double)L / 3;
  cout << d * d * d << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  solve();

  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 1) > this->size() (which is 0)


Fixed submission:

#include <bits/stdc++.h>

#include <algorithm>

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef long long ll;

const int MOD = 1000000007;
const int INF = 1000000007;
const ll INFLL = 1000000000000000007LL;

bool check(string s) {
  string head = s.substr(0, s.size() / 2);
  string tail = s.substr(1 + (s.size() / 2), s.size() / 2);
  reverse(all(tail));
  return head == tail;
}

void solve() {
  string S;
  cin >> S;
  string ans = "No";
  string head = S.substr(0, S.size() / 2);
  string tail = S.substr(1 + (S.size() / 2), S.size() / 2);
  if (check(S) && check(head) && check(tail)) {
    ans = "Yes";
  }
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // cout << fixed << setprecision(12);

  solve();

  return 0;
}
Problem p02731 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iomanip>
#include <iostream>
#include <string>
using namespace std;

int main() {
  double l, max;
  cin >> l;
  max = l * l * l / 27;
  cout << setprecision(100) << max << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <string>
using namespace std;

int main() {
  double l, v, max;
  cin >> l;
  max = 0;
  for (double i(0); i < l; i = i + 0.001) {
    for (double j(0); j < (l - i); j = j + 0.001) {
      v = i * j * (l - i - j);
      if (v > max) {
        max = v;
      }
    }
  }
  cout << max << endl;
  return 0;
}
Problem p02731 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
typedef long long int ll;

using namespace std;

int main() {

  double L;

  cin >> L;

  double ans = (L / 3.) * (L / 3.) * (L / 3.);

  cout << setprecision(32) << ans << endl;

  return 0;
}

Error: 1

Fixed submission:

#include <iostream>
typedef long long int ll;

using namespace std;

int main() {

  double L;

  cin >> L;

  double ans = (L / 3.) * (L / 3.) * (L / 3.);

  return ans;

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

/* Sometimes you win , sometimes you learn . */
/* Sometimes you win , sometimes you learn . */
#include <bits/stdc++.h>
#define lp(i, N) for (ll i = 0; i < ll(N); i++)
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define debug(x) cout << " [ " << #x << " is: " << x << " ] " << endl;
using namespace std;
typedef long long ll;
typedef long double ld;
const long double EPS = 1e-6;
const long double pi = acos(-1);
int main() {
  FAST ld l;
  cin >> l;
  ld s = l / 3;
  cout << fixed << setprecision(12) << s * s * s << endl;
  return 0;
}
/*
[#]=============================================================[#]
         ___    ____              ____          ___ _
        |_ _|  / ___|__ _ _ __   |  _ \\  ___   |_ _| |_
         | |  | |   / _` | '_ \\  | | | |/ _ \\   | || __|
         | |  | |__| (_| | | | | | |_| | (_) |  | || |_
        |___|  \\____\\__,_|_| |_| |____/ \\___/  |___|\\__|
                     it's just about time

[#]=============================================================[#]
*/


Error: 0

Fixed submission:

/* Sometimes you win , sometimes you learn . */
/* Sometimes you win , sometimes you learn . */
#include <bits/stdc++.h>
#define lp(i, N) for (ll i = 0; i < ll(N); i++)
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define debug(x) cout << " [ " << #x << " is: " << x << " ] " << endl;
using namespace std;
typedef long long ll;
typedef long double ld;
const long double EPS = 1e-6;
const long double pi = acos(-1);
int main() {
  FAST ll l;
  cin >> l;
  vector<ld> ans;
  for (ll i = 1; i <= l; i++) {
    for (ll j = i; j <= l; j++) {
      for (ll h = j; h <= l; h++) {
        if (h + i + j == l)
          ans.push_back(i * j * h);
      }
    }
  }
  sort(ans.begin(), ans.end());
  cout << fixed << setprecision(12) << ans[(ans.size()) - 1] << endl;
  return 0;
}
/*
[#]=============================================================[#]
         ___    ____              ____          ___ _
        |_ _|  / ___|__ _ _ __   |  _ \\  ___   |_ _| |_
         | |  | |   / _` | '_ \\  | | | |/ _ \\   | || __|
         | |  | |__| (_| | | | | | |_| | (_) |  | || |_
        |___|  \\____\\__,_|_| |_| |____/ \\___/  |___|\\__|
                     it's just about time

[#]=============================================================[#]
*/
Problem p02731 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
#define prq priority_queue
#define foreach(it, c)                                                         \\
  for (__typeof((c).begin()) it = c.begin(); it != c.end(); it++)
// #define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
inline ll read() {
  ll x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-')
      f = -f;
  for (; isdigit(c); c = getchar())
    x = x * 10 + (c - '0');
  return x * f;
}
inline void out(int x) {
  if (x >= 10)
    out(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  // freopen("a.in","r",stdin);
  // freopen("a.out","w",stdout);
  ll l;
  cin >> l;
  ll a = l * l * l * (ll)1e9 / 27;
  string s = "";
  while (a > 0) {
    s += (a % 10 + '0');
    a /= 10;
  }
  reverse(all(s));
  if (s.size() < 9)
    cout << 0;
  else
    fo(i, 0, s.size() - 9) cout << s[i];
  cout << '.';
  if (s.size() < 9)
    cout << 0;
  if (s.size() < 8)
    cout << 0;
  if (s.size() < 7)
    cout << 0;
  fo(i, max(0, (int)s.size() - 9), s.size()) cout << s[i];
  cout << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
#define prq priority_queue
#define foreach(it, c)                                                         \\
  for (__typeof((c).begin()) it = c.begin(); it != c.end(); it++)
// #define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
inline ll read() {
  ll x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-')
      f = -f;
  for (; isdigit(c); c = getchar())
    x = x * 10 + (c - '0');
  return x * f;
}
inline void out(int x) {
  if (x >= 10)
    out(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  // freopen("a.in","r",stdin);
  // freopen("a.out","w",stdout);
  ll l;
  cin >> l;
  ll a = l * l * l * (ll)1e9 / 27;
  string s = "";
  while (a > 0) {
    s += (a % 10 + '0');
    a /= 10;
  }
  reverse(all(s));
  fo(i, 0, s.size() - 9) cout << s[i];
  cout << '.';
  fo(i, s.size() - 9, s.size()) cout << s[i];
  cout << endl;
  return 0;
}