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

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
template <class _T> inline void read(_T &_a) {
  bool f = 0;
  char _c = getchar();
  _a = 0;
  while (_c < '0' || _c > '9') {
    if (_c == '-')
      f = 1;
    _c = getchar();
  }
  while (_c >= '0' && _c <= '9') {
    _a = (_a << 3) + (_a << 1) - '0' + _c;
    _c = getchar();
  }
  if (f)
    _a = -_a;
}

const int MAXN = 1000002;
long long calc[1201], n;

int main() {
  read(n);
  for (register long long i = 1; i <= 120; ++i)
    calc[i] = (long long)pow(i, 5);
  for (register int i = 0; i <= 120; ++i) {
    for (register int j = 0; j <= 120; ++j) {
      if (calc[i] - calc[j] == n) {
        printf("%d %d", i, j);
        return 0;
      }
      if (calc[i] + calc[j] == n) {
        printf("%d %d", i, -j);
        return 0;
      }
      if (-calc[i] - calc[j] == n) {
        printf("%d %d", -i, j);
        return 0;
      }
    }
  }
  return 0;
}

Error: WA

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
template <class _T> inline void read(_T &_a) {
  bool f = 0;
  char _c = getchar();
  _a = 0;
  while (_c < '0' || _c > '9') {
    if (_c == '-')
      f = 1;
    _c = getchar();
  }
  while (_c >= '0' && _c <= '9') {
    _a = (_a << 3) + (_a << 1) - '0' + _c;
    _c = getchar();
  }
  if (f)
    _a = -_a;
}

const int MAXN = 1000002;
long long calc[71], n;

