buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
X=$stdin.read.chomp.to_i s = X ** (1/5.to_f).floor (s..).each do |a| a5 = a ** 5 d = (X - a5) b = (d.abs ** (1 / 5.to_f)).round * (-1) * (if d == 0 then 1 else d/d end) b5 = b**5 if a5 - b5 == X puts "#{a} #{b}" break end end
X=$stdin.read.chomp.to_i s = X ** (1/5.to_f).floor (-120..).each do |a| a5 = a ** 5 d = (X - a5) b = (d.abs ** (1 / 5.to_f)).round * (-1) * (if d == 0 then 1 else d/d end) b5 = b**5 if a5 - b5 == X puts "#{a} #{b}" break end end
[["-", 0, 493, 0, 652, 486, 739, 0, 475, 756, 22], ["+", 0, 652, 486, 739, 0, 475, 756, 748, 17, 33], ["+", 0, 652, 486, 739, 0, 475, 756, 748, 439, 612]]
4
104
#include <bits/stdc++.h> using namespace std; int main() { long long int x; cin >> x; int i = 0; bool ans = true; while (ans) { i++; for (int j = -120; j < 120; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << "" << j << endl; ans = false; break; ...
#include <bits/stdc++.h> using namespace std; int main() { long long int x; cin >> x; int i = -120; bool ans = true; while (ans) { i++; for (int j = -120; j < 120; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << endl; ans = false; break;...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
99
#include <bits/stdc++.h> using namespace std; #define INCANT \ cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), \ cout << fixed << setprecision(20); #define int long long const int INF = 1e18, MOD = 1e9 + 7; signed main(...
#include <bits/stdc++.h> using namespace std; #define INCANT \ cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), \ cout << fixed << setprecision(20); #define int long long const int INF = 1e18, MOD = 1e9 + 7; signed main(...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
111
#include <bits/stdc++.h> using namespace std; #define faster \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define sq(x) ...
#include <bits/stdc++.h> using namespace std; #define faster \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define sq(x) ...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
126
#include <bits/stdc++.h> using namespace std; int main() { int64_t X; cin >> X; bool t = false; for (int i = -200; i < 200; i++) { for (int j = -200; j < 200; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << ' ' << j << endl; t = true; break; } ...
#include <bits/stdc++.h> using namespace std; int main() { int64_t X; cin >> X; bool t = false; for (int i = -120; i < 120; i++) { for (int j = -120; j < 120; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << ' ' << j << endl; t = true; break; } ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
108
#include <iostream> #include <string> using namespace std; int main(void) { // A^5 - B^5 と (-B)^5 - (-A)^5 は等しい //つまり、(A,B)=(3,4),(-4,-3)は答えが等しくなるので、どちらかを考えれば良い //つまりA>0で固定できる // cout << "test" << endl; int A; // A>0 int B; long int a; long int b; long int x; cin >> x; for (A = 1; A < 101; ...
#include <iostream> #include <string> using namespace std; int main(void) { // A^5 - B^5 と (-B)^5 - (-A)^5 は等しい //つまり、(A,B)=(3,4),(-4,-3)は答えが等しくなるので、どちらかを考えれば良い //つまりA>0で固定できる // cout << "test" << endl; long int A; // A>0 long int B; long int a; long int b; long int x; cin >> x; for (A = 0;...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
157
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repe(i, n) for (int i = 0; i <= (n); ++i) #define repe1(i, n) for (int i = 0; i <= (n); ++i) #define all(x) (x).begin(), (x).end() #define pb(x) push_back(x) #define eb(k, v) emplace_back...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repe(i, n) for (int i = 0; i <= (n); ++i) #define repe1(i, n) for (int i = 0; i <= (n); ++i) #define all(x) (x).begin(), (x).end() #define pb(x) push_back(x) #define eb(k, v) emplace_back...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 15, 339, 51, 16, 31, 16, 31, 2, 63, 22], ["+", 15...
1
346
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; vector<ll> divisor(ll n) { vector<ll> res; for (ll i = 1; i * i <= n; ++i) { if (n % i == 0) { res.push_back(i); if (n / i != i) res...
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; vector<ll> divisor(ll n) { vector<ll> res; for (ll i = 1; i * i <= n; ++i) { if (n % i == 0) { res.push_back(i); if (n / i != i) res...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
309
def main(x): for i in range(-120,120): for j in range(-120,120): if(i**5-j**5 == x): print(str(i)+" "+str(j)) return if __name__ == '__main__': main(input())
def main(x): for i in range(-120,120): for j in range(-120,120): if(i**5-j**5 == int(x)): print(str(i)+" "+str(j)) return if __name__ == '__main__': main(input())
[["+", 0, 57, 15, 23, 0, 666, 0, 652, 63, 22], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 24], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 25]]
5
71
X = int(input()) for i in range(-130, 130): for j in range(-130, 130): if X == i ** 5 - j ** 5: print(i, j)
X = int(input()) for i in range(-130, 130): for j in range(-130, 130): if X == i ** 5 - j ** 5: print(i, j) exit()
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
47
import sys def f(x): N = -1000 for a in range(-N, N+1): A = a**5 B = A-x for j in range(-N, N+1): if j ** 5 == B: print(a, j) return x, = map(int, input().split()) f(x)
import sys def f(x): N = 1000 for a in range(-N, N+1): A = a**5 B = A-x for j in range(-N, N+1): if j ** 5 == B: print(a, j) return x, = map(int, input().split()) f(x)
[["-", 8, 196, 0, 1, 0, 662, 12, 664, 17, 33]]
5
81
def f(a,b): return a**5 - b**5 x = int(input()) for a in range(-3,3): for b in range(-3,3): if f(a,b) == x: print(a,b) quit()
def f(a,b): return a**5 - b**5 x = int(input()) for a in range(-125,125): for b in range(-125,125): if f(a,b) == x: print(a,b) quit()
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
65
def abc166_d(): x = int(input()) for i in range(-126, 127): for j in range(-126, 127): if i**5 + j**5 == x: print('{} {}'.format(i, j)) return abc166_d()
def abc166_d(): x = int(input()) for i in range(-126, 127): for j in range(-126, 127): if i**5 - j**5 == x: print('{} {}'.format(i, j)) return abc166_d()
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
63
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; int dx[4] = {0, 0, 1, -1}; int dy[4] = {1, -...
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; int dx[4] = {0, 0, 1, -1}; int dy[4] = {1, -...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13]]
1
638
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define ALL(v) v.begin(), v.end() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define DUMP(i, v) \ for (ll i = 0; i < v.size(); i++) ...
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define ALL(v) v.begin(), v.end() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define DUMP(i, v) \ for (ll i = 0; i < v.size(); i++) ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
453
#include <stdio.h> long long int FiveFactorical(long long int r) { return r * r * r * r * r; } int main(void) { long long int X, i, j, ans; scanf("%lld", &X); for (i = -200; i <= 200; i++) { for (j = -200; j <= 200; j++) { if (FiveFactorical(i) + FiveFactorical(j) == X) { printf("%lld %lld\...
#include <stdio.h> long long int FiveFactorical(long long int r) { return r * r * r * r * r; } int main(void) { long long int X, i, j, ans; scanf("%lld", &X); for (i = -500; i <= 500; i++) { for (j = -500; j <= 500; j++) { if (FiveFactorical(i) - FiveFactorical(j) == X) { printf("%lld %lld\...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, ...
0
117
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i <= b; i++) #define out(x) cout << x << endl #define exout(x) printf("%.10f\n", x) #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i <= b; i++) #define out(x) cout << x << endl #define exout(x) printf("%.10f\n", x) #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(...
[["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, 10, 43, 39, 78]]
1
412
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; const ll MAX = 5000; int main() { int x; cin >> x; for (int i = -200; i <= 200; i++) { for (int j = -200; j <= 200; j++) { ll a = i * i * i * i * i; ll b = j * j * j * j * j; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; const ll MAX = 5000; int main() { int x; cin >> x; for (ll i = -200; i <= 200; i++) { for (ll j = -200; j <= 200; j++) { ll a = i * i * i * i * i; ll b = j * j * j * j * j; ...
[["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, 10, 43, 39, 78]]
1
125
/* * a.cpp * * Created on: 2019/06/08 * Author: MEIP-users */ #include <algorithm> #include <bits/stdc++.h> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <string> #include <tuple> #include <vector> using...
/* * a.cpp * * Created on: 2019/06/08 * Author: MEIP-users */ #include <algorithm> #include <bits/stdc++.h> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <string> #include <tuple> #include <vector> using...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
213
def resolve(): x = int(input()) five = [] for i in range(-1000, 1001): five.append(i ** 5) for i in range(len(five)): for j in range(len(five)): if x == abs(five[i] - five[j]): if five[i] >= five[j]: print("{} {}".format(i - 999, j - 999))...
def resolve(): x = int(input()) five = [] for i in range(-1000, 1001): five.append(i ** 5) for i in range(len(five)): for j in range(len(five)): if x == abs(five[i] - five[j]): if five[i] >= five[j]: print("{} {}".format(i - 1000, j - 1000...
[["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
127
x = int(input()) lower = -1 upper = -1 for i in range(100000000): pow5 = pow(i, 5) if lower == -1 and pow5 >= x: lower = i - 1 break for i in range(lower, 100000000): pow5 = pow(i, 5) if upper == -1 and pow5 - pow(i-1, 5) >= x: upper = i break for a in range(lower-1, u...
x = int(input()) lower = -1 upper = -1 for i in range(100000000): pow5 = pow(i, 5) if lower == -1 and pow5 >= x: lower = i - 1 break for i in range(lower, 100000000): pow5 = pow(i, 5) if upper == -1 and pow5 - pow(i-1, 5) >= x: upper = i break for a in range(-upper-1, ...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 664, 17, 33], ["+", 12, 652, 3, 4, 0, 657, 31, 664, 28, 22]]
5
155
#include <algorithm> #include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { ll x; cin >> x; for (int i = -1000; i < 1000; i++) { for (int j = -100...
#include <algorithm> #include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { ll x; cin >> x; for (int i = -1000; i < 1000; i++) { for (int j = -100...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
121
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long X = sc.nextLong(); sc.close(); String ans = null; for (long i = -10000; ans == null && i <= 10000; i++) for (long j = -10000; ans == null && j <= 10000; j++) i...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long X = sc.nextLong(); sc.close(); String ans = null; for (long i = -1000; ans == null && i <= 1000; i++) for (long j = -1000; ans == null && j <= 1000; j++) if (i...
[["-", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["+", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499], ["-", 8, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["+", 8, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["-", 0, 7, 8, 7, 15, 16, 1...
3
136
x = int(input()) d = dict() for i in range(-100, 101): d[i**5] = i for i in d: if x+i in d: print(d[i], d[x+i]) break
x = int(input()) d = dict() for i in range(-200, 201): d[i**5] = i for i in d: if x+i in d: print(d[x+i], d[i]) break
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["-", 0, 652, 3, 4, 0, 206, 206, 657, 31, 22], ...
5
59
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int x; cin >> x; //* const int max = 8000; vector<unsigned long long int> five(max, 0); for (int i = 0; i < max; ++i) { unsigned long long int tmp = 1; for (int j = 0; j < 5; ++j) { ...
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { unsigned long long int x; cin >> x; //* const int max = 8000; vector<unsigned long long int> five(max, 0); for (int i = 0; i < max; ++i) { unsigned long long int tmp = 1; for (int j = 0; j...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33]]
1
227
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; long long A, B; int ans = pow(X, 0.2); int mi = ans * -1; for (int i = mi; i < ans; ++i) { for (int j = mi; j < ans; ++j) { A = pow(i, 5); B = pow(j, 5); if ((A - B) == X) { cout << i << " " << j << ...
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; long long A, B; int ans = pow(X, 0.2); ans *= 10; int mi = ans * -1; for (int i = mi; i < ans; ++i) { for (int j = mi; j < ans; ++j) { A = pow(i, 5); B = pow(j, 5); if ((A - B) == X) { cout << i <<...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
121
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
312
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main(int argc, char const *argv[]) { cin.tie(0); ios::sync_with_stdio(false); ll X; cin >> X; for (ll i = -10000; i <= 10000; i++) { for (ll j = -10000; j <= 10000; j++) { if (i ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main(int argc, char const *argv[]) { cin.tie(0); ios::sync_with_stdio(false); ll X; cin >> X; for (ll i = -1000; i <= 1000; i++) { for (ll j = -1000; j <= 1000; j++) { if (i * i ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
131
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define repk(i, k, n) for (ll i = k; i < (ll)(n); ++i) #define MAX 500000001000000000 #define MOD 1000000007 typedef long long ll; using namespace std; ll ans, cnt; int main() { cin.tie(0); ios::sync_with_stdio(false); ll X; cin >> ...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define repk(i, k, n) for (ll i = k; i < (ll)(n); ++i) #define MAX 500000001000000000 #define MOD 1000000007 typedef long long ll; using namespace std; ll ans, cnt; int main() { cin.tie(0); ios::sync_with_stdio(false); ll X; cin >> ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
150
#include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstring> #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define asc(a, n) sort(a, a + n); #defi...
#include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstring> #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define asc(a, n) sort(a, a + n); #defi...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
234
#include <bits/stdc++.h> #define ll long long using namespace std; ll quickpow(int a, int b) { long long res = 1, t = a; while (b) { if (b & 1) res = res * t; t = t * t; b >>= 1; } return res; } int main() { int x; scanf("%d", &x); for (int i = 1; i < 130; ++i) { ll a = quickpow(i, 5...
#include <bits/stdc++.h> #define ll long long using namespace std; ll quickpow(int a, int b) { long long res = 1, t = a; while (b) { if (b & 1) res = res * t; t = t * t; b >>= 1; } return res; } int main() { int x; scanf("%d", &x); for (int i = 0; i < 120; ++i) { ll a = quickpow(i, 5...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
150
x = int(input()) for a in range(-200,200): for b in range(-200,200): if pow(a,5)- pow(b,5)==x: print(a,b) break
x = int(input()) for a in range(-200,200): for b in range(-200,200): if pow(a,5)- pow(b,5)==x: print(a,b) exit()
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
54
x = int(input()) q = 0 while abs(x) > q**5: q += 1 deta = False for A in range(-q, q+1): if deta: break for B in range(-q, q+1): if A**5 - B**5 == x: print(A,B) break
x = int(input()) q = 0 while abs(x) > q**4: q += 1 deta = False for A in range(-q, q+1): if deta: break for B in range(-q, q+1): if A**5 - B**5 == x: print(A,B) deta = True break
[["-", 0, 656, 0, 52, 15, 666, 0, 657, 12, 612], ["+", 0, 656, 0, 52, 15, 666, 0, 657, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 146]]
5
75
#include <iostream> #include <vector> using namespace std; int main() { long long x; cin >> x; for (long long a = -1000; a <= 1000; ++a) { for (long long b = -1000; b <= 1000; ++b) { if (x = a * a * a * a * a - b * b * b * b * b) { cout << a << " " << b << endl; return 0; } }...
#include <iostream> #include <vector> using namespace std; int main() { long long x; cin >> x; for (long long a = -1000; a <= 1000; ++a) { for (long long b = -1000; b <= 1000; ++b) { if (x == a * a * a * a * a - b * b * b * b * b) { cout << a << " " << b << endl; return 0; } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
100
#include <stdio.h> typedef long long LL; LL fast(LL a, LL b) { LL ans = 1ll; while (b > 0ll) { if (b & 1ll) ans = a * ans; a = a * a; b = b / 2ll; } return ans; } int main() { LL x; LL a = -100ll, b = -100ll; scanf("%lld", &x); for (a = -1ll; a <= 100ll; a++) { for (b = -1ll; b <= ...
#include <stdio.h> typedef long long LL; LL fast(LL a, LL b) { LL ans = 1ll; while (b > 0ll) { if (b & 1ll) ans = a * ans; a = a * a; b = b / 2ll; } return ans; } int main() { LL x; LL a = -100ll, b = -100ll; scanf("%lld", &x); for (a = -120ll; a <= 120ll; a++) { for (b = -120ll; b...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, ...
0
160
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back using ll = long long; using P = pair<int, int>; int main() { ll x; cin >> x; for (int i = -1000; i <= 1000; i++) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back using ll = long long; using P = pair<int, int>; int main() { ll x; cin >> x; for (ll i = -200; i <= 200; i++) { for...
[["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, ...
1
141
x = int(input()) for a in range(10**4): for b in range(10**4): if(a**5 + b**5 == x): print(a, -b) break elif(a**5 - b**5 == x): print(a, b) break else: break
x = int(input()) for a in range(10**4): for b in range(10**4): if(a**5 + b**5 == x): print(a, -b) break elif(a**5 - b**5 == x): print(a, b) break else: continue break
[["+", 0, 7, 75, 76, 8, 196, 0, 116, 0, 117]]
5
72
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; long long x; cin >> x; long long buf = 0; bool ans = false; int i = 0; a = -118; b = -118; while (a < 119) { b = 0; while (b < 119) { if (x == a * a * a * a * a - b * b * b * b * b) { i = 1; break...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; long long x; cin >> x; long long buf = 0; bool ans = false; int i = 0; a = -118; b = -118; while (a < 120) { b = -118; while (b < 120) { if (x == a * a * a * a * a - b * b * b * b * b) { i = 1; br...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13]]
1
129
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long X = sc.nextLong(); long[] la = new long[101]; for (int i = 0; i <= 120; i++) { la[i] = (long)i * i * i * i * i; } out: for (int i = 0; i < la.length; i++)...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long X = sc.nextLong(); long[] la = new long[121]; for (int i = 0; i <= 120; i++) { la[i] = (long)i * i * i * i * i; } out: for (int i = 0; i < la.length; i++)...
[["-", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499], ["+", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499]]
3
196
x=int(input()) for a in range(-500,500,1): for b in range(-500,500,1): if x==pow(a,5)-pow(b,5): print(a,b)
x=int(input()) for a in range(-500,500,1): for b in range(-500,500,1): if x==pow(a,5)-pow(b,5): print(a,b) exit()
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
57
X = int(input()) N = 200 for i in range(N): for j in range(N): if i**5 - j**5 == X: print(i, j) exit() if (-i)**5 - j**5 == X: print(i, j) exit() if i**5 - (-j)**5 == X: print(i, j) exit() if (-i)**5 - (-j)**5 ==...
X = int(input()) N = 200 for i in range(N): for j in range(N): if i**5 - j**5 == X: print(i, j) exit() if (-i)**5 - j**5 == X: print(-i, j) exit() if i**5 - (-j)**5 == X: print(i, -j) exit() if (-i)**5 - (-j)**5 ...
[["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]]
5
119
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define x first #define y second //#define int long long using namespace std; // typedef int long long; typedef pair<int, ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define x first #define y second //#define int long long using namespace std; // typedef int long long; typedef pair<int, ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339...
1
145
X = int(input()) for a in range(-200, 200): for b in range(-200, 200): if a**5-b**5 == X: print(a, b) break
X = int(input()) for a in range(-200, 200): for b in range(-200, 200): if a**5-b**5 == X: print(a, b) break else: continue break
[["+", 0, 7, 8, 196, 0, 7, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 7, 75, 76, 0, 102], ["+", 0, 7, 75, 76, 8, 196, 0, 116, 0, 117], ["+", 0, 656, 0, 7, 8, 196, 0, 93, 0, 94]]
5
48
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n; int flag = 0; for (int i = -120; i <= 120; i++) { for (int j = -120; j <= 120; j++) { ll a = pow(i, 5); ll b = pow(j, 5); if ((a - b) == n) { cout << a << " " << b << endl; f...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k; cin >> n; int flag = 0; for (int i = -120; i <= 120; i++) { for (int j = -120; j <= 120; j++) { ll a = pow(i, 5); ll b = pow(j, 5); if ((a - b) == n) { cout << i << " " << j << endl; f...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
124
import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long X = scan.nextLong(); long A = 0; long B = 0; ArrayList<Integer> arrayList = new ArrayList<Integer>(); if (0 < X || X < 0) { for (int i = -10...
import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long X = scan.nextLong(); long A = 0; long B = 0; ArrayList<Integer> arrayList = new ArrayList<Integer>(); if (0 < X || X < 0) { for (int i = -12...
[["-", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["+", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["-", 0, 57, 64, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 57, 64, 196, 0, 7, 15, 16, 12, 499], ["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499]]
3
189
a=int(input()) ok=False for i in range(-120,120): for j in range(-120,120): if i**5+j**5==a: print(i,j) ok=True break if ok: break
a=int(input()) ok=False for i in range(-120,120): for j in range(-120,120): if i**5-j**5==a: print(i,j) ok=True break if ok: break
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
58
import sys import itertools X = int(input()) N = 10 ABs = [] for i in range(N): ABs.append(i**5) for i in range(N): for j in range(N): if ABs[i]-ABs[j] == X: print(i,j) sys.exit() elif ABs[i]+ABs[j] == X: print(i,-j) sys.exit()
import sys import itertools X = int(input()) N = 120 ABs = [] for i in range(N): ABs.append(i**5) for i in range(N): for j in range(N): if ABs[i]-ABs[j] == X: print(i,j) sys.exit() elif ABs[i]+ABs[j] == X: print(i,-j) sys.exit()
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
100
#include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double dd; const int N = 1e5 + 5; const dd eps = 1e-8; const int mod = 1e9 + 7; ll qu[N], x; int cnt; int main() { ios::sync_with_stdio(false); // freopen("input.txt","r",stdin); fo...
#include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double dd; const int N = 1e5 + 5; const dd eps = 1e-8; const int mod = 1e9 + 7; ll qu[N], x; int cnt; int main() { ios::sync_with_stdio(false); // freopen("input.txt","r",stdin); fo...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
196
x=int(input()) a=0 b=0 for i in range(0,x): for j in range(-i,x): if i**5-j**5==x: a=i b=j break else: continue break print(a,b)
x=int(input()) a=0 b=0 for i in range(-500,500): for j in range(-500,500): if i**5-j**5==x: a=i b=j break else: continue break print(a,b)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196...
5
63
#include <iostream> using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define FORS(i, a, b, c) for (int i = a; i < b; i += c) #define FORN(i, a, b) for (int i = a; i <= b; i++) #define FORD(i, a, b) for (int i = a - 1; i >= b; i--) #define FORE(i, b) for (auto &i : b) #define REP(i, b) FOR(i, 0, b)...
#include <iostream> using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define FORS(i, a, b, c) for (int i = a; i < b; i += c) #define FORN(i, a, b) for (int i = a; i <= b; i++) #define FORD(i, a, b) for (int i = a - 1; i >= b; i--) #define FORE(i, b) for (auto &i : b) #define REP(i, b) FOR(i, 0, b)...
[["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 25]]
1
279
X = int(input()) B = [n**5 for n in range(300)] A = [] for i in range(300): a = i**5- X if i**5 >= X else X-i**5 A.append(a) for j in range(300): if A[j] in B: a = j b = B.index(A[j]) if a**5-b**5 == X: print(a,b) elif a**+b**5 == X: print(a,-b) ...
X = int(input()) B = [n**5 for n in range(200)] A = [] for i in range(200): a = i**5- X if i**5 >= X else X-i**5 A.append(a) for j in range(200): if A[j] in B: a = j b = B.index(A[j]) if a**5-b**5 == X: print(a,b) elif a**5+b**5 == X: print(a,-b) ...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 75, 665, 15, 666, 0, 657, 31, 657, 12, 612]]
5
132
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long ans1 = 0; long ans2 = 0; long X = sc.nextLong(); loop: for (long i = -10000; i <= 90000; i++) { for (long k = -10000; k <= 10000; k++) { if (X == (...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long ans1 = 0; long ans2 = 0; long X = sc.nextLong(); loop: for (long i = -1000; i <= 1000; i++) { for (long k = -1000; k <= 1000; k++) { if (X == (i - ...
[["-", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["+", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["-", 8, 196, 0, 97, 0, 7, 15, 16, 12, 499], ["+", 8, 196, 0, 97, 0, 7, 15, 16, 12, 499], ["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499]]
3
196
import sys def input(): return sys.stdin.readline().rstrip() def main(): X = int(input()) for a in range(-120, 120): a5 = a ** 5 for b in range(-120, 120): if a5 + b ** 5 == X: print(a, b) exit() if __name__ == '__main__': main()
import sys def input(): return sys.stdin.readline().rstrip() def main(): X = int(input()) for a in range(-120, 120): a5 = a ** 5 for b in range(-120, 120): if a5 - b ** 5 == X: print(a, b) exit() if __name__ == '__main__': main()
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
87
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int x; cin >> x; for (int i = -200; i < 200; i++) { for (int j = -200; j < 200; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cou...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll x; cin >> x; for (ll i = -200; i < 200; i++) { for (ll j = -200; j < 200; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout <...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, 10, 43, 39, 78]]
1
119
#include <bits/stdc++.h> using namespace std; int main() { long long int x; cin >> x; for (int i = -5000; i <= 5000; i++) { for (int j = -5000; j <= 5000; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j; return 0; } } } }
#include <bits/stdc++.h> using namespace std; int main() { long long int x; cin >> x; for (long long int i = -5000; i <= 5000; i++) { for (long long int j = -5000; j <= 5000; j++) { if ((i * i * i * i * i - j * j * j * j * j) == x) { cout << i << " " << j; return 0; } } } }
[["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25]]
1
92
X=int(input()) for A in range(-10**3, 10**3): for B in range(-10**3, 10**3): if A**5-B**5==X: print(A, B)
X=int(input()) for A in range(-10**3, 10**3): for B in range(-10**3, 10**3): if A**5-B**5==X: print(A, B) exit()
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
55
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using ll = long long; int main() { double x; for (int i = -200; i < 200; i++) { for (int j = i; j < 200; j++) { if (pow(j, 5) - pow(i, 5) == x) { cout << j << " " << i << endl; return 0; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using ll = long long; int main() { int x; cin >> x; for (int i = -200; i < 200; i++) { for (int j = i; j < 200; j++) { if (pow(j, 5) - pow(i, 5) == x) { cout << j << " " << i << endl; retur...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
96
import math, sys X = int(input()) for a in range(-200,200): a5 == a**5 for b in range(-200,200): if a5-b**5==X: print(str(a)+" "+str(b)) sys.exit()
import math, sys X = int(input()) for a in range(-200,200): a5 = a**5 for b in range(-200,200): if a5-b**5==X: print(str(a)+" "+str(b)) sys.exit()
[["-", 0, 7, 8, 196, 0, 1, 0, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32]]
5
69
#include <bits/stdc++.h> // Hey! 僕の提出を見てくれてありがとう. // ロボ子さん可愛いぞ!!!!!君もV沼にはまろう↓ // https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g using namespace std; using ll = long long; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // a,bの最大公約数(gcd)を求める ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); } // a,b...
#include <bits/stdc++.h> // Hey! 僕の提出を見てくれてありがとう. // ロボ子さん可愛いぞ!!!!!君もV沼にはまろう↓ // https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g using namespace std; using ll = long long; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // a,bの最大公約数(gcd)を求める ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); } // a,b...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
386
#include <bits/stdc++.h> using namespace std; int main() { long long int X; cin >> X; for (int i = -200; i < 201; i++) { long long int A = i * i * i * i * i; for (int j = -200; j < 200; j++) { if (A == X + j * j * j * j * j) { cout << i << " " << j << endl; return 0; } } ...
#include <bits/stdc++.h> using namespace std; int main() { long long int X; cin >> X; for (int i = -200; i < 201; i++) { long long int A = 1ll * i * i * i * i * i; for (int j = -200; j < 200; j++) { if (A == X + 1ll * j * j * j * j * j) { cout << i << " " << j << endl; return 0; ...
[["+", 31, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 48]]
1
104
#include <bits/stdc++.h> int main() { using namespace std; long X; cin >> X; for (long i{-120}; i <= 120; ++i) for (long j{-120}; j <= 120; ++j) if (i * i * i * i * i - j * j * j * j * j) { cout << i << " " << j << endl; return 0; } return 0; }
#include <bits/stdc++.h> int main() { using namespace std; long X; cin >> X; for (long i{-120}; i <= 120; ++i) for (long j{-120}; j <= 120; ++j) if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } return 0; }
[["+", 8, 7, 8, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 7, 8, 57, 15, 339, 51, 16, 12, 22]]
1
91
import math x = int(input()) for i in range(-1000, 1000): for j in range(-1000, 1000): if math.pow(a, 5) == x + math.pow(b, 5): print(a, b) exit()
import math x = int(input()) for a in range(-1000, 1000): for b in range(-1000, 1000): if math.pow(a, 5) == x + math.pow(b, 5): print(a, b) exit()
[["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["-", 0, 656, 0, 7, 8, 196, 0, 7, 31, 22], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 31, 22]]
5
62
#pragma region header #pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define int long long #define ll long long #define ld long double #define vi vector<int> #define vvi vector<vector<int>> #define vvvi vector<vector<vector<int>>> #define vs vector<string> #define vvs vector<vector<string>> #define vvvs vector<...
#pragma region header #pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define int long long #define ll long long #define ld long double #define vi vector<int> #define vvi vector<vector<int>> #define vvvi vector<vector<vector<int>>> #define vs vector<string> #define vvs vector<vector<string>> #define vvvs vector<...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 31, 16, 31, 16, 31, 16, 12, 69, 28, 22], ["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 73]]
1
1,197
x=int(input()) for i in range(-1000,1000): for j in range(-1000,1000): if i**5-j**5==x: print(i,j) keep=1 break if keep==1: break
x=int(input()) keep=0 for i in range(-1000,1000): for j in range(-1000,1000): if i**5-j**5==x: print(i,j) keep=1 break if keep==1: break
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
57
#include <bits/stdc++.h> using namespace std; long long A(int a) { return a * a * a * a * a; } int main() { long long x; cin >> x; for (long long i = -1000; i <= 1000; i++) { for (long long j = -1000; j <= 1000; j++) { if (A(i) - A(j) == x) { cout << i << " " << j << endl; return 0; ...
#include <bits/stdc++.h> using namespace std; long long A(long long a) { return a * a * a * a * a; } int main() { long long x; cin >> x; for (long long i = -1000; i <= 1000; i++) { for (long long j = -1000; j <= 1000; j++) { if (A(i) - A(j) == x) { cout << i << " " << j << endl; return ...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 49, 53, 54, 55, 0, 56, 39, 86, 0, 96]]
1
105
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
544
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections x = int(input()) for i in range(-1000,1001): for j in range(-1000,1001): if i**5 - j**5 == x: print(i,j)
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections x = int(input()) for i in range(-1000,1001): for j in range(-1000,1001): if i**5 - j**5 == x: print(i,j) sys.exit()
[["+", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
71
import itertools x = int(input()) num = [i**5 for i in range(3000)] ans= list(itertools.combinations_with_replacement(num, 2)) for i in ans: if abs(i[0]-i[1]) == x: if i[0] < i[1]: print(int(i[0]**0.2),int(i[1]**0.2)*-1) else: print(int(i[0]**0.2),int(i[1]**0.2)) brea...
import itertools x = int(input()) num = [i**5 for i in range(3000)] ans= list(itertools.combinations_with_replacement(num, 2)) for i in ans: if abs(i[0]-i[1]) == x: if i[0] < i[1]: print(int(i[1]**0.2),int(i[0]**0.2)) else: print(int(i[0]**0.2),int(i[1]**0.2)) break ...
[["-", 0, 652, 3, 4, 0, 657, 31, 206, 206, 612], ["+", 0, 652, 3, 4, 0, 657, 31, 206, 206, 612], ["-", 31, 652, 3, 4, 0, 657, 31, 206, 206, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["-", 0, 652, 3, 4, 0, 657, 12, 664, 17, 33], ["-", 0, 652, 3, 4, 0, 657, 12, 664, 28, 612]]
5
158
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int64_t X; cin >> X; for (int64_t A = 1; A <= 100; A++) { for (int64_t B = -100; B <= 100; B++) { int64_t seki = pow(A, 5) - pow(B, 5); if (seki == X) { cout <<...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int64_t X; cin >> X; for (int64_t A = -200; A <= 200; A++) { for (int64_t B = -200; B <= 200; B++) { int64_t seki = pow(A, 5) - pow(B, 5); if (seki == X) { cout...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
105
X=int(input()) def ans(): for x in range(-10,10): for y in range(-10,10): if X==(x**5-y**5): print('{} {}'.format(x,y)) return x,y ans()
X=int(input()) def ans(): for x in range(-118,119): for y in range(-119,118): if X==(x**5-y**5): print('{} {}'.format(x,y)) return x,y ans()
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
68
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; for (int i = 1; i < 300; i++) { for (int j = 1; j < 300; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << endl; return 0; } else if (-(i * i * i * i * i) - j * j * j * j * ...
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; for (int i = 0; i < 300; i++) { for (int j = 0; j < 300; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << endl; return 0; } else if (-(i * i * i * i * i) - j * j * j * j * ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
228
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll x; cin >> x; for (ll i = -100; i < 100; i++) { for (ll j = -100; j < 100; j++) { if (pow(i, 5.0) - pow(j, 5.0) == x) cout << i << " " << j << endl; return 0; } } }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll x; cin >> x; for (ll i = -120; i < 120; i++) { for (ll j = -120; j < 120; j++) { if (pow(i, 5.0) - pow(j, 5.0) == x) { cout << i << " " << j << endl; return 0; } } } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64...
1
90
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, s, n) for (int i = (s); i <= (n); i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define REPR(i, s, n) for (int i = (s); i >= (n); i--) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin()...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, s, n) for (int i = (s); i <= (n); i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define REPR(i, s, n) for (int i = (s); i >= (n); i--) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin()...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
482
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n; cin >> n; int a = 0; int b = 0; for (int i = -100; i <= 100; i++) { int flag = 0; for (int j = -1...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n; cin >> n; int a = 0; int b = 0; for (int i = -150; i <= 150; i++) { int flag = 0; for (int j = -1...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339...
1
255
x = int(input()) for i in range(-1000,1000+1): for j in range(-1000,1001): if i**5 - j*5 == x: print(i, j, sep=' ')
x = int(input()) for i in range(-1000,1000+1): for j in range(-1000,1001): if i**5 - j**5 == x: print(i, j) exit()
[["-", 0, 57, 15, 666, 0, 657, 12, 657, 17, 48], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 17, 578], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["-", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["-", 0, 652, 3, 4, 0, 653, 51, 557, 0, 6], ["-...
5
55
#include <algorithm> #include <cctype> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <regex> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) typedef int long long ll;...
#include <algorithm> #include <cctype> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <regex> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) typedef int long long ll;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
448
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j, x; int flag = 0; cin >> x; for (i = -10; i < 10; i++) { for (j = -10; j < 10; j++) { if (pow(i, 5) - pow(j, 5) == x) { flag = 1; break; } } if (flag == 1) break; } cout << i << " "...
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j, x; int flag = 0; cin >> x; for (i = -1000; i < 1000; i++) { for (j = -1000; j < 1000; j++) { if (pow(i, 5) - pow(j, 5) == x) { flag = 1; break; } } if (flag == 1) break; } cout << ...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, ...
1
109
N = 10000 x = gets.to_i dp = Array.new(N){ |i| i ** 5 } dp.each_with_index do |a,i| dp.each_with_index do |b,j| if a + b == x puts [i,j].join(" ") exit end if a - b == x puts [i,-j].join(" ") exit end end end
N = 10000 x = gets.to_i dp = Array.new(N){ |i| i ** 5 } dp.each_with_index do |a,i| dp.each_with_index do |b,j| if a + b == x puts [i,-j].join(" ") exit end if a - b == x puts [i,j].join(" ") exit end end end
[["+", 3, 4, 0, 652, 486, 516, 0, 748, 17, 33], ["-", 3, 4, 0, 652, 486, 516, 0, 748, 17, 33]]
4
87
#include <bits/stdc++.h> using namespace std; // Competetive Template: typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; // Debugging : void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cer...
#include <bits/stdc++.h> using namespace std; // Competetive Template: typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; // Debugging : void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cer...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 16, 31, 16, 31,...
1
773
#include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int x, a, b; cin >> x; for (int i = 0; i < x; i++) for (int j = -i; j < i; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << j; exit(0); } } retur...
#include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int x, a, b; cin >> x; for (int i = 0; i <= x; i++) for (int j = -i; j <= i; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j; exit(0); } }...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 17, 19], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
100
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
201
import itertools max_num = 2000 num_list = [i for i in range(-max_num, max_num+1)] num_comb = list(itertools.combinations(num_list, 2)) x = int(input().strip()) for comb in num_comb: a = comb[0] b = comb[1] a5 = a ** 5 b5 = b ** 5 if a5 - b5 == x: print(a, b) break
import itertools max_num = 200 num_list = [i for i in range(-max_num, max_num+1)] num_comb = list(itertools.permutations(num_list, 2)) x = int(input().strip()) for comb in num_comb: a = comb[0] b = comb[1] # print(a, b) a5 = a ** 5 b5 = b ** 5 if a5 - b5 == x: print(a, b) bre...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22]]
5
88
x = int(input()) for a in range(-10000, 10001): p = a ** 5 l, r = -10000, 10001 while r - l > 1: m = (l + r) // 2 if m ** 5 <= p - x: l = m else: r = m if l ** 5 == p - x: print(p, l) exit(0)
x = int(input()) for a in range(-10000, 10001): p = a ** 5 l, r = -10000, 10001 while r - l > 1: m = (l + r) // 2 if m ** 5 <= p - x: l = m else: r = m if l ** 5 == p - x: print(a, l) exit(0)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
84
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); for (long i = -1000; i <= 1000; i++) { for (long j = -1000; j <= 1000; j++) { long ans = (long)(Math.pow(i, 5) - Math.pow(j, 5)); if...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); for (long i = -1000; i <= 1000; i++) { for (long j = -1000; j <= 1000; j++) { long ans = (long)(Math.pow(i, 5) - Math.pow(j, 5)); if...
[["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 35]]
3
127
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> typedef long long int ll; using namespace std; #define maxN 200005 #define mod 1000000007 ll n; ll a = 0, b = 0; void solve() { cin >> n; for (ll i = -1000...
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> typedef long long int ll; using namespace std; #define maxN 200005 #define mod 1000000007 ll n; ll a = 0, b = 0; void solve() { cin >> n; for (ll i = -126;...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
166
x = int(input()) flag = True for a in range(1, 65): for b in range(1, 65): if a ** 5 - b ** 5 == x: print(' '.join([str(a), str(b)])) flag = False break if not flag: break
x = int(input()) flag = True for a in range(-500, 500): for b in range(-500, 500): if a ** 5 - b ** 5 == x: print(' '.join([str(a), str(b)])) flag = False break if not flag: break
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
72
def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors x = input() X = int(x) div = make_divisors(X) for item in div: for A in ...
def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors x = input() X = int(x) div = make_divisors(X) for item in div: for A in ...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 0, 57, 75, 76, 8, 196, 0, 116, 0, 117], ["+", 8, 196, 0, 7, 8, 196, 0, 93, 0, 94]]
5
123
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define int int64_t #define pcnt __builtin_popcount #define pb push_back #define ALL(x) (x).begin(), (x).end() #define vec vector<int> #define mat vector<vector<int>> // mat データ名(縦,vec(横)); int INF = 1000000000000000001; // 10^18+1 int MOD = 10000000...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define int int64_t #define pcnt __builtin_popcount #define pb push_back #define ALL(x) (x).begin(), (x).end() #define vec vector<int> #define mat vector<vector<int>> // mat データ名(縦,vec(横)); int INF = 1000000000000000001; // 10^18+1 int MOD = 10000000...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
302
import sys x=int(input()) for a in range(1,10**3): for b in range(1,10**3): if a**5 - b**5==x: print(a,b) sys.exit() if (-a)**5 - b**5==x: print(-a,b) sys.exit() if a**5 - (-b)**5==x: print(a,-b) sys.exit() if (...
import sys x=int(input()) for a in range(10**3): for b in range(10**3): if a**5 - b**5==x: print(a,b) sys.exit() if (-a)**5 - b**5==x: print(-a,b) sys.exit() if a**5 - (-b)**5==x: print(a,-b) sys.exit() if (-a)*...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
138
x = int(input()) a = 0 while True: b5 = a**5 - x print(b5) if b5 >= 0: for b in range(b5+1): if b**5 == b5: print(a, b) exit() if b**5 > b5: break else: b5m = -b5 for bm in range(b5m+1): if...
x = int(input()) a = 0 while True: b5 = a**5 - x if b5 >= 0: for b in range(b5+1): if b**5 == b5: print(a, b) exit() if b**5 > b5: break else: b5m = -b5 for bm in range(b5m+1): if bm**5 == b5m:...
[["-", 0, 52, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
108
#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(); } wh...
#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(); } wh...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]]
1
320
ans = int(input()) res = round(ans**0.2) for i in range(-res, res+1): for j in range(-res, res+1): if j**5 - i**5 == ans: print(i,j) exit()
ans = int(input()) res = 10*round(ans**0.2) for i in range(-res, res+1): for j in range(-res, res+1): if i**5 - j**5 == ans: print(i,j) exit()
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 31, 22], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 31, 22], ["-", 0, 57, 15, 666, 0, 657, 12, 657, 31, 22], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 31, 22]]
5
62
#include <bits/stdc++.h> using namespace std; int main() { long long X; cin >> X; for (int i = 1; i < 100; i++) { for (int j = -100; j < i; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } } } }
#include <bits/stdc++.h> using namespace std; int main() { long long X; cin >> X; for (int i = -1000; i < 1000; i++) { for (int j = -1000; j < i; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } } } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
93
import sys X=int(input()) X2=int(X**0.5) X5=int(X**0.2) for i in range(1, X2+1): if X%i==0: for j in range(-i,X5): Xt=(j+i)**5-j**5 if Xt>X and j>0: break if Xt==X: print(j+i,j) sys.exit()
import sys X=int(input()) X2=int(X**0.5) X5=int(X**0.2) for i in range(1, X+1): if X%i==0: for j in range(-i,X+1): Xt=(j+i)**5-j**5 if Xt>X and j>0: break if Xt==X: print(j+i,j) sys.exit()
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 64, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
97
x=int(input()) ans=[] for i in range(1000): for j in range(1000): if pow(i,5)+pow(j,5)==x: print(i,j) exit() if pow(i,5)-pow(j,5)==x: print(i,-j) exit()
x=int(input()) ans=[] for i in range(1000): for j in range(1000): if pow(i,5)+pow(j,5)==x: print(i,-j) exit() if pow(i,5)-pow(j,5)==x: print(i,j) exit()
[["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]]
5
81
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; for (int i = -5000; i < 5000; i++) { for (int j = -50000; j < 50000; j++) { if ((i * i * i * i * i - j * j * j * j * j) == X) { cout << i << " " << j << endl; return 0; } } } }
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; for (int i = -1000; i < 500000; i++) { for (int j = -10000; j < i; j++) { if ((i * i * i * i * i - j * j * j * j * j) == X) { cout << i << " " << j << endl; return 0; } } } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
1
94
X = int(input()) for i in range(-10, 10): for j in range(-10, 10): if pow(i, 5) - pow(j, 5) == X: print(i, j) exit()
X = int(input()) for i in range(-200, 200): for j in range(-200, 200): if pow(i, 5) - pow(j, 5) == X: print(i, j) exit()
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
56
package main import ( "bufio" "fmt" "os" "strconv" ) const ( initialBufSize = 100000 maxBufSize = 10000000 ) var ( sc = bufio.NewScanner(os.Stdin) wt = bufio.NewWriter(os.Stdout) ) func next() string { sc.Scan() return sc.Text() } func nextInt() int { i, _ := strconv.Atoi(next()) return i } func p...
package main import ( "bufio" "fmt" "os" "strconv" ) const ( initialBufSize = 100000 maxBufSize = 10000000 ) var ( sc = bufio.NewScanner(os.Stdin) wt = bufio.NewWriter(os.Stdout) ) func next() string { sc.Scan() return sc.Text() } func nextInt() int { i, _ := strconv.Atoi(next()) return i } func p...
[["-", 0, 430, 10, 431, 12, 432, 0, 91, 17, 33], ["-", 0, 430, 10, 431, 12, 432, 0, 91, 439, 433], ["+", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433]]
7
245
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; vector<int> V; V.push_back(0); while (1) { int M = V.size(); for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { if (V.at(i) + V.at(j) == X) { cout << i << " " << j << endl; return 0;...
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; vector<int> V; V.push_back(0); while (1) { int M = V.size(); for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { if (V.at(i) - V.at(j) == X) { cout << i << " " << j << endl; return 0;...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72]]
1
183
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define IO \ ios::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define IO \ ios::sync_with_stdio(false); \ cin.tie(0); ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
150