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
#!/usr/bin/env python3 import sys input = sys.stdin.readline def ST(): return input().rstrip() def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(MI()) X = I() for a in range(-118, 120): for b in range(-119, 119): if a ** 5 - b ** 5 == X...
#!/usr/bin/env python3 import sys input = sys.stdin.readline def ST(): return input().rstrip() def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(MI()) X = I() for a in range(-118, 120): for b in range(-119, 119): if a ** 5 - b ** 5 == X...
[["+", 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
109
import sys import numpy as np from math import ceil as C, floor as F, sqrt from collections import defaultdict as D, Counter as CNT from functools import reduce as R ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' alp = 'abcdefghijklmnopqrstuvwxyz' def _X(): return sys.stdin.readline().rstrip().split(' ') def _S(ss): return tuple...
import sys import numpy as np from math import ceil as C, floor as F, sqrt from collections import defaultdict as D, Counter as CNT from functools import reduce as R ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' alp = 'abcdefghijklmnopqrstuvwxyz' def _X(): return sys.stdin.readline().rstrip().split(' ') def _S(ss): return tuple...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 1, 0, 662, 12, 658, 8, 657, 31, 22], ["-", 0, 1, 0, 662, 12, 658, 8, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 658, 8, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 658, 8, 657, 12, 22]]
5
309
#include <iostream> int main() { long long int x; std::cin >> x; for (long long int i = 0; i <= 1000; ++i) { for (long long int j = -1000; j <= i - 1; ++j) { long long int first = i * i * i * i * i; long long int second = j * j * j * j * j; if (first - second == x) { std::cout <<...
#include <iostream> int main() { long long int x; std::cin >> x; for (long long int i = 0; i <= 1000; ++i) { for (long long int j = -1000; j <= i - 1; ++j) { long long int first = i * i * i * i * i; long long int second = j * j * j * j * j; if (first - second == x) { std::cout <<...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
112
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; bool t = false; for (int64_t b = -10000; b < 10000; b++) { for (int64_t a = -10000; a < 10000; a++) { if ((a - b) * ((a - b) * (a - b) * (a - b) * (a - b) + 5 * a * b * ((a - b) * (a - b) + a * b)) == ...
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; bool t = false; for (int64_t b = -1000; b < 1000; b++) { for (int64_t a = -1000; a < 1000; a++) { if ((a - b) * ((a - b) * (a - b) * (a - b) * (a - b) + 5 * a * b * ((a - b) * (a - b) + a * b)) == ...
[["-", 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
137
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; // グラフ型 typedef long long ll; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) int main() { int X; cin >> X; // cout<<LLONG_MAX<<endl; //=9223372036854775807^(1/5)=6208.37506 for (int A = -3000; A <= 3000; ...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; // グラフ型 typedef long long ll; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) int main() { ll X; cin >> X; for (ll A = -3000; A <= 3000; A++) { for (ll B = -3000; B <= 3000; B++) { if (A * A * A * A...
[["-", 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
121
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, N) \ for (int i = 0; i < N; i++) \ ; int main() { ll X; cin >> X; for (int i = -200; i < 200; i++) { for (int j...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, N) \ for (int i = 0; i < N; i++) \ ; int main() { ll X; cin >> X; for (ll i = -200; i < 200; i++) { for (ll 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
112
def resolve(): X = int(input()) for a in range(-200, 200): for b in range(-199, 199): if (a**5 - b**5) == X: print(a, b) if __name__ == "__main__": resolve()
def resolve(): X = int(input()) for a in range(200): for b in range(-199, 199): if (a**5 - b**5) == X: print(a, b) return if __name__ == "__main__": resolve()
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]]
5
64
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int x; cin >> x; for (int i = 1; i < 150; i++) { for (int j = 1; j < 150; j++) { if (pow(i, 5) - pow(j, 5) == x) { cout << i << "" << j << endl; exit(0); } } } }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int x; cin >> x; for (int i = -150; i < 150; i++) { for (int j = -150; j < 150; j++) { if (pow(i, 5) - pow(j, 5) == x) { cout << i << " " << j << endl; exit(0); } } ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
95
import sys X=int(input()) for A in range(800): for B in range(-800,A+1): if X==A**5-B**5: print('{} {}'.format(A,B))
import sys X=int(input()) for A in range(800): for B in range(-800,A+1): if X==A**5-B**5: print('{} {}'.format(A,B)) 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
55
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, x, n) for (int i = x; i < n; i++) #define mod 1000000007 // 10^9+7 #define INF 1000000000000 // 10^12 #define F first #define S second #define P pair<int, int> #define all(vec) vec.begin()...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, x, n) for (int i = x; i < n; i++) #define mod 1000000007 // 10^9+7 #define INF 1000000000000 // 10^12 #define F first #define S second #define P pair<int, int> #define all(vec) vec.begin()...
[["-", 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], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 33], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13]]
1
205
x=int(input()) for i in range(-200,200): for j in range(-200,200): if i^5-j^5==x: print(i,j) exit()
x=int(input()) for i in range(-200,200): for j in range(-200,200): if i**5-j**5==x: print(i,j) exit()
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 140], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 578], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 140], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 17, 578]]
5
50
from sys import stdin input = stdin.readline def main(): X = int(input()) for b in range(-500, 500): for a in range(-500, 500): if a**5 - b**5 == X: print(a, b) if(__name__ == '__main__'): main()
from sys import stdin input = stdin.readline def main(): X = int(input()) for b in range(-500, 500): for a in range(-500, 500): if a**5 - b**5 == X: print(a, b) return if(__name__ == '__main__'): main()
[["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]]
5
73
#include <bits/stdc++.h> #include <string.h> #include <vector> // s#define rep(i, n) for (int i = 0; i < (n); i++) #define MAX 10000 using namespace std; #define ll long long #define pb push_back #define mp make_pair #define all(a) (a).begin(), (a).end() #define rep(i, a, n) for (int i = a; i < n; i++) #define r0 r...
#include <bits/stdc++.h> #include <string.h> #include <vector> // s#define rep(i, n) for (int i = 0; i < (n); i++) #define MAX 10000 using namespace std; #define ll long long #define pb push_back #define mp make_pair #define all(a) (a).begin(), (a).end() #define rep(i, a, n) for (int i = a; i < n; i++) #define r0 r...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 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
181
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll x; cin >> x; for (ll i = -10000; i <= 10000; i++) { for (ll j = -10000; j <= 10000; j++) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll x; cin >> x; for (ll i = -1000; i <= 1000; i++) { for (ll j = -1000; j <= 1000; j++) { ...
[["-", 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
120
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repit(itr, x) for (auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr, x) for (auto ritr = x....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repit(itr, x) for (auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr, x) for (auto ritr = x....
[["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33], ["-", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33]]
1
208
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll X; cin >> X; for (int A = -200; A <= 200; A++) { for (int B = -200; B <= 200; B++) { if (A * A * A * A * A - B * B * B * B * B == X) { cout << A << " " << B << endl; return 0; } } } return...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll X; cin >> X; for (ll A = -200; A <= 200; A++) { for (ll B = -200; B <= 200; B++) { if (A * A * A * A * A - B * B * B * B * B == X) { cout << A << " " << B << endl; return 0; } } } }
[["-", 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], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
100
def main(): x = int(input()) for i in range(-120, 121): for j in range(-120, 121): if i**5 - j**5 == x: print(i, j) break if __name__ == "__main__": main()
def main(): x = int(input()) for i in range(-120, 121): for j in range(-120, 121): if i**5 - j**5 == x: print(i, j) return if __name__ == "__main__": main()
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]]
5
63
/* URL https:// SCORE 0 AC false WA false TLE false MLE false TASK_TYPE FAILURE_TYPE NOTES */ #include <algorithm> #include <cstdint> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <optional> #include <queue> #include <set> #include <stack> #inc...
/* URL https:// SCORE 0 AC false WA false TLE false MLE false TASK_TYPE FAILURE_TYPE NOTES */ #include <algorithm> #include <cstdint> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <optional> #include <queue> #include <set> #include <stack> #inc...
[["-", 51, 218, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 51, 218, 8, 9, 0, 43, 49, 50, 51, 13]]
1
7,028
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> using namespace std; #define rep(i, o) for (ll i = 0; i < (o); i++) #define rep_s(i, o) for (int i = 1; i <= (o); i++) #define REP(i, a, b) for (int i = (int)(a); (i) ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> using namespace std; #define rep(i, o) for (ll i = 0; i < (o); i++) #define rep_s(i, o) for (int i = 1; i <= (o); i++) #define REP(i, a, b) for (int i = (int)(a); (i) ...
[["-", 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]]
1
259
X = int(input()) import sys for a in range(-118, 120, 1): for b in range(-119, 119, 1): if x == pow(a,5) - pow(b,5): print(x) sys.exit()
X = int(input()) import sys for a in range(-118, 120, 1): for b in range(-119, 119, 1): if X == pow(a,5) - pow(b,5): print(a, b) sys.exit()
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21]]
5
62
import sys X = int(input()) a = [i for i in range(101)] b = [i for i in range(-1, 100)] for i in a: for k in b: if i**5 == X + k**5: print(i,k) sys.exit()
import sys X = int(input()) a = [i for i in range(-119, 120)] b = [i for i in range(-119, 120)] for i in a: for k in b: if i**5 == X + k**5: print(i,k) sys.exit()
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 0, 659, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 659, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 21], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 0, 659, 12, 652, 3, 4, 0, 664, 28, 612]]
5
69
#include <cmath> #include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { int x; std::cin >> x; for (int i = -119; i <= 118; ++i) { for (int j = -119; j <= 118; ++j) { if (std::pow(i, 5) + std::pow(j, 5) == x) { std::cout << i << ' ' << j << '\n'; return 0...
#include <cmath> #include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { int x; std::cin >> x; for (int i = -119; i <= 118; ++i) { for (int j = -119; j <= 118; ++j) { if (std::pow(i, 5) - std::pow(j, 5) == x) { std::cout << i << ' ' << j << '\n'; return 0...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
105
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define FIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout...
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define FIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout...
[["-", 0, 52, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 52, 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
142
import sys from functools import lru_cache from collections import defaultdict inf = float('inf') readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10**6) def input(): return sys.stdin.readline().rstrip() def read(): return int(readline()) def reads(): return map(int,...
import sys from functools import lru_cache from collections import defaultdict inf = float('inf') readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10**6) def input(): return sys.stdin.readline().rstrip() def read(): return int(readline()) def reads(): return map(int,...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
204
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef float fl; typedef long long ll; ll X; int main() { cin >> X; for (int a = -1; a < 1000; a++) { for (int b = -1; b < 1000; b++) { if (a - b > 0) { if ((X % (a - b) == 0) && (a * a * a ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef float fl; typedef long long ll; ll X; int main() { cin >> X; for (ll a = -1000; a < 1000; a++) { for (ll b = -1000; b < 1000; b++) { if (a - b > 0) { if ((X % (a - b) == 0) && (a * a ...
[["-", 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, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, 10, 43, 39, 78]]
1
136
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(x) (cerr << #x << " = " << x << endl;) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it) #define MSET(c, v) memset(c, v, sizeof(c)) const int I...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(x) (cerr << #x << " = " << x << endl;) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it) #define MSET(c, v) memset(c, v, sizeof(c)) const int I...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
208
#include <bits/stdc++.h> using namespace std; typedef int64_t Int; #define fi first #define se second #define all(x) (x).begin(), (x).end() const double EPS = 1e-10; const Int INF = 1e18; const int inf = 1e9; const Int mod = 1e9 + 7; bool print_space_enable = false; void print() { cout << endl; print_space_enabl...
#include <bits/stdc++.h> using namespace std; typedef int64_t Int; #define fi first #define se second #define all(x) (x).begin(), (x).end() const double EPS = 1e-10; const Int INF = 1e18; const int inf = 1e9; const Int mod = 1e9 + 7; bool print_space_enable = false; void print() { cout << endl; print_space_enabl...
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
296
#include <bits/stdc++.h> using namespace std; bool isPowerOf5(int b) { b = abs(b); for (int i = 0; i * i * i * i * i <= b; i++) if (i * i * i * i * i == b) return true; return false; } int fifthRoot(int b) { int sign = b < 0 ? -1 : 1; b = abs(b); for (int i = 0; i * i * i * i * i <= b; i++) { ...
#include <bits/stdc++.h> using namespace std; bool isPowerOf5(int b) { b = abs(b); for (int i = 0; i * i * i * i * i <= b; i++) if (i * i * i * i * i == b) return true; return false; } int fifthRoot(int b) { int sign = b < 0 ? -1 : 1; b = abs(b); for (int i = 0; i * i * i * i * i <= b; i++) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40]]
1
238
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator>...
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator>...
[["-", 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
259
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN x = int(input()) a = 0 b = 0 comp = 0 while comp == 0 : aa = a**5 tmp = aa - x if tmp < 0: b = -(pow(-tmp,1/5)) elif tmp == 0: b = 0 else: b = pow(tmp,1/5) b = Decimal(str(b)).quantize(Decimal('0.00000001'), roun...
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN x = int(input()) a = 0 b = 0 comp = 0 while comp == 0 : aa = a**5 tmp = aa - x if tmp < 0: b = -(pow(-tmp,1/5)) elif tmp == 0: b = 0 else: b = pow(tmp,1/5) b = Decimal(str(b)).quantize(Decimal('0.00000001'), roun...
[["-", 0, 656, 0, 52, 8, 196, 0, 57, 0, 121], ["+", 0, 52, 8, 196, 0, 57, 75, 665, 0, 683]]
5
149
/* Author : Xinyuan */ #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define INF 1000000007 #define mod 1005 typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<string> VS; typedef vector<PII> VII; typedef vector<VI> VVI; typedef long long int ll; ll powmod(ll a, ll ...
/* Author : Xinyuan */ #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define INF 1000000007 #define mod 1005 typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<string> VS; typedef vector<PII> VII; typedef vector<VI> VVI; typedef long long int ll; ll powmod(ll a, ll ...
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
292
#include <bits/stdc++.h> using namespace std; #define ll long long ll x; int main() { cin >> x; for (ll i = -120; i <= 120; i++) for (ll j = -120; j <= 120; j++) { if (i * i * i * i * i - j * j * j * j * j == x) cout << i << " " << j; return 0; } return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long ll x; int main() { cin >> x; for (ll i = -120; i <= 120; i++) for (ll j = -120; j <= 120; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j; return 0; } } return 0; }
[["+", 8, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
92
#include <algorithm> #include <iostream> #include <map> #include <string> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; const int inf = 1001001001; typedef long long ll; int main() { ll x; cin >> x; for (int a = -130; a < 130; a++) { ll a5 = a * a * a * a * a; for (int b = -130; b < ...
#include <algorithm> #include <iostream> #include <map> #include <string> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; const int inf = 1001001001; typedef long long ll; int main() { ll x; cin >> x; for (ll a = -2000; a < 2000; a++) { ll a5 = a * a * a * a * a; for (ll b = -2000; b <...
[["-", 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
131
X = int(input()) for i in range(-200,200,1): for j in range(-200,200,1): if (i**5 - j**5) == X: print(str(i) + ' ' + str(j)) break
X = int(input()) for i in range(-200,200,1): for j in range(-200,200,1): if (i**5 - j**5) == X: print(str(i) + ' ' + str(j)) 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
64
#include <bits/stdc++.h> using namespace std; #define ms(x, y) memset(x, y, sizeof(x)) #define lowbit(x) ((x) & (-x)) #define sqr(x) ((x) * (x)) typedef long long LL; typedef pair<int, int> pii; typedef pair<LL, LL> pll; LL calc(LL x) { return x * x * x * x * x; } void run_case() { LL x, a, b; cin >> x; for (a ...
#include <bits/stdc++.h> using namespace std; #define ms(x, y) memset(x, y, sizeof(x)) #define lowbit(x) ((x) & (-x)) #define sqr(x) ((x) * (x)) typedef long long LL; typedef pair<int, int> pii; typedef pair<LL, LL> pll; LL calc(LL x) { return x * x * x * x * x; } void run_case() { LL x, a, b; cin >> x; for (a ...
[["-", 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
199
#include <bits/stdc++.h> using namespace std; #define N 10000 int main() { long long x; cin >> x; for (int b = -N; b < N; b++) { for (int a = -N; a < N; a++) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b << endl; return 0; } } } }
#include <bits/stdc++.h> using namespace std; #define N 120 int main() { long long x; cin >> x; for (int b = -N; b < N; b++) { for (int a = -N; a < N; a++) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b << endl; return 0; } } } }
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
98
import sys X = int(input()) #for a in range(-120,120): # b = a**5-X # if b < 0: b = -(-b)**0.2 # else: b = b**0.2 # if b.is_integer(): # print(a,int(b)) # break for a in range(-120,120): for b in range(-120,120): if a*a-b*b == X: print(a,b) sys.exit()
import sys X = int(input()) #for a in range(-120,120): # b = a**5-X # if b < 0: b = -(-b)**0.2 # else: b = b**0.2 # if b.is_integer(): # print(a,int(b)) # break for a in range(-120,120): for b in range(-120,120): if a**5-b**5 == X: print(a,b) sys.exit()
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 48], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 12, 22], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 17, 578], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["-", 0, 57, 15, 666, 0, 657, 12, 657, 31, 22], ["-", 0, 57, 15, 666, 0, 657, 12, 657, 17, 48], ["+", 0, 57, 15, 666, 0, 657,...
5
61
X=int(input()) a=True for A in range(118+119): if(a): for B in range(118+119): if((A-118)**5+(B-118)**5==X): print(A-118,B-118) a=False break
X=int(input()) a=True for A in range(118+121): if(a): for B in range(118+121): if((A-118)**5-(B-118)**5==X): print(A-118,B-118) a=False break
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 17, 72], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 33]]
5
71
def main(): X = int(input()) for A in range(0, 201): for B in range(-201, 201): if pow(A, 5) + pow(B, 5) == X: print(A, B) return if __name__ == "__main__": main()
def main(): X = int(input()) for A in range(0, 201): for B in range(-201, 201): if pow(A, 5) - pow(B, 5) == X: print(A, B) return 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
68
X=int(input()) for i in range(-200,200): for j in range(-200,200): if (i^5)-(j^5)==X: print(i,j) exit()
X=int(input()) for i in range(-200,200): for j in range(-200,200): if (i**5)-(j**5)==X: print(i,j) exit()
[["-", 15, 666, 0, 657, 31, 23, 0, 657, 17, 140], ["+", 15, 666, 0, 657, 31, 23, 0, 657, 17, 578], ["-", 15, 666, 0, 657, 12, 23, 0, 657, 17, 140], ["+", 15, 666, 0, 657, 12, 23, 0, 657, 17, 578]]
5
54
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #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; using P = pair<int, int>; con...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #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; using P = pair<int, int>; con...
[["-", 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
171
X = int(input()) for a in range(-120,120): for b in range(-120,120): if a**5 - b**5 == X: print(A,B) exit(0)
X = int(input()) for a in range(-120,120): for b in range(-120,120): if a**5 - b**5 == X: print(a,b) exit(0)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
51
// a template for main.cpp #include <bits/stdc++.h> #define ll long long using namespace std; #define f(x) (x) * (x) * (x) * (x) * (x) int main() { ios::sync_with_stdio(false); cin.tie(0); int X; cin >> X; int mx = 100; for (ll i = -mx; i <= mx; i++) { for (ll j = 0; j <= mx; j++) { ll now = f(j...
// a template for main.cpp #include <bits/stdc++.h> #define ll long long using namespace std; #define f(x) (x) * (x) * (x) * (x) * (x) int main() { ios::sync_with_stdio(false); cin.tie(0); int X; cin >> X; int mx = 500; for (ll i = -mx; i <= mx; i++) { for (ll j = 0; j <= mx; j++) { ll now = f(j...
[["-", 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, 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
119
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll ma = pow(10, 4), x; cin >> x; for (int a = ma * (-1); a < ma; a++) { for (int b = ma * (-1); b < ma; b++) { ll A = a * a * a * a * a, B = b * b * b * b * b; if ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll ma = pow(10, 3), x; cin >> x; for (ll a = ma * (-1); a < ma; a++) { for (ll b = ma * (-1); b < ma; b++) { ll A = a * a * a * a * a, B = b * b * b * b * b; if (A...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["-", 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
132
X = int(input()) a = 0 while True: b = a target = (a**5) - X while (b**5) > target: b-=1 if(b**5) == target: print("%d %d",(a,b)) exit() a+=1
X = int(input()) a = 0 while True: b = a target = (a**5) - X while (b**5) > target: b-=1 if(b**5) == target: print("%d %d"%(a,b)) break a+=1
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["-", 0, 1, 0, 652, 3, 4, 0, 660, 0, 25], ["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
65
N, M = map(int, input().split()) H = list(map(int, input().split())) graph = [set() for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) graph[a - 1].add(b - 1) graph[b - 1].add(a - 1) good = [-1] * N for i in range(N): if good[i] != -1: continue if not graph[i]: p...
N, M = map(int, input().split()) H = list(map(int, input().split())) graph = [set() for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) graph[a - 1].add(b - 1) graph[b - 1].add(a - 1) good = [-1] * N for i in range(N): if good[i] != -1: continue if not graph[i]: g...
[["-", 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, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
196
#include <iostream> long long x; using namespace std; long long n, m, h[500000], g[500000]; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> h[i]; g[i] = 1; } for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--, b--; if (h[a] > h[b]) g[b] = 0; if (h[a]...
#include <iostream> long long x; using namespace std; long long n, m, h[500000], g[500000]; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> h[i]; g[i] = 1; } for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--, b--; if (h[a] >= h[b]) g[b] = 0; if (h[a...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
169
n,m=map(int,input().split()) h=list(map(int,input().split())) g=[[]for _ in range(n)] for _ in range(n-1): a,b=map(int,input().split()) g[a-1].append(b-1) g[b-1].append(a-1) ans=0 for i in range(n): M=max([h[c] for c in g[i]]+[0]) if M<h[i]: ans+=1 print(ans)
n,m=map(int,input().split()) h=list(map(int,input().split())) g=[[]for _ in range(n)] for _ in range(m): a,b=map(int,input().split()) g[a-1].append(b-1) g[b-1].append(a-1) ans=0 for i in range(n): M=max([h[c] for c in g[i]]+[0]) if M<h[i]: ans+=1 print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]]
5
146
#include <bits/stdc++.h> #define two(a) (1 << (a)) #define LINF (1ll << 61) #define EPS (1e-14) #define Lshift(a, b) ((a) << (b)) #define Rshift(a, b) ((a) >> (b)) #define rep(a, b) for (a = 0; a < b; a++) #define xrep(a, b, c) for (a = b; a < c; a++) #define INF (1 << 29) #define sz(a) int(a.size()) #define swap(a, b)...
#include <bits/stdc++.h> #define two(a) (1 << (a)) #define LINF (1ll << 61) #define EPS (1e-14) #define Lshift(a, b) ((a) << (b)) #define Rshift(a, b) ((a) >> (b)) #define rep(a, b) for (a = 0; a < b; a++) #define xrep(a, b, c) for (a = b; a < c; a++) #define INF (1 << 29) #define sz(a) int(a.size()) #define swap(a, b)...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 46]]
1
295
N,M=list(map(int,input().split())) h_list=list(map(int,input().split())) h2_list=[True]*N for _ in range(M): A,B=list(map(int,input().split())) if h_list[A-1] < h_list[B-1]: h2_list[A-1] = False elif h_list[A-1] > h_list[B-1]: h2_list[B-1] = False else: h2_list[A-1] = False ...
N,M=list(map(int,input().split())) h_list=list(map(int,input().split())) h2_list=[True]*N for _ in range(M): A,B=list(map(int,input().split())) if h_list[A-1] < h_list[B-1]: h2_list[A-1] = False elif h_list[A-1] > h_list[B-1]: h2_list[B-1] = False else: h2_list[A-1] = False ...
[["-", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372]]
5
153
N,M = map(int,input().split()) H = list(map(int,input().split())) Y = [1]*N for i in range(M): a,b = map(int,input().split()) if H[a-1] <= H[b-1]: Y[a-1] *= 0 if H[a-1] >= H[b-1]: Y[b-1] *= 0 print(Y.count(0))
N,M = map(int,input().split()) H = list(map(int,input().split())) Y = [1]*N for i in range(M): a,b = map(int,input().split()) if H[a-1] <= H[b-1]: Y[a-1] *= 0 if H[a-1] >= H[b-1]: Y[b-1] *= 0 print(Y.count(1))
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612]]
5
119
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
[["-", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95]]
1
315
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, t1, t2; cin >> n >> m; int *h = new int[n]; bool *is_good = new bool[n]; for (int i = 0; i < n; i++) { cin >> h[i]; is_good[i] = true; } for (int i = 0; i < m; i++) { cin >> t1 >> t2; i...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, t1, t2; cin >> n >> m; int *h = new int[n]; bool *is_good = new bool[n]; for (int i = 0; i < n; i++) { cin >> h[i]; is_good[i] = true; } for (int i = 0; i < m; i++) { cin >> t1 >> t2; i...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
212
#include <stdio.h> #include <string.h> long long inp_c1, inp_c2, inp_n1, inp_n2, i1, out_s; long long inp_a[200005]; bool marker[100005]; long long readNumber() { long long temp_func; scanf("%lld", &temp_func); return temp_func; }; long long printNumber(long long temp_func) { printf("%lld ", temp_func); r...
#include <stdio.h> #include <string.h> long long inp_c1, inp_c2, inp_n1, inp_n2, i1, out_s; long long inp_a[100005]; bool marker[100005]; long long readNumber() { long long temp_func; scanf("%lld", &temp_func); return temp_func; }; long long printNumber(long long temp_func) { printf("%lld ", temp_func); r...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 91, 17, 111]]
1
252
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> h(n); for (int i = 0; i < n; i++) cin >> h[i]; vector<bool> high(n, true); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; if (h[a] >= h[b]) high[b] = false; i...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> h(n); for (int i = 0; i < n; i++) cin >> h[i]; vector<bool> high(n, true); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; if (h[a] >= h[b]) high[b] = false; i...
[["-", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
175
n, m = map(int, input().split()) h = list(map(int, input().split())) flags = [True] * n for _ in range(m): a, b = map(int, input().split()) if h[a-1] > h[b-1]: flags[b-1] = False if h[b-1] > h[a-1]: flags[a-1] = False else: flags[a-1] = False flags[b-1] = False print(...
n, m = map(int, input().split()) h = list(map(int, input().split())) flags = [True] * n for _ in range(m): a, b = map(int, input().split()) if h[a-1] > h[b-1]: flags[b-1] = False elif h[b-1] > h[a-1]: flags[a-1] = False else: flags[a-1] = False flags[b-1] = False prin...
[["-", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683]]
5
137
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef map<int, int> mii; typedef map<ll, ll> mll; typedef vector<pii> vii; typedef vector<pll> vll; #define fi first #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef map<int, int> mii; typedef map<ll, ll> mll; typedef vector<pii> vii; typedef vector<pll> vll; #define fi first #define...
[["-", 8, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 8, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
356
X=int(input()) for a in range(1000): for i in range(1000): if a**5-(a-i)**5==X: print(a,a-i) break
X=int(input()) for i in range(1000): for a in range(1000): if a**5-(a-i)**5==X: print(a,a-i) break
[["-", 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
48
x = int(input()) for a in range(1, 10**9): f_a = a**5 r_b = (x-f_a)**(1/5).real b = round(r_b.real) if f_a - b**5 == x: print(a, b) break b *= -1 if f_a - b**5 == x: print(a, b) break
x = int(input()) for a in range(-120, 120): f_a = a**5 r_b = (x-f_a)**(1/5).real b = round(r_b.real) if f_a - b**5 == x: print(a, b) break b *= -1 if f_a - b**5 == x: print(a, b) 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, 7, 12, 652, 3, 4, 0, 657, 31, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 578], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
84
#include <bits/stdc++.h> #include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int main() { int x; cin >> x; rep(a, 1000) { ll a5; a5 = 1; rep(i, 5) a5 *= a; for (int b = -1000; b < 1000; b++) { ll b5; b5 = 1; rep(i, 5) b...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int main() { int x; cin >> x; rep(a, 1000) { ll a5; a5 = 1; rep(i, 5) a5 *= a; for (int b = -1000; b < 1000; b++) { ll b5; b5 = 1; rep(i, 5) b...
[["-", 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], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
122
import sys l = sys.stdin.readline().strip() x = int(l) cands = [] for i in range(-121, 121): cands.append(i**5) for i, one in enumerate(cands): for j, two in enumerate(cands): if one - two == x: print(i-121,j-121) break
import sys l = sys.stdin.readline().strip() x = int(l) cands = [] for i in range(-121, 121): cands.append(i**5) for i, one in enumerate(cands): for j, two in enumerate(cands): if one - two == x: print(i-121,j-121) sys.exit()
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 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
82
//सत्यान्न प्रमदितव्यम् || // Still, Taking my time to perfect the beats // And I still got love for the streets, it's the A-D-D-U #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define nt _int128 #define fir first #define sec second #define fast_as_levi...
//सत्यान्न प्रमदितव्यम् || // Still, Taking my time to perfect the beats // And I still got love for the streets, it's the A-D-D-U #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define nt _int128 #define fir first #define sec second #define fast_as_levi...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]]
1
158
#include <cmath> #include <iostream> using namespace std; typedef long long ll; int main() { ll X; cin >> X; ll A, B; int flag = 0; for (A = 1; A < 100; A++) { for (B = -100; B < 100; B++) { if (pow(A, 5) - pow(B, 5) == X) { flag = 1; break; } } if (flag) break; ...
#include <cmath> #include <iostream> using namespace std; typedef long long ll; int main() { ll X; cin >> X; ll A, B; int flag = 0; for (A = -150; A < 150; A++) { for (B = -150; B < 150; B++) { if (pow(A, 5) - pow(B, 5) == X) { flag = 1; break; } } if (flag) brea...
[["-", 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
110
x = int(input()) for a in range(-500,500): for b in range(500): if a**5-b**5==x: print(a,b) exit()
x = int(input()) for a in range(-300,300): for b in range(-300,300): if a**5-b**5==x: print(a,b) 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], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 1...
5
47
#include <bits/stdc++.h> using namespace std; main() { long long i, j, k, l, m, n, p, q; while (cin >> p) { m = 0; for (i = -200; i <= 200; i++) { for (j = -200; j <= 200; j++) { k = pow(i, 5); l = pow(j, 5); if (k + l == p) { cout << i << " " << j << endl; ...
#include <bits/stdc++.h> using namespace std; main() { long long i, j, k, l, m, n, p, q; while (cin >> p) { m = 0; for (i = -200; i <= 200; i++) { for (j = -200; j <= 200; j++) { k = pow(i, 5); l = pow(j, 5); if (k - l == p) { cout << i << " " << j << endl; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
127
#include <bits/stdc++.h> using namespace std; int main() { long long n, i, j, k, l, m, x, a, b; cin >> x; for (i = -1000; i < 1000; i++) { for (j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << endl; break; } } break; }...
#include <bits/stdc++.h> using namespace std; int main() { long long n, i, j, k, l, m, x, a, b; cin >> x; for (i = -1000; i < 1000; i++) { for (j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << endl; return 0; } } } retur...
[["-", 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], ["-", 8, 9, 0, 7, 8, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 7, 8, 9, 0, 93, 0, 35]]
1
111
#include <cmath> #include <iostream> #define ll long long using namespace std; ll root5(ll x) { ll y = 1; ll pow5 = 1; while (true) { y++; pow5 = pow(y, 5); if (pow5 > x) { y--; break; } else if (pow5 == x) { break; } } return y; } int main() { ll X; cin >> X; ll ...
#include <cmath> #include <iostream> #define ll long long using namespace std; ll root5(ll x) { ll y = 1; ll pow5 = 1; while (true) { y++; pow5 = pow(y, 5); if (pow5 > x) { y--; break; } else if (pow5 == x) { break; } } return y; } int main() { ll X; cin >> X; ll ...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
228
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; using Graph = vector<vector<int>>; typedef long long ll; typedef pair<int, int> P; const int MOD = 1000000007; const int...
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; using Graph = vector<vector<int>>; typedef long long ll; typedef pair<int, int> P; const int MOD = 1000000007; const int...
[["-", 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
197
""" A^5 - B^5 = (A - B)(A^4 + A^3*B + A^2*B^2 + A*B^3 + B^4) = (A - B){(A + B) * (A^3 + B^3) + A^2*B^2} = (A - B){(A + B)^2 * (A^2 - AB + B^2) + A^2*B^2} -> (A + B)^2 > 1, (A^2 - AB + B^2) > 1, A^2*B^2 > 1. """ def main(): print(solve()) def solve(): X = int(input()) for a in range(-100, 100): ...
""" A^5 - B^5 = (A - B)(A^4 + A^3*B + A^2*B^2 + A*B^3 + B^4) = (A - B){(A + B) * (A^3 + B^3) + A^2*B^2} = (A - B){(A + B)^2 * (A^2 - AB + B^2) + A^2*B^2} -> (A + B)^2 > 1, (A^2 - AB + B^2) > 1, A^2*B^2 > 1. """ def main(): print(*solve()) def solve(): X = int(input()) for a in range(-1000, 1000): ...
[["+", 0, 652, 3, 4, 0, 652, 63, 661, 0, 48], ["-", 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
74
x=int(input()) for a in range(-118,119,1): for b in range(-119,118,1): if a**5-b**5==x: print(a,b) else: pass
x=int(input()) for a in range(-118,119,1): for b in range(-119,118,1): if a**5-b**5==x: print(a,b) exit() else: pass
[["+", 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
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
[["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 35]]
1
286
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13]]
1
441
#include <bits/stdc++.h> using namespace std; using namespace __detail; typedef long long ll; #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define fork(i, n) for (ll i = 0; i < (n); i++) #define forn for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i =...
#include <bits/stdc++.h> using namespace std; using namespace __detail; typedef long long ll; #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define fork(i, n) for (ll i = 0; i < (n); i++) #define forn for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i =...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
449
#include <bits/stdc++.h> using namespace std; int main() { int A, B, X; cin >> X; bool finished = false; for (int a = -118; a < 120; a++) { for (int b = -119; b < 119; b++) { if (pow(a, 5) + pow(b, 5) == X) { A = a; B = b; finished = true; break; } } if ...
#include <bits/stdc++.h> using namespace std; int main() { int A, B, X; cin >> X; bool finished = false; for (int a = -118; a < 120; a++) { for (int b = -119; b < 119; b++) { if (pow(a, 5) - pow(b, 5) == X) { A = a; B = b; finished = true; break; } } if ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
115
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
[["-", 0, 43, 49, 50, 51, 41, 64, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 41, 64, 16, 12, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 75, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 75, 22]]
1
200
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; int main() { int x; cin >> x; for (int a = -1000; a <= 1000; a++) { int a5 = 1; rep(i, 5) a5 *= a; for (int b = -1000; b <= 1000; b++) { int b5 = 1; rep(j, 5) b5 *= b; i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; int main() { int x; cin >> x; for (int a = -1000; a <= 1000; a++) { ll a5 = 1; rep(i, 5) a5 *= a; for (int b = -1000; b <= 1000; b++) { ll b5 = 1; rep(j, 5) b5 *= b; if ...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]]
1
119
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 vector<int> vt; set<int> st; map<int, int> mp; unordered_map<string, int> umap; const long long MAX = 1e5; const long long INF = 1e9; const double pi = acos(-1); int main() { int x; cin >> x; for (int i = -2000; i <= 2000; i++) for (int j ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 vector<int> vt; set<int> st; map<int, int> mp; unordered_map<string, int> umap; const long long MAX = 1e5; const long long INF = 1e9; const double pi = acos(-1); int main() { int x; cin >> x; for (long long int i = -2000; i <= 2000; i++) f...
[["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["+", 0, 7, 8, 7, 10, 43, 39, 86, 0, 96]]
1
146
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include...
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include...
[["-", 12, 16, 31, 16, 31, 16, 31, 16, 17, 48], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 72]]
1
974
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ll long long ll Mypow(ll a, ll b) { ll i, ans = 1; for (i = 0; i < b; i++) ans *= a; return ans; } int main() { ll x, a = 0, b = 0; scanf("%lld", &x); for (a = -118; a <= 119; a++) { for (b = -118; b <= 119; b++) { if (x == (...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ll long long ll Mypow(ll a, ll b) { ll i, ans = 1; for (i = 0; i < b; i++) ans *= a; return ans; } int main() { ll x, a = 0, b = 0; scanf("%lld", &x); for (a = -118; a <= 119; a++) { for (b = -118; b <= 119; b++) { if (x == (...
[["-", 15, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 33]]
0
143
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int mod = 1000000007; #define ll long long int main() { int x; cin >> x; rep(i, 1000) rep(j, 1000) { if (pow(i, 5) - pow(j, 5) == x) { cout << i << " " << j << endl; return 0; } if (pow(i, 5) - pow...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int mod = 1000000007; #define ll long long int main() { int x; cin >> x; rep(i, 1000) rep(j, 1000) { if (pow(i, 5) - pow(j, 5) == x) { cout << i << " " << j << endl; return 0; } if (pow(i, 5) + pow...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["-", 31, 16, 12, 2, 3, 4, 0, 91, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33]]
1
122
import sys import re import math import collections import decimal import bisect # import copy # import heapq # from collections import deque # import decimal # sys.setrecursionlimit(100001) INF = sys.maxsize # MOD = 10 ** 9 + 7 ni = lambda: int(sys.stdin.readline()) ns = lambda: map(int, sys.stdin.readline().split(...
import sys import re import math import collections import decimal import bisect # import copy # import heapq # from collections import deque # import decimal # sys.setrecursionlimit(100001) INF = sys.maxsize # MOD = 10 ** 9 + 7 ni = lambda: int(sys.stdin.readline()) ns = lambda: map(int, sys.stdin.readline().split(...
[["+", 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, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
140
def main(): X = int(input()) for a in range(-500, 501): for b in range(-500, 501): if a**2 - b**2 == X: print(a, b) return if __name__ == "__main__": main()
def main(): X = int(input()) for a in range(-500, 501): for b in range(-500, 501): if a**5 - b**5 == X: print(a, b) return if __name__ == "__main__": main()
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["-", 0, 57, 15, 666, 0, 657, 12, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 12, 612]]
5
63
x,r=int(input()),range(-9,999);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]
x,r=int(input()),range(-99,120);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]
[["-", 12, 432, 0, 652, 3, 4, 0, 664, 28, 612], ["+", 12, 432, 0, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 662, 12, 432, 0, 652, 3, 4, 0, 612], ["+", 0, 662, 12, 432, 0, 652, 3, 4, 0, 612]]
5
48
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (i = 0; i < n; i++) using namespace std; signed main() { int x; cin >> x; f...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (i = 0; i < n; i++) #define int long long using namespace std; signed main() { i...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
125
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int x; cin >> x; for (int i = 1; i < 100; i++) { for (int j = -100; j < 100; j++) { if (x == (p...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int x; cin >> x; for (int i = 0; i < 1000; i++) { for (int j = -1000; j < 1000; j++) { if (x ==...
[["-", 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
109
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; #define n1 "\n" #define B begin() #define E end() #define F first #define S second #define pb push_back #define pf push_front #define popb pop_back() #define popf pop_front() const int BIG = 1e5 + 55; const int BIGG = 1e9 + 7; const ll BIGGE = 1e...
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; #define n1 "\n" #define B begin() #define E end() #define F first #define S second #define pb push_back #define pf push_front #define popb pop_back() #define popf pop_front() const int BIG = 1e5 + 55; const int BIGG = 1e9 + 7; const ll BIGGE = 1e...
[["-", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["+", 0, 57, 75, 76, 0, 9, 0, 43, 39, 78], ["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 46]]
1
243
x = int(input()) for i in range(-150,150): for j in range(-150,150): if (i**5 - j**5 == x): print(i,j)
x = int(input()) for i in range(-150,150): for j in range(-150,150): if (i**5 - j**5 == x): print(i,j) exit(0)
[["+", 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, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
49
x = int(input()) for a in range(-120, 121): for b in range(-120, 121): if a**5 - b**5 == x: break print(a, b)
x = int(input()) for a in range(-120, 121): for b in range(-120, 121): if a**5 - b**5 == x: print(a, b) exit()
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24]]
5
48
X=int(input()) stp=0 for a in range(X): if stp==1: break else: for b in range(X): A=a**5 B=b**5 tmp1=A-B tmp2=-A+B tmp3=-A-B tmp4=A+B if tmp1==X: print(a,b) stp=1 b...
X=int(input()) stp=0 for a in range(120): if stp==1: break else: for b in range(120): A=a**5 B=b**5 tmp1=A-B tmp2=-A+B tmp3=-A-B tmp4=A+B if tmp1==X: print(a,b) stp=1 ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
131
x=int(input()) for i in range(0,1000): for j in range(-1000,1000): if i**5-j**5==x: print("{} {}".format(i,j)) break
x=int(input()) for i in range(0,1000): for j in range(-1000,1000): if i**5-j**5==x: print("{} {}".format(i,j)) exit(0)
[["-", 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, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
54
x=int(input()) r=range(200) [i**5-x-j**5or exit(print(i,j))for i in r for j in r]
x=int(input()) r=range(-99,200) [i**5-x-j**5or exit(print(i,j))for i in r for j in r]
[["+", 0, 662, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
43
def main(): import sys input = sys.stdin.readline X = int(input()) for a in range(200, 200): a5 = a**5 b5 = a5-X for b in range(200, 200): if b**5 == b5: print(a, b) exit() if __name__ == "__main__": main()
def main(): import sys input = sys.stdin.readline X = int(input()) for a in range(-200, 200): a5 = a**5 b5 = a5-X for b in range(-200, 200): if b**5 == b5: print(a, b) exit() if __name__ == "__main__": main()
[["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33]]
5
78
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> typedef long double ld; typedef long long ll; const ll INF = (ll)1e18 + 1; const ll MOD = 1e9 + 7; // Minimum, Maximum template <class T> T minimum(T he...
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> typedef long double ld; typedef long long ll; const ll INF = (ll)1e18 + 1; const ll MOD = 1e9 + 7; // Minimum, Maximum template <class T> T minimum(T he...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
696
if __name__ == '__main__': x = int(input()) a = -1 b = -1 for i in range(0,101,1): got = False for j in range(0,101,1): if (i**5 - j**5) is x: a = i b = j got = True break if (i**5 + j**5) is x: ...
if __name__ == '__main__': x = int(input()) a = -1 b = -1 for i in range(0,1001,1): got = False for j in range(0,1001,1): # print(str(i)+" "+str(j)) if (i**5 - j**5) == x: a = i b = j got = True break...
[["-", 64, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 64, 196, 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], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 709], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60]]
5
112
#include <cstdio> int main() { int X; scanf("%d", X); for (int A = 0; A < 1000; ++A) for (int B = -1000; B < A; ++B) if (A * A * A * A * A - B * B * B * B * B == X) { printf("%d %d", A, B); return 0; } }
#include <cstdio> int main() { int X; scanf("%d", &X); for (int A = 0; A < 1000; ++A) for (int B = -1000; B < A; ++B) if (A * A * A * A * A - B * B * B * B * B == X) { printf("%d %d", A, B); return 0; } }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
1
88
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int x; cin >> x; ll r; for (int a = 1; a <= 1000; a++) { for (int b = -1000; b <= 1000; b++) { r = a * a * a * a * a - b * b * b * b * b; ...
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int x; cin >> x; ll r; for (int a = 0; a <= 1000; a++) { for (int b = -1000; b <= 1000; b++) { r = a * a * a * a * a - b * b * b * b * b; ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
119
X = int(input()) pow5 = [i**5 for i in range(-150,150)] for a in range(-150,150): for b in range(-150,150): if pow5[a+150]-pow5[b+150] ==X: print(a,b) break
X = int(input()) pow5 = [i**5 for i in range(-150,150)] for a in range(-150,150): for b in range(-150,150): if pow5[a+150]-pow5[b+150] ==X: print(a,b) exit(0)
[["-", 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, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
71
import math X = int(input()) def fif_root(arg): def root(): return math.floor(math.pow(x,1/5)*pow(10,10))/pow(10,10) return list(map(lambda x: root(x), arg)) def check_integer(arg): return list(map(lambda x: x.is_integer(), arg)) a = 0 while (A:= math.pow(a, 5))-math.pow(a-1, 5) <= X: #a,-aの...
import math X = int(input()) def fif_root(arg): def root(x): return math.floor(math.pow(x,1/5)*pow(10,10))/pow(10,10) return list(map(lambda x: root(x), arg)) def check_integer(arg): return list(map(lambda x: x.is_integer(), arg)) a = 0 while (A:= math.pow(a, 5))-math.pow(a-1, 5) <= X: #a,-a...
[["+", 0, 14, 8, 196, 0, 14, 54, 54, 0, 22]]
5
204
import math x = int(input()) def f(a, b): return a ** 5 - b ** 5 def make_divisors(n): divisors = [] for i in range(1, int(math.sqrt(n)) + 1): if n % i == 0: divisors.append(i) # √nで無い数についてもう一個プラス if i != n // i: divisors.append(n // i) return...
import math x = int(input()) def f(a, b): return a ** 5 - b ** 5 def make_divisors(n): divisors = [] for i in range(1, int(math.sqrt(n)) + 1): if n % i == 0: divisors.append(i) # √nで無い数についてもう一個プラス if i != n // i: divisors.append(n // i) return...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
157
#include <iostream> using namespace std; int main() { int x; cin >> x; for (int i = -10000; i < 10000; i++) { for (int j = -60000; j < 60000; j++) { if (j * j * j * j * j - i * i * i * i * i == x) { cout << j << " " << i << endl; return 0; } } } return 0; }
#include <iostream> using namespace std; int main() { int x; cin >> x; for (int i = -119; i < 119; i++) { for (int j = -118; j <= 119; j++) { if (j * j * j * j * j - i * i * i * i * i == x) { cout << j << " " << i << endl; return 0; } } } 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, 17, 18], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15...
1
95