int main() {
  read(n);
  for (register long long i = 1; i <= 120; ++i)
    calc[i] = (long long)pow(i, 5);
  for (register int i = 0; i <= 120; ++i) {
    for (register int j = 0; j <= 120; ++j) {
      if (calc[i] - calc[j] == n) {
        printf("%d %d", i, j);
        return 0;
      }
      if (calc[i] + calc[j] == n) {
        printf("%d %d", i, -j);
        return 0;
      }
      if (-calc[i] - calc[j] == n) {
        printf("%d %d", -i, j);
        return 0;
      }
    }
  }
  return 0;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;

const double pi = 3.1415;
ll absc(ll a, ll b) { return (a - b > 0 ? a - b : b - a); }
ll mini(ll a, ll b) { return (a > b ? b : a); }
ll gcd(ll a, ll b) {
  if (a < b)
    swap(a, b);
  return (a % b ? gcd(a % b, b) : b);
}
ll gojou(ll n) { return pow(n, 5); }
int main() {
  ll x, ans1 = 0, ans2 = 0;
  cin >> x;
  bool f = false;
  for (ll i = -200; i < 200; i++) {
    for (ll j = -200; j < 200; j++) {
      if (gojou(i) - gojou(j) == x) {
        ans1 = i;
        ans2 = j;
        f = true;
      }
      if (f)
        break;
    }
    if (f)
      break;
  }
  cout << ans1 << " " << ans2;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;

const double pi = 3.1415;
ll absc(ll a, ll b) { return (a - b > 0 ? a - b : b - a); }
ll mini(ll a, ll b) { return (a > b ? b : a); }
ll gcd(ll a, ll b) {
  if (a < b)
    swap(a, b);
  return (a % b ? gcd(a % b, b) : b);
}
ll gojou(ll n) { return pow(n, 5); }
int main() {
  ll x, ans1 = 0, ans2 = 0;
  cin >> x;
  bool f = false;
  for (ll i = -50; i < 50; i++) {
    for (ll j = -50; i < 50; j++) {
      if (gojou(i) - gojou(j) == x) {
        ans1 = i;
        ans2 = j;
        f = true;
      }
      if (f)
        break;
    }
    if (f)
      break;
  }
  cout << ans1 << " " << ans2;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

int main() {
  ll X;
  cin >> X;
  ll ans_a, ans_b;
  for (ll A = -200; A < 200; A++) {
    for (ll B = -200; B < 200; B++) {
      if ((pow(A, 5) - pow(B, 5)) == X) {
        ans_a = A;
        ans_b = B;
      }
    }
  }
  cout << ans_a << " " << ans_b << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool is_integer(long double x) { return floor(x) == x; }

bool gojou(long long N) {
  long double a;
  a = pow(N, 1.0 / 5.0);
  return (is_integer(a));
}

int main() {
  long long X;
  cin >> X;
  ll ans_a, ans_b;
  ans_a = -111;
  ans_b = -222;
  // B>0のとき
  for (ll A = 0; A <= pow(10, 9); A++) {
    ll B_5 = pow(A, 5) - X;
    if (B_5 <= 0)
      continue;
    if (gojou(B_5)) {
      ans_a = A;
      ans_b = floor(pow(B_5, 1.0 / 5.0));
    }
  }
  // B<0のとき
  for (ll B = 0; B >= -pow(10, 9); B--) {
    ll A_5 = X + pow(B, 5);
    if (A_5 <= 0)
      continue;
    if (gojou(A_5)) {
      ans_a = floor(pow(A_5, 1.0 / 5.0));
      ans_b = B;
    }
  }
  cout << ans_a << " " << ans_b << endl;
}
Problem p02690 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

// ショートハンド
// #define ll intに変えればメモリ節約
#define ll long long

/*
 * ループ系のマクロ
 * `REP(i, 10) { cout << i; }`のように、変数名,回数で動く
 */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define EACH(i, n) for (auto &&i : n)

/*
 * 正規表現系
 */
#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement)                                      \\
  regex_replace(_str, regex(_ptn), _replacement)
const int MAX = 510000;
const int MOD = 1e9 + 7;

ll fac[MAX], finv[MAX], inv[MAX];

ll power(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll x;
  cin >> x;
  for (int i = 119; i >= 0; i--) {
    int powI = i * i * i * i * i;
    for (int j = i - 1; j > -120; j--) {
      int res = powI - j * j * j * j * j;
      if (res == x) {
        cout << i << " " << j;
        return 0;
      }
    }
  }
  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;
#define ll long long
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
ll n, a[200000], b[100000][2], c[50000][2], d[50000][2], nb, nc, nd, cnt;
int main() {
  cin >> n;
  REP(i, n) {
    b[i / 8 / 8 / 8][0] = 20000000000;
    c[i / 8 / 8 / 8][0] = 20000000000;
    d[i / 8][0] = 20000000000;
  }
  REP(i, n) {
    ll tmp;
    cin >> tmp;
    a[i] = tmp;
    chmin(b[i / 8 / 8 / 8][1], tmp);
    chmax(b[i / 8 / 8 / 8][0], tmp);
    chmax(c[i / 8 / 8 / 8][1], tmp);
    chmin(c[i / 8 / 8 / 8][0], tmp);
    chmax(d[i / 8][1], tmp);
    chmin(d[i / 8][0], tmp);
    nb = i / 8 / 8 / 8;
    nc = i / 8 / 8 / 8;
    nd = i / 8;
  }
  REP(i, n) {
    REPS(ic, i / 8 / 8 / 8, nc + 1) {
      ll iic = 8 * 8 * 8 * ic;
      ll iic2 = 8 * 8 * 8 * (ic + 1);
      if (iic - i <= c[ic][1] + a[i] && iic2 - i >= c[ic][0] + a[i]) {
        REPS(id, iic / 8, iic2 / 8) {
          ll iid = 2 * 2 * 2 * id;
          ll iid2 = 2 * 2 * 2 * (id + 1);
          if (iid - i <= d[id][1] + a[i] && iid2 - i >= d[id][0] + a[i]) {
            REPS(j, max(i + 1, iid), min(iid2, n)) {
              if (a[i] + a[j] == j - i) {
                cnt++;
              }
            }
          }
        }
      }
    }
  }
  cout << fixed << cnt;
}
Problem p02690 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int main() {

  int X;
  cin >> X;

  for (int i = -120; i <= 120; ++i) {
    for (int j = -120; j <= 120; ++j) {
      if (pow(i, 5) - pow(j, 5) == X) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }

  return 0;
}


Error: WA

Fixed submission:

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

#define FASTIO                                                                 \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define pll pair<ll, ll>
#define vl(p) vector<p>
#define W while
#define For(i, s, x) for (i = s; i < x; i++)
#define Fore(i, s, x) for (i = s; i <= x; i++)
#define FOR(i, x) for (i = 0; i < x; i++)
#define Rof(i, s, x) for (i = s; i >= x; i--)
#define all(v) v.begin(), v.end()
#define it(r, v) for (auto r = v.begin(); r != v.end(); r++)
#define pb push_back
#define in insert
#define sz size()
#define F first
#define S second
#define nl cout << "\\n"
#define pr(a) cout << a << " "
#define pr2(a, b) cout << a << " " << b << "\\n"
#define pr3(a, b, c) cout << a << " " << b << " " << c << "\\n"
#define mod 1000000007
#define mp make_pair

int main() {
  ll x;
  cin >> x;
  ll a[501], i, b[501], c, flag = 0, j;
  for (i = 0; i < 301; i++) {
    a[i] = i * i * i * i * i;
    b[i] = -a[i];
  }
  for (i = 0; i < 501; i++) {
    c = a[i] - x;
    if (c < 0) {
      for (j = 0; j < 501; j++) {
        if (c == b[j]) {
          //  pr2(a[i],b[j]);
          pr2(a[i] / (i * i * i * i), b[j] / (j * j * j * j));
          flag = 1;
          break;
        }
      }
    } else {
      for (j = 0; j < 501; j++) {
        if (c == a[j]) {
          pr2(a[i] / (i * i * i * i), a[j] / (j * j * j * j));
          flag = 1;
          break;
        }
      }
    }
    if (flag == 1)
      break;
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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;
}

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll << 61;
double pi = 3.141592653589793238;

void calc(int x) {
  repI(i, -200, 200) {
    repI(j, -200, 200) {
      if (pow(i, 5) - pow(j, 5) == x) {
        cout << i << " " << j << endl;
        return;
      }
    }
  }
  return;
}

int main() {
  ll x;
  cin >> x;
  calc(x);

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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;
}

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll << 61;
double pi = 3.141592653589793238;

int main() {
  ll x;
  cin >> x;
  ll ansB;
  ll ansA;
  bool flag = true;
  ll cnt = floor(0.5 * pow(x, 0.2));
  while (flag) {
    rep(i, 2) {
      cnt = -cnt;
      double fig = pow(pow(cnt, 5) + x, 0.2);
      if (floor(fig) == fig) {
        ansB = cnt;
        ansA = ll(fig);
        flag = false;
        break;
      }
    }
    cnt++;
  }

  cout << ansA << " " << ansB << endl;

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

#include <bits/stdc++.h>

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

int main() {
  int64_t x;
  std::cin >> x;

  for (int64_t a = -120; a <= 120; a++) {
    for (int64_t b = -120; b <= 120; b++) {
      if (a * a * a * a * a - b * b * b * b * b == x) {
        std::cout << a << " " << b << std::endl;
        return 0;
      }
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

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

int main() {
  int64_t x;
  std::cin >> x;

  int64_t i = 1;

  while (true) {
    const auto a5 = i * i * i * i * i;
    const auto b5 = a5 - x;

    if (b5 < 0) {
      const int64_t b = std::round(std::pow(-b5, -5));
      if (b * b * b * b * b == -b5) {
        std::cout << i << " " << -b << std::endl;
        break;
      }
    } else if (b5 == 0) {
      std::cout << i << " " << 0 << std::endl;
      break;
    } else {
      const int64_t b = std::round(std::pow(b5, -5));
      if (b * b * b * b * b == b5) {
        std::cout << i << " " << b << std::endl;
        break;
      }
    }
    i++;
  }

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

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

#define E "\\n"
#define int long long
#define f(i, l, n) for (int i = l; i < n; i++)

int Pow(int b, int n) {
  int ans = 1, x = b; // here ans and x should be long long
  while (n) {
    if (n % 2 == 1)
      ans = ((ans * x));
    x = ((x * x));
    n = n >> 1;
  }
  if (x == 0)
    ans = 0;
  return (int)ans;
}

int fifth(int n) {
  if (n == 0 || n == 1)
    return 1;
  n = abs(n);
  int low = 1, high = sqrt(sqrt(n));

  while (low <= high) {
    int mid = (low + high) / 2;
    int p = Pow(mid, 5);
    if (p == n)
      return mid;
    else if (p > n)
      high = mid - 1;
    else
      low = mid + 1;
  }
  return 0;
}

int x;
bool chk(int a, int b) {
  int d = fifth(b);
  if (d == 0 and b != 0)
    return false;
  if (b < 0)
    d = -d;
  cout << a << " " << d << E;
  exit(0);
}
int solve() {

  cin >> x;

  int i = 1;
  if (x == 1)
    return cout << "1 0", 0;
  for (int i = -1000; i <= 1000; i++) {
    int b = x - Pow(i, 5);
    if (chk(i, -b))
      return cout << i << " " << b, 0;
  }

  return 0;
}

int32_t main() {
  int t = 1;
  // cin >>t;
  while (t--)
    solve();
}

Error: TLE

Fixed submission:

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

#define E "\\n"
#define int long long
#define f(i, l, n) for (int i = l; i < n; i++)

int Pow(int b, int n) {
  int ans = 1, x = b; // here ans and x should be long long
  while (n) {
    if (n % 2 == 1)
      ans = ((ans * x));
    x = ((x * x));
    n = n >> 1;
  }
  if (x == 0)
    ans = 0;
  return (int)ans;
}

int fifth(int n) {
  int low = 1, high = sqrt(sqrt(n));

  while (low <= high) {
    int mid = (low + high) / 2;
    int p = Pow(mid, 5);
    if (p == n)
      return mid;
    else if (p > n)
      high = mid - 1;
    else
      low = mid + 1;
  }
  return 0;
}

int x;
bool chk(int a, int b) {
  // cout<<a<<" "<<b<<E;
  int d = fifth(b);
  // cout<<d<<E;
  if (d == 0)
    return false;
  cout << a << " " << -d << E;
  exit(0);
  // b=d;
  // if(x%(a-b)!=0) return false;
  // int temp=x/(a-b);
  // int tmp=Pow(a,4);
  // tmp+=Pow(a,3)*b;
  // tmp+=a*a*b*b;
  // tmp+=a*Pow(b,3);
  // tmp+=Pow(b,4);

  // return (tmp==temp);
}
int solve() {

  cin >> x;

  int i = 1;
  for (int i = 0;; i++) {
    int b = x - Pow(i, 5);
    if (chk(i, b))
      return cout << i << " " << b, 0;
  }

  return 0;
}

int32_t main() {

  int t = 1;
  // cin >>t;
  while (t--)
    solve();
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\\n'
#define ll long long
#define f first
#define int long long
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z << endl
#define debug4(x, y, z, o)                                                     \\
  cout << "DEBUG " << x << " " << y << " " << z << " " << o << endl
using namespace std;
typedef pair<ll, ll> pii;
typedef vector<vector<ll>> mat;
const ll mod = 1e9 + 7;
const int MAXN = 1e5 + 5;

ll expo(ll a, ll b) {
  if (b == 0)
    return 1;
  ll x = expo(a, b / 2);
  return (b & 1 ? ((x * x) * a) : (x * x));
}

int32_t main() {
  ll x;
  cin >> x;
  for (ll i = -1500; i <= 1500; i++)
    for (ll j = -1500; j <= 1500; j++)
      if ((expo(i, 5) - expo(j, 5)) == x) {
        cout << i << " " << j << endl;
        return 0;
      }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\\n'
#define ll long long
#define f first
#define int long long
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z << endl
#define debug4(x, y, z, o)                                                     \\
  cout << "DEBUG " << x << " " << y << " " << z << " " << o << endl
using namespace std;
typedef pair<ll, ll> pii;
typedef vector<vector<ll>> mat;
const ll mod = 1e9 + 7;
const int MAXN = 1e5 + 5;

ll expo(ll a, ll b) {
  if (b == 0)
    return 1;
  ll x = expo(a, b / 2);
  return (b & 1 ? ((x * x) % mod * a) % mod : (x * x) % mod);
}

int32_t main() {
  ll x;
  cin >> x;
  for (ll i = -5000; i <= 5000; i++)
    for (ll j = -5000; j <= 5000; j++)
      if ((expo(i, 5) - expo(j, 5)) == x) {
        cout << i << " " << j << endl;
        return 0;
      }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <set>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl

int main() {
  ll x;
  cin >> x;
  for (ll a = 0; a <= 10000; a++) {
    for (ll b = -10000; b <= 10000; b++) {
      ll a5 = a * a * a * a * a;
      ll b5 = b * b * b * b * b;
      if (a5 - b5 == x) {
        cout << fixed << a << " " << b << endl;
        return 0;
      }
    }
  }

  cout << fixed << "no" << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <set>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl

int main() {
  ll x;
  cin >> x;
  for (ll a = -50000; a <= 50000; a++) {
    for (ll b = 0; b <= 50000; b++) {
      ll a5 = a * a * a * a * a;
      ll b5 = b * b * b * b * b;
      if (a5 - b5 == x) {
        cout << fixed << a << " " << b << endl;
        return 0;
      }
    }
  }

  cout << fixed << "no" << endl;
  return 0;
}