Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<cmath>
#include<limits>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
using namespace std;
#define int ll

int opow(int x, int n) {
	int res = 1;
	for (int i = 0; i < n; i++) {
		res *= x;
	}

	return res;
}

int func(int B, const int u, int v) {
	int f = 5 * opow(B, 4) + 10 * opow(B, 3) * u + 10 * opow(B, 2) * opow(u, 2) + 5 * B * opow(u, 3) + opow(u, 4) - v;

	return f;
}
signed main() {
	int x; cin >> x;

	int Amax = 1;
	for (; 5 * opow(Amax, 4) + 10 * opow(Amax, 3) <= x; Amax++);
	vi ans(2, -1);

	for (int k = 1; k <= x; k *= k)
		if (k == x) {
			ans[0] = k;
			ans[1] = 0;
			goto endloop;
		}
	for (int u = 1; u * u <= x; u++) {
		if (x % u == 0) {
			int v = x / u;
			//二分探索
			int blow = -u-1;
			int bhigh = Amax + 1;

			while (bhigh - blow > 1) {
				int bmid = (bhigh + blow) / 2;

				int f = func(bmid, u, v);
				if (f == 0) {
					ans[0] = bmid + u;
					ans[1] = bmid;
					goto endloop;
				}
				else if (f < 0) {
					blow = bmid;
				}
				else if (f > 0) {
					bhigh = bmid;
				}
			}

			int f1 = func(bhigh, u, v);
			if (f1 == 0) {
				ans[0] = bhigh + u;
				ans[1] = bhigh;
				goto endloop;
			}

			int f2 = func(blow, u, v);
			if (f2 == 0) {
				ans[0] = blow + u;
				ans[1] = blow;
				goto endloop;
			}
		}
	}
endloop:
	cout << ans[0] << " " <<  ans[1] << endl;
}#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<cmath>
#include<limits>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
using namespace std;
#define int ll

int opow(int x, int n) {
	int res = 1;
	for (int i = 0; i < n; i++) {
		res *= x;
	}

	return res;
}

int func(int B, const int u, int v) {
	int f = 5 * opow(B, 4) + 10 * opow(B, 3) * u + 10 * opow(B, 2) * opow(u, 2) + 5 * B * opow(u, 3) + opow(u, 4) - v;

	return f;
}
signed main() {
	int x; cin >> x;

	int Amax = 1;
	for (; 5 * opow(Amax, 4) + 10 * opow(Amax, 3) <= x; Amax++);
	vi ans(2, -1);

	for (int k = 1; k <= x; k *= k)
		if (k == x) {
			ans[0] = k;
			ans[1] = 0;
			goto endloop;
		}
	for (int u = 1; u * u <= x; u++) {
		if (x % u == 0) {
			int v = x / u;
			//二分探索
			int blow = -u-1;
			int bhigh = Amax + 1;

			while (bhigh - blow > 1) {
				int bmid = (bhigh + blow) / 2;

				int f = func(bmid, u, v);
				if (f == 0) {
					ans[0] = bmid + u;
					ans[1] = bmid;
					goto endloop;
				}
				else if (f < 0) {
					blow = bmid;
				}
				else if (f > 0) {
					bhigh = bmid;
				}
			}

			int f1 = func(bhigh, u, v);
			if (f1 == 0) {
				ans[0] = bhigh + u;
				ans[1] = bhigh;
				goto endloop;
			}

			int f2 = func(blow, u, v);
			if (f2 == 0) {
				ans[0] = blow + u;
				ans[1] = blow;
				goto endloop;
			}
		}
	}
endloop:
	cout << ans[0] << " " <<  ans[1] << endl;
}

Compiler output:
a.cc:105:2: error: stray '#' in program
  105 | }#include <iostream> // cout, endl, cin
      |  ^
a.cc:105:3: error: 'include' does not name a type
  105 | }#include <iostream> // cout, endl, cin
      |   ^~~~~~~
a.cc:141:5: error: redefinition of 'long long int opow(long long int, long long int)'
  141 | int opow(int x, int n) {
      |     ^~~~
a.cc:37:5: note: 'long long int opow(long long int, long long int)' previously defined here
   37 | int opow(int x, int n) {
      |     ^~~~
a.cc:150:5: error: redefinition of 'long long int func(long long int, long long int, long long int)'
  150 | int func(int B, const int u, int v) {
      |     ^~~~
a.cc:46:5: note: 'long long int func(long long int, long long int, long long int)' previously defined here
   46 | int func(int B, const int u, int v) {
      |     ^~~~
a.cc:155:8: error: redefinition of 'int main()'
  155 | signed main() {
      |        ^~~~
a.cc:51:8: note: 'int main()' previously defined here
   51 | signed main() {
      |        ^~~~