Problem p02690 (C++) — buggy submission, verdict: Runtime Error

// Author: Fuadul Hasan(fuadul202@gmail.com)
// BSMRSTU,Gopalganj
#include <bits/stdc++.h>
using namespace std;
int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding cin.tie(0);
#define mp make_pair
#define ll long long
#define Pi atan(1) * 4
#define pb push_back
#define vpr vector<pr>
#define pr pair<int, int>
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\\n");
#define NO printf("NO\\n");
#define Yes printf("Yes\\n");
#define No printf("No\\n");
#define all(n) n.begin(), n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ", tc++);
#define Unique(c) (c).resize(unique(all(c)) - (c).begin())
#define vout(v)                                                                \\
  for (auto z : v)                                                             \\
    cout << z << " ";                                                          \\
  cout << endl;

const int M = 1e9 + 7;
const ll Inf = (ll)2e18 + 5;
const int N = 2e5 + 5;

int solve() {
  // happy coding

  int n;
  cin >> n;
  for (int i = 128; i >= -128; i--) {
    for (int j = -128; j <= 128; j++) {
      ll a = pow((ll)i, 5);
      ll b = pow((ll)j, 5);
      if (a - b == (ll)n) {
        // cout<<a<<" "<<b<<endl;
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }

  return 0;
}
int main() {
  int test = 1;
  // scanf("%d", &test);
  while (test--)
    solve();
  return 0;
}

Error: 0

Fixed submission:

// Author: Fuadul Hasan(fuadul202@gmail.com)
// BSMRSTU,Gopalganj
#include <bits/stdc++.h>
using namespace std;
int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding cin.tie(0);
#define mp make_pair
#define ll long long
#define Pi atan(1) * 4
#define pb push_back
#define vpr vector<pr>
#define pr pair<int, int>
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\\n");
#define NO printf("NO\\n");
#define Yes printf("Yes\\n");
#define No printf("No\\n");
#define all(n) n.begin(), n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ", tc++);
#define Unique(c) (c).resize(unique(all(c)) - (c).begin())
#define vout(v)                                                                \\
  for (auto z : v)                                                             \\
    cout << z << " ";                                                          \\
  cout << endl;

const int M = 1e9 + 7;
const ll Inf = (ll)2e18 + 5;
const int N = 2e5 + 5;

int solve() {
  // happy coding
  int a[63], b[63];
  for (int i = 1; i <= 63; i++) {
    a[i] = pow(i, 5);
  }
  for (int i = 1; i <= 63; i++) {
    b[i] = pow(-i, 5);
  }
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << " " << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= 63; i++) {
    for (int j = 1; j <= 63; j++) {
      if (a[j] - b[i] == n) {
        cout << j << " " << -i << endl;
        return 0;
      }
    }
  }
  for (int i = 1; i <= 63; i++) {
    for (int j = 1; j <= 63; j++) {
      if (a[i] - a[j] == n) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }

  return 0;
}
int main() {
  int test = 1;
  // scanf("%d", &test);
  while (test--)
    solve();
  return 0;
}