alexjercan/bugnet huggingface dataset:
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define ff first
#define ss second
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define pb push_back
#define mp make_pair
#define inf 2000000009
#define mod 1000000007
#define ld long double
using namespace std;

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

  for (ll a = -2000; a <= 2000; a++)
    for (ll b = -2000; b <= 2000; b++)
      if (a * a * a * a * a - b * b * b * b * b == x) {
        cout << a << " " << b << endl;
        return 0;
      }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define ff first
#define ss second
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define pb push_back
#define mp make_pair
#define inf 2000000009
#define mod 1000000007
#define ld long double
using namespace std;

ll root(ll x) {
  ll l = 0, r = 1000;
  ll ans = inf;

  while (l <= r) {
    ll mid = l + (r - l) / 2;

    ll z = pow(mid, 5);

    if (z == x) {
      ans = mid;
      break;
    } else if (z > x)
      r = mid - 1;
    else
      ans = min(ans, mid), l = mid + 1;
  }
  return ans;
}

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

  ll a, b = 0;
  ll ansa = -1, ansb = -1;

  while (x + pow(b, 5) >= 0) {
    ll z = x + pow(b, 5);
    ll req = root(z);

    if (pow(req, 5) == z) {
      ansa = req, ansb = b;
      break;
    }
    b--;
  }

  if (ansa != -1) {
    cout << ansa << " " << ansb << endl;
    return 0;
  }

  b = 1;
  while (1) {
    ll z = x + pow(b, 5);
    ll req = root(z);

    if (pow(req, 5) == z) {
      cout << req << " " << b << endl;
      break;
    }
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
struct __INIT {
  __INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} __init;
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
constexpr int MOD = 1000000007;
#define INF (1 << 30)
#define LINF (lint)(1LL << 56)
#define endl "\\n"
#define rep(i, n) for (lint(i) = 0; (i) < (n); (i)++)
#define reprev(i, n) for (lint(i) = (n - 1); (i) >= 0; (i)--)
#define Flag(x) (1 << (x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int, int>
#define pdouble pair<double, double>
#define plint pair<lint, lint>
#define fi first
#define se second
typedef long long lint;
int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int MAX_N = 2e5 + 5;

int main(void) {
  lint X;
  cin >> X;
  for (lint i = -4000; i <= 4000; i++)
    for (lint j = -4000; j <= 4000; j++) {
      if ((i * i * i * i * i) - (j * j * j * j * j) == X) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  return -1;
}

Error: TLE

Fixed submission:

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
struct __INIT {
  __INIT() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} __init;
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
constexpr int MOD = 1000000007;
#define INF (1 << 30)
#define LINF (lint)(1LL << 56)
#define endl "\\n"
#define rep(i, n) for (lint(i) = 0; (i) < (n); (i)++)
#define reprev(i, n) for (lint(i) = (n - 1); (i) >= 0; (i)--)
#define Flag(x) (1 << (x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int, int>
#define pdouble pair<double, double>
#define plint pair<lint, lint>
#define fi first
#define se second
typedef long long lint;
int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int MAX_N = 2e5 + 5;

int main(void) {
  lint X;
  cin >> X;
  lint b = 1;
  while (true) {
    lint num1 = X - pow(b, 5);
    lint num2 = X + pow(b, 5);
    lint a1 = pow(num1, 0.2);
    lint a2 = pow(num2, 0.2);
    if (a1 == pow(num1, 0.2)) {
      cout << a1 << " " << -b << endl;
      return 0;
    }
    if (a2 == pow(num2, 0.2)) {
      cout << a2 << " " << b << endl;
      return 0;
    }
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

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

#define vint vector<int>
#define vvint vector<vint>
#define rep(i, n) for (int i = 0; i < (int)(n); i++) // 繰り返し処理
#define all(x) (x).begin(), (x).end() // 全体 こんな感じで使う→sort(all(a));
#define ct(a) cout << a << endl
#define iceil(a, b)                                                            \\
  (a + (b - 1)) /                                                              \\
      b // int ceil : 繰り上げの割り算
        // 通常のceilではceil((7.0/2.0))のようにしなければならなかった。
vint CinLine(int N) {
  vint v(N);
  for (int i = 0; i < N; i++) {
    cin >> v.at(i);
  }
  return v;
} // cin line 連続でvectorに格納
void CoutLine(vint v) {
  for (int i = 0; i < v.size() - 1; i++) {
    cout << v.at(i) << " ";
  }
  cout << v.at(v.size() - 1) << endl;
}

void Main() {
  int x;
  cin >> x;
  int a, b;
  bool f = true;
  for (a = -120; a <= 120; a++) {
    for (b = -120; b <= 120; b++) {
      if ((pow(a, 5) - pow(b, 5)) == x) {
        f = false;
        break;
      }
    }
    if (!f) {
      break;
    }
  }
  cout << a << " " << b << endl;
}

int main() { Main(); }

Error: TLE

Fixed submission:

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

#define vint vector<int>
#define vvint vector<vint>
#define rep(i, n) for (int i = 0; i < (int)(n); i++) // 繰り返し処理
#define all(x) (x).begin(), (x).end() // 全体 こんな感じで使う→sort(all(a));
#define ct(a) cout << a << endl
#define iceil(a, b)                                                            \\
  (a + (b - 1)) /                                                              \\
      b // int ceil : 繰り上げの割り算
        // 通常のceilではceil((7.0/2.0))のようにしなければならなかった。
vint CinLine(int N) {
  vint v(N);
  for (int i = 0; i < N; i++) {
    cin >> v.at(i);
  }
  return v;
} // cin line 連続でvectorに格納
void CoutLine(vint v) {
  for (int i = 0; i < v.size() - 1; i++) {
    cout << v.at(i) << " ";
  }
  cout << v.at(v.size() - 1) << endl;
}

void Main() {
  int x;
  cin >> x;
  int a, a5;
  int b = 0;
  while (true) {
    if (b == 0) {
      a5 = x + pow(b, 5);
      a = pow(a5, 0.2);
      if ((pow(a, 5) - pow(b, 5)) == x) {
        break;
      }
    }
    b++;
    a5 = x + pow(b, 5);
    a = pow(a5, 0.2);
    if ((pow(a, 5) - pow(b, 5)) == x) {
      break;
    }
    b = -b;
    a5 = x + pow(b, 5);
    a = pow(a5, 0.2);
    if ((pow(a, 5) - pow(b, 5)) == x) {
      break;
    }
    b = -b;
  }
  cout << a << " " << b << endl;
}

int main() { Main(); }
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int A, B;
  int X;
  cin >> X;
  for (int i = 0; i <= 1000; i++) {
    A = pow(i, 5);
    for (int j = 0; j <= 1000; j++) {
      B = pow(j, 5);
      if (A - B == X) {
        cout << i << " " << j << endl;
        return 0;
      } else if (A + B == X) {
        cout << i << " " << -j << endl;
        return 0;
      } else if (-A + B == X) {
        cout << -i << " " << -j << endl;
        return 0;
      }
    }
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, A, B;
  cin >> X;
  for (int i = 0; i <= X; i++) {
    A = pow(i, 5);
    for (int j = 0; j <= X; j++) {
      B = pow(j, 5);
      if (A - B == X) {
        cout << i << " " << j << endl;
        return 0;
      } else if (A + B == X) {
        cout << i << " " << -j << endl;
        return 0;
      } else if (-A + B == X) {
        cout << -i << " " << -j << endl;
        return 0;
      }
    }
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

//
//  header_useful.h
//  c++_acm
//
//  Created by 李弘辰 on 2019/7/23.
//  Copyright © 2019 李弘辰. All rights reserved.
//

#include <algorithm> // sort
#include <bitset>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility> // pair
#include <vector>

using namespace std;

#define ll long long
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
#define ull unsigned long long

#define INT_INF 0x7fffffff

#define pi acos(-1)

#define mx(a, b) (a) > (b) ? (a) : (b)
#define mn(a, b) (a) < (b) ? (a) : (b)
#define mem(a, b) memset(a, b, sizeof(a))
#define fre(a) freopen(a, "r", stdin)

#define cio                                                                    \\
  ios::sync_with_stdio(false); // Do not use it with "scanf" and other c input!

#define itn int
#define nit int
#define inr int
#define mian main
#define ednl endl
#define fro for
#define fir for
#define reutrn return
#define retunr return
#define reutnr return

/* header_useful_h */

int main() {
  ll x;
  scanf("%lld", &x);
  for (ll a = -500; a <= 500; a++) {
    for (ll b = -500; b <= 500; b++) {
      if (a * a * a * a * a - b * b * b * b * b == x) {
        printf("%lld %lld\\n", a, b);
        return 0;
      }
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

//
//  header_useful.h
//  c++_acm
//
//  Created by 李弘辰 on 2019/7/23.
//  Copyright © 2019 李弘辰. All rights reserved.
//

#include <algorithm> // sort
#include <bitset>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility> // pair
#include <vector>

using namespace std;

#define ll long long
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
#define ull unsigned long long

#define INT_INF 0x7fffffff

#define pi acos(-1)

#define mx(a, b) (a) > (b) ? (a) : (b)
#define mn(a, b) (a) < (b) ? (a) : (b)
#define mem(a, b) memset(a, b, sizeof(a))
#define fre(a) freopen(a, "r", stdin)

#define cio                                                                    \\
  ios::sync_with_stdio(false); // Do not use it with "scanf" and other c input!

#define itn int
#define nit int
#define inr int
#define mian main
#define ednl endl
#define fro for
#define fir for
#define reutrn return
#define retunr return
#define reutnr return

/* header_useful_h */

int main() {
  ll x;
  scanf("%lld", &x);
  ll a = -100;
  ll y, b;
  int f = 0;
  while (1) {
    y = a * a * a * a * a - x;
    if (y < 0) {
      f = 1;
      y = -y;
    }
    b = pow(y, 0.2);
    if (f) {
      b = -b;
      y = -y;
      f = 0;
    }
    if (y * y * y * y * y == a * a * a * a * a - x) {
      printf("%lld %lld\\n", a, y);
      break;
    }
    a++;
  }
  return 0;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string.h>
#include <vector>

using namespace std;

long long i, j, k, n, m, N, M, ans, X, A, B;

double x;

int main() {
  cin >> X;

  A = 0;
  B = 0;

  for (i = 0; i <= X; i++) {
    N = i * i * i * i * i;
    if (2 * N >= X) {
      n = i;
      break;
    }
  }

  for (i = n; i <= X; i++) {
    for (j = 0; j <= i; j++) {
      N = i * i * i * i * i;
      M = j * j * j * j * j;
      if (N - M == X) {
        A = i;
        B = j;
        break;
      } else if (N + M == X) {
        A = i;
        B = -j;
        break;
      } else if (-N - M == X) {
        A = -i;
        B = j;
        break;
      } else if (-N + M == X) {
        A = -i;
        B = -j;
        break;
      }
    }

    if (A != 0)
      break;
  }

  cout << A << " " << B;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string.h>
#include <vector>

using namespace std;

long long i, j, k, n, m, N, M, ans, X, A, B;

double x;

int main() {
  cin >> X;

  A = 0;
  B = 0;

  for (i = 0; i <= X; i++) {
    N = i * i * i * i * i;
    if (2 * N >= X) {
      n = i;
      break;
    }
  }

  for (i = n; i <= X; i++) {
    for (j = 0; j <= n; j++) {
      N = i * i * i * i * i;
      M = j * j * j * j * j;
      if (N - M == X) {
        A = i;
        B = j;
        break;
      } else if (N + M == X) {
        A = i;
        B = -j;
        break;
      } else if (-N - M == X) {
        A = -i;
        B = j;
        break;
      } else if (-N + M == X) {
        A = -i;
        B = -j;
        break;
      }
    }

    if (A != 0)
      break;
  }

  cout << A << " " << B;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

// Winners don't quit and Quitters don't win
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<int>
#define vll vector<ll>
#define mod 998244353
#define MAX 100005
vll adj[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll x, i, j, a, b;
  cin >> x;
  for (i = 0;; ++i) {
    for (j = -100; j <= i; ++j) {
      if ((pow(i, 5) - pow(j, 5)) == x) {
        a = i;
        b = j;
        cout << a << " " << b;
        return 0;
      }
      if ((pow(i, 5) - pow(j, 5)) < x) {
        break;
      }
    }
  }
}

Error: TLE

Fixed submission:

// Winners don't quit and Quitters don't win
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<int>
#define vll vector<ll>
#define mod 998244353
#define MAX 100005
vll adj[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll x, i, j, a, b;
  cin >> x;
  for (i = 0;; ++i) {
    for (j = -1; j <= i; ++j) {
      if ((pow(i, 5) - pow(j, 5)) == x) {
        a = i;
        b = j;
        cout << a << " " << b;
        return 0;
      }
      if ((pow(i, 5) - pow(j, 5)) < x) {
        break;
      }
    }
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef long double ld;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF ll(1e18)
#define MOD (ll)1e9 + 7
#define print(a)                                                               \\
  ;                                                                            \\
  for (auto x : a)                                                             \\
    cout << x << " ";                                                          \\
  cout << "\\n";
#define mset(a)                                                                \\
  ;                                                                            \\
  memset(a, 0, sizeof(a));

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll x;
  cin >> x;
  for (ll i = -118; i <= 119; i++) {
    for (ll j = -119; j <= 118; j++) {
      if (pow(i, 5) - pow(j, 5) == x) {
        cout << i << " " << j << "\\n";
        return 0;
      }
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef long double ld;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF ll(1e18)
#define MOD (ll)1e9 + 7
#define print(a)                                                               \\
  ;                                                                            \\
  for (auto x : a)                                                             \\
    cout << x << " ";                                                          \\
  cout << "\\n";
#define mset(a)                                                                \\
  ;                                                                            \\
  memset(a, 0, sizeof(a));

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll x;
  cin >> x;
  for (ll i = -3000; i <= 3000; i++) {
    for (ll j = -3000; j <= 3000; j++) {
      if (pow(i, 5) - pow(j, 5) == x) {
        cout << i << " " << j << "\\n";
        return 0;
      }
    }
  }
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  long long int x, a, b;
  cin >> x;
  for (a = -200; a <= 200; a++)
    for (b = -200; b <= 200; b++)
      if (a * a * a * a * a - b * b * b * b * b == x) {
        cout << a << " " << b;
        return 0;
      }
}

Error: TLE

Fixed submission:

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int x;
  cin >> x;
  int a = 0, b = 0;
  while (pow(a, 5) - pow(b, 5) != x) {
    a++;
    while (pow(a, 5) - pow(b, 5) != x) {
      b++;
    }
  }
  cout << a << " " << b;
  return 0;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long X;
  cin >> X;
  long long A, B;
  long long A5, B5;
  int tr = 0;
  for (A = 0; A < 1001; A++) {
    A5 = A * A * A * A * A;
    for (B = -1000; B < 1001; B++) {
      B5 = B * B * B * B * B;
      if (A5 - B5 == X) {
        tr = 1;
        break;
      } else if (A5 - B5 < X) {
        break;
      }
    }
    if (tr)
      break;
  }
  cout << A << " " << B << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  long long X;
  cin >> X;
  int isEv = X % 2 ? 0 : 1;
  long long A = 1, B = 0;
  long long A5, B5;
  while (1) {
    A5 = A * A * A * A * A;
    while (A5 - B5 > X) {
      B++;
      if (X % (A - B) != 0 || isEv == (A % 2 != B % 2))
        continue;
      B5 = B * B * B * B * B;
    }
    if (A5 - B5 == X) {
      break;
    } else {
      B = -1;
      while (A5 - B5 < X) {
        B--;
        if (X % (A - B) != 0 || isEv == (A % 2 != B % 2))
          continue;
        B5 = B * B * B * B * B;
      }
      if (A5 - B5 == X) {
        break;
      }
    }
    A5++;
    B5 = 0;
  }
  cout << A << " " << B << endl;
  return 0;
}
Problem p02690 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using llong = long long;

llong f(llong x) { return x * x * x * x * x; }

int main() {
  llong x;
  cin >> x;

  for (int i = -1000; i <= 1000; i++) {
    llong y = x + f(i);

    for (int j = 0; j <= 1024; j++) {
      if (f(j) == y) {
        cout << j << ' ' << i << endl;
        return 0;
      }
    }
  }

  return 1;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using llong = long long;

llong f(llong x) { return x * x * x * x * x; }

int main() {
  llong x;
  cin >> x;

  for (llong i = -64; i <= 64; i++) {
    for (llong j = -64; j <= 64; j++) {
      if (f(i) - f(j) == x) {
        cout << i << ' ' << j << endl;
        return 0;
      }
    }
  }

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

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

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

  ll ans_a = 0;
  ll ans_b = 0;
  for (int i = -200; i <= 200; i++) {
    ll k = pow(i, 5);
    k -= x;
    if (k < 0) {
      k = 0 - k;
      ll z = pow(k, 1.0 / 5.0);
      if (pow(z, 5) == k) {
        ans_a = i;
        ans_b = 0 - z;
        break;
      }
    } else {
      ll z = pow(k, 1.0 / 5.0);
      if (pow(z, 5) == k) {
        ans_a = i;
        ans_b = 0 - z;
        break;
      }
    }
  }

  cout << ans_a << " " << ans_b << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  ll x;
  cin >> x;
  ll k = pow(x, 1.0 / 5.0);
  k++;

  ll ans_a = 0;
  ll ans_b = 0;
  while (1) {
    ll z = x + pow(k, 5);
    ll a = pow(z, 1.0 / 5.0);
    if (pow(a, 5) == z) {
      ans_a = a;
      ans_b = k;
      break;
    }
    k--;
  }

  cout << ans_a << " " << ans_b << endl;
}
Problem p02690 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <vector>

#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

int inputValue() {
  int a;
  cin >> a;
  return a;
};

void inputArray(int *p, int a){rep(i, a){cin >> p[i];
}
}
;

long long inputValueLongLong() {
  long long a;
  cin >> a;
  return a;
};

void inputVector(vector<int> *p, int a) {
  rep(i, a) {
    int input;
    cin >> input;
    p->push_back(input);
  }
}

void inputVectorString(vector<string> *p, long long a) {
  rep(i, a) {
    string input;
    cin >> input;
    p->push_back(input);
  }
}

template <typename T> void output(T a, int precision) {
  if (precision > 0) {
    cout << setprecision(precision) << a << "\\n";
  } else {
    cout << a << "\\n";
  }
}

const long long MOD = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7;

int main(int argc, const char *argv[]) {
  const double PI = 3.14159265358979323846;
  // source code

  ll X = inputValueLongLong();

  int shita = -200;
  int ue = 200;

  for (ll i = 0; i < 300; i++) {
    for (ll j = 0; j < 300; j++) {
      ll ix = i - 150;
      ll jx = j - 150;
      if (X == ix * ix * ix * ix * ix - jx * jx * jx * jx * jx) {
        cout << ix << " " << jx << endl;
        return 0;
      }
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <vector>

#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

int inputValue() {
  int a;
  cin >> a;
  return a;
};

void inputArray(int *p, int a){rep(i, a){cin >> p[i];
}
}
;

long long inputValueLongLong() {
  long long a;
  cin >> a;
  return a;
};

void inputVector(vector<int> *p, int a) {
  rep(i, a) {
    int input;
    cin >> input;
    p->push_back(input);
  }
}

void inputVectorString(vector<string> *p, long long a) {
  rep(i, a) {
    string input;
    cin >> input;
    p->push_back(input);
  }
}

template <typename T> void output(T a, int precision) {
  if (precision > 0) {
    cout << setprecision(precision) << a << "\\n";
  } else {
    cout << a << "\\n";
  }
}

const long long MOD = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7;

int main(int argc, const char *argv[]) {
  const double PI = 3.14159265358979323846;
  // source code

  ll X = inputValueLongLong();
  ll amb = 0;
  ll wa = 0;
  for (ll i = 2; i < X; i++) {
    if (X % i == 0) {
      amb = i;
      wa = X % i;
      break;
    }
  }
  if (amb == 0) {
    amb = 1;
  }
  ll a = 0, b = 0;

  for (ll i = amb + 1;; i--) {
    a = i;
    b = i - amb;
    if (a * a * a * a * a - b * b * b * b * b == X) {
      cout << a << " " << b << endl;
      break;
    }
  }
  return 0;
}