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 = int(input()) for a in range(-100,101) : powa = pow(a,5) for b in range(-100,101) : powb = pow(b,5) if (powa + powb == X) : print(a,b) exit()
X = int(input()) for a in range(-1000,1001) : powa = pow(a,5) for b in range(-1000,1001) : powb = pow(b,5) # print(a,b,powa,powb) if (powa - powb == 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], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 17, 72], ["+", 0...
5
64
#include <cmath> #include <iostream> #include <map> #include <utility> #include <vector> int main() { long X; std::cin >> X; std::map<long, std::pair<long, long>> M; for (long i = 0; i < 200; ++i) { for (long j = 0; j < 200; ++j) { long ans1 = i * i * i * i * i - j * j * j * j * j; long ans2 = i...
#include <cmath> #include <iostream> #include <map> #include <utility> #include <vector> int main() { long X; std::cin >> X; std::map<long, std::pair<long, long>> M; for (long i = 0; i < 200; ++i) { for (long j = 0; j < 200; ++j) { long ans1 = i * i * i * i * i - j * j * j * j * j; long ans2 = i...
[["+", 3, 4, 0, 2, 3, 4, 0, 91, 17, 33]]
1
225
#include <iostream> using namespace std; int main(void) { long long int X; cin >> X; for (int i = -1001; i < 1001; i++) { for (int j = -1000; j < 1001; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } } } }
#include <iostream> using namespace std; int main(void) { long long int X; cin >> X; for (long long int i = -1000; i < 1001; i++) { for (long long int j = -1000; j < 1001; 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, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
95
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; for (int a = -500; a < 500; ++a) { for (int b = -500; b < 500; ++b) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b; return 0; } } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; for (long long a = -500; a < 500; ++a) { for (long long b = -500; b < 500; ++b) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b; return 0; } } } return 0; }
[["-", 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
93
import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long target = sc.nextLong(); // long l =100000*100000; // System.out.println(l); HashSet<Integer> A = new HashSet<Integer>(); HashSet<Inte...
import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long target = sc.nextLong(); // long l =100000*100000; // System.out.println(l); HashSet<Integer> A = new HashSet<Integer>(); HashSet<Inte...
[["-", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499], ["+", 0, 7, 502, 503, 49, 200, 51, 91, 439, 499]]
3
190
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> //#include"testlib.h" #define endl "\n" #define all(v) v.begin(), v.end() #define allr(s) s.rbegin(), s.rend() #define RT(s) return cout << s, 0 #define watch(x) cout << (#x) << " = " << x << endl #define sz(s) (int)(s.size()) #define PI ...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> //#include"testlib.h" #define endl "\n" #define all(v) v.begin(), v.end() #define allr(s) s.rbegin(), s.rend() #define RT(s) return cout << s, 0 #define watch(x) cout << (#x) << " = " << x << endl #define sz(s) (int)(s.size()) #define PI ...
[["-", 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
326
x = int(input()) for a in range(-100,100): f = 0 for b in range(-100,100): if a**5+b**5==x: print(a,b) f = 1 break if f: break
x = int(input()) for a in range(-1000,1000): f = 0 for b in range(-1000,1000): if a**5-b**5==x: print(a,b) f = 1 break if f: 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], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", ...
5
58
#include <bits/stdc++.h> #define MAX_NUM (1000000000 + 7) typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr; } template <ty...
#include <bits/stdc++.h> #define MAX_NUM (1000000000 + 7) typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr; } template <ty...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 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, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, ...
1
416
#include <bits/stdc++.h> using namespace std; const long long c = 1e18; long long X; long long f(long long a, long long b) { long long powa = pow(a, 5); long long powb = pow(b, 5); return powa - powb; } int main() { cin >> X; long long i = 0; while (i <= 178) { long long j = -64; while (j <= 178) { ...
#include <bits/stdc++.h> using namespace std; const long long c = 1e18; long long X; long long f(long long a, long long b) { long long powa = pow(a, 5); long long powb = pow(b, 5); return powa - powb; } int main() { cin >> X; long long i = 0; while (i <= 178) { long long j = -64; while (j <= 178) { ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
138
x = int(input()) ans = [] for i in range(0, x//2+1): a = i**5 diff = x - a print(diff) if diff == 0: ans.append(i) ans.append(0) break elif diff < 0: j = 0 while True: b = j**5 if diff*(-1) < b: break if a...
x = int(input()) ans = [] for i in range(0, x//2+1): a = i**5 diff = x - a if diff == 0: ans.append(i) ans.append(0) break elif diff < 0: j = 0 while True: b = j**5 if diff*(-1) < b: break if a-b == x: ...
[["-", 0, 7, 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
179
import itertools X = int(input()) ansL1 = [i for i in range(130)] ansL2 = [i * (-1) for i in range(1, 130)] ansL1.extend(ansL2) L1 = [pow(i, 5)for i in range(130)] L2 = [pow((-1)*i, 5)for i in range(1, 130)] L1.extend(L2) print(L1) for v in itertools.combinations(L1, 2): if v[0] - v[1] == X: for i in ra...
import itertools X = int(input()) ansL1 = [i for i in range(130)] ansL2 = [i * (-1) for i in range(1, 130)] ansL1.extend(ansL2) L1 = [pow(i, 5)for i in range(130)] L2 = [pow((-1)*i, 5)for i in range(1, 130)] L1.extend(L2) for v in itertools.combinations(L1, 2): if v[0] - v[1] == X: for i in range(len(L1...
[["-", 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
177
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; bool ans = false; for (long long a = 0; a < 10000; a++) { for (long long b = 0; b < 10000; b++) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b; ans = true; break; } ...
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; bool ans = false; for (long long a = 0; a < 1000000; a++) { for (long long b = 0; b < 200; b++) { if (a * a * a * a * a - b * b * b * b * b == x) { cout << a << " " << b; ans = true; break; } ...
[["-", 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], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 17, 48]]
1
154
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <set> #include <tuple> #include <vector> using namespace std; typedef long long ll; ll const A_MAX = 1000; ll const B_MAX = 1000; int main() { ll X; cin >> X; ll a, b; for (ll i = 0; i < A_MAX; i++) { for (ll...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <set> #include <tuple> #include <vector> using namespace std; typedef long long ll; ll const A_MAX = 1000; ll const B_MAX = 1000; int main() { ll X; cin >> X; ll a, b; for (ll i = 0; i < A_MAX; i++) { for (ll...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
172
#include <bits/stdc++.h> #define int long long #define endl '\n' #define FOR(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; vector<long long> divisor(long long n) { vector<long long> res; for (long long i = 1; i * i <= n; i++) { if (n % i) continue; res.p...
#include <bits/stdc++.h> #define int long long #define endl '\n' #define FOR(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; vector<long long> divisor(long long n) { vector<long long> res; for (long long i = 1; i * i <= n; i++) { if (n % i) continue; res.p...
[["+", 15, 339, 51, 16, 31, 16, 31, 91, 17, 33]]
1
344
x = int(input()) p = 0 while True: p += 1 for i in range(-p,p): for j in range(-p,p): # print (i,j) if i**5 + j**5 == x: print (i,j) exit ()
x = int(input()) p = 0 while True: p += 1 for i in range(-p,p): for j in range(-p,p): if i**5 - j**5 == x: print (i,j) exit ()
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
60
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> S(ll X) { vector<ll> res(0); for (int i = 2; i <= sqrt(X); i++) { if (X % i == 0) { res.push_back(i); res.push_back(-i); } } return res; } int main() { ll X; cin >> X; vector<ll> C = S(X); ll Csize = C.s...
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> S(ll X) { vector<ll> res(0); for (int i = 1; i <= sqrt(X); i++) { if (X % i == 0) { res.push_back(i); res.push_back(-i); } } return res; } int main() { ll X; cin >> X; vector<ll> C = S(X); ll Csize = C.s...
[["-", 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
300
#include <bits/stdc++.h> using namespace std; #define __ << ' ' << #define ___ << ' ' #define bash push_back #define ALL(x) x.begin(), x.end() //#define int long long struct IoSetup { IoSetup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12); cerr << fixed << setprecision...
#include <bits/stdc++.h> using namespace std; #define __ << ' ' << #define ___ << ' ' #define bash push_back #define ALL(x) x.begin(), x.end() //#define int long long struct IoSetup { IoSetup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12); cerr << fixed << setprecision...
[["-", 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
486
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define SPEED \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define SPEED \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 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], ["+", 64, 9, 0, 1, 0, 16, 12, 91, 17, 33], ["-", 64, 9, 0, 1, 0, 16...
1
159
x = int(input()) s = [] flag = 0 for i in range(-100, 100): s.append(i**5) a = -80 for n in s: b = -80 for m in s: if n-m == x: print(a,b) flag = 1 break if flag: break b += 1 a += 1
x = int(input()) s = [] flag = 0 for i in range(-200, 200): s.append(i**5) a = -200 for n in s: b = -200 for m in s: if n-m == x: print(a,b) flag = 1 break if flag: break b += 1 a += 1
[["-", 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, 656, 0, 1, 0, 662, 12, 664, 28, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 664, 28, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 664, 28, 612], ...
5
79
from sys import exit 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 = int(input()) lists = make_divisors(X) print(lists...
from sys import exit 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 = int(input()) lists = make_divisors(X) for i in ra...
[["-", 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
128
import sys import math import fractions from collections import deque from collections import defaultdict sys.setrecursionlimit(10**7) X = int(input()) l = [] for i in range(0, 1000): l.append(i ** 5) for i in range(len(l)): for j in range(len(l)): if l[i] + l[j] == X: print(i, j) ...
import sys import math import fractions from collections import deque from collections import defaultdict sys.setrecursionlimit(10**7) X = int(input()) l = [] for i in range(0, 1000): l.append(i ** 5) for i in range(len(l)): for j in range(len(l)): if l[i] - l[j] == X: print(i, j) ...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72]]
5
123
/* #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pb...
/* #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pb...
[["-", 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
217
def foo(): for i in range(len(F)): for j in range(len(F)): if F[i] + F[j] == X: print(i, j) return if F[i] - F[j] == X: print(i, -j) return X = int(input()) F = [i**5 for i in range(1000)] flg = False foo()
def foo(): for i in range(len(F)): for j in range(len(F)): if F[i] + F[j] == X: print(i, -j) return if F[i] - F[j] == X: print(i, j) return X = int(input()) F = [i**5 for i in range(1000)] flg = False foo()
[["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]]
5
96
#!/usr/bin/env python3 import sys def show(): for i in range(100): print(i, i**5) def solve(X: int): A = [(i ** 5, i) for i in range(100)] for a, b in A: for aa, bb in A: if a - aa == X: return b, -bb if a + aa == X: return b, bb ...
#!/usr/bin/env python3 import sys def show(): for i in range(100): print(i, i**5) def solve(X: int): A = [(i ** 5, i) for i in range(1000)] for a, b in A: for aa, bb in A: if a - aa == X: return b, bb if a + aa == X: return b, -bb ...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 64, 196, 0, 37, 0, 432, 0, 664, 17, 33], ["+", 64, 196, 0, 37, 0, 432, 0, 664, 17, 33]]
5
164
x = int(input()) rs = [i ** 5 for i in range(300)] for r in rs: if r <= x: if x - r in rs: print(rs.index(r), rs.index(x - r)) break if r > x: if r - x in rs: print(rs.index(r), - rs.index(r - x)) break
x = int(input()) rs = [i ** 5 for i in range(300)] for r in rs: if r <= x: if x - r in rs: print(rs.index(r), - rs.index(x - r)) break if r > x: if r - x in rs: print(rs.index(r), rs.index(r - x)) break
[["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]]
5
90
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> //....................
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> //....................
[["-", 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
395
x = int(input()) flag = 0 for i in range(1, 110): for j in range(-100, 100): if i ** 5 - j ** 5 == x: print(i, j) flag = 1 break if flag == 1: break
x = int(input()) flag = 0 for i in range(-200, 200): for j in range(-200, 200): if i ** 5 - j ** 5 == x: print(i, j) flag = 1 break if flag == 1: 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], ["-", 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
59
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespac...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespac...
[["-", 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
197
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; // 繰り返し自乗法 mod なし ll repeatSquaring(ll x, ll n) { if (n == 1) return x; if (n % 2 == 1) return (x * repeatSquaring(x, n - 1)); ll half = repeatSquaring(x, n / 2); return half * half; } ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; // 繰り返し自乗法 mod なし ll repeatSquaring(ll x, ll n) { if (n == 1) return x; if (n % 2 == 1) return (x * repeatSquaring(x, n - 1)); ll half = repeatSquaring(x, n / 2); return half * half; } ...
[["-", 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
172
#include <algorithm> #include <bitset> #include <cassert> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespa...
#include <algorithm> #include <bitset> #include <cassert> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespa...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 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
722
#include <bits/stdc++.h> #define eb emplace_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <...
#include <bits/stdc++.h> #define eb emplace_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define forn(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <...
[["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
544
d = {} for i in range(-63,63): temp = i**5 if temp not in d: d[temp] = i posd = {} for i in range(1,63): temp = i**5 if temp not in posd: posd[temp] = i x = int(input()) for i in posd: if i-x in d: print(posd[i],d[i-x]) break
d = {} for i in range(-1000,1000): temp = i**5 if temp not in d: d[temp] = i posd = {} for i in range(0,1000): temp = i**5 if temp not in posd: posd[temp] = i x = int(input()) for i in posd: if i-x in d: print(posd[i],d[i-x]) 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]]
5
98
x = gets.to_i flag = 0 a = b = 0 while flag == 0 && a < 10 d = a**5 - x tmp = (d**(1/5.0)).abs if d - (tmp.abs.floor)**5 == 0 flag = 1 b = tmp.abs.floor elsif d + (tmp.abs.floor)**5 == 0 flag = 1 b = tmp.abs.floor * (-1) else a += 1 end end puts "#{a} #{b}"
x = gets.to_i flag = 0 a = b = 0 while flag == 0 d = a**5 - x tmp = (d**(1/5.0)).abs #puts "#{a} #{d} #{tmp} #{tmp.floor}" if d - (tmp.abs.floor)**5 == 0 flag = 1 b = tmp.abs.floor elsif d + (tmp.abs.floor)**5 == 0 flag = 1 b = tmp.abs.floor * (-1) else a += 1 end end puts "#{a} #{b}"
[["-", 36, 36, 0, 493, 0, 89, 15, 738, 17, 98], ["-", 0, 493, 0, 89, 15, 738, 12, 738, 31, 22], ["-", 0, 493, 0, 89, 15, 738, 12, 738, 17, 18], ["-", 0, 493, 0, 89, 15, 738, 12, 738, 12, 612]]
4
110
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #define ll long long int...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #define ll long long int...
[["-", 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
269
#include "bits/stdc++.h" using namespace std; using ll = long long; const ll inf = 1e18; const int N = 2 * 1e5 + 10; ll res; ll a[N]; void solve() { ll x; cin >> x; for (int i = -1000; i <= 1000; ++i) { ll yy = x + powl(i, 5); double zz = 0.2; ll tt = powl(yy, zz); ll kk = powl(tt, 5); if ...
#include "bits/stdc++.h" using namespace std; using ll = long long; const ll inf = 1e18; const int N = 2 * 1e5 + 10; ll res; ll a[N]; void solve() { ll x; cin >> x; for (int i = -1000; i <= 1000; ++i) { ll yy = x + powl(i, 5); double zz = 0.2; ll tt = powl(yy, zz); ll kk = powl(tt, 5); if ...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22]]
1
179
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define INF 1LL << 60; #define LLINF 1e12 #define PI 3.14159265359 int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define INF 1LL << 60; #define LLINF 1e12 #define PI 3.14159265359 int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int ...
[["-", 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
507
#!/usr/bin/env python3 import sys def solve(X: int): # b が負 for a in range(0, 101): for b in range(0, -101, -1): if a**5 + b**5 == X: print(a, b) exit() for a in range(0, 121): for b in range(0, 120): if a**5 + b**5 == X: ...
#!/usr/bin/env python3 import sys def solve(X: int): # b が負 for a in range(0, 101): for b in range(0, -101, -1): if a**5 - b**5 == X: print(a, b) exit() for a in range(0, 121): for b in range(0, 120): if a**5 - b**5 == X: ...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
155
x = int(input()) for a in range(10**4): for b in range(-10**4,10**4): if a**5 - b**5 == X: print(a,b) break else: continue break
X = int(input()) for a in range(10**4): for b in range(-10**4,10**4): if a**5 - b**5 == X: print(a,b) break else: continue break
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
55
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; /* short */ #define pb push_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v), rend(v) /* REPmacro */ #define FOR(i, a, b) for (ll i...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; /* short */ #define pb push_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v), rend(v) /* REPmacro */ #define FOR(i, a, b) for (ll i...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 16, 31, 16, 31, 16, 12, 91, 28, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 91, 28, 22]]
1
426
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se se...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se se...
[["-", 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, 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
170
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; int main() { ll X; cin >> X; vector<ll> num; ll a; for (ll i = -1000; i < 101; i++) { a = i * i * i * i * i; num.push_back(a); } for (int i = 0; i < num.size(); i++) { auto itr ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; int main() { ll X; cin >> X; vector<ll> num; ll a; for (ll i = -1000; i < 1001; i++) { a = i * i * i * i * i; num.push_back(a); } for (int i = 0; i < num.size(); i++) { auto itr...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
171
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define inf 9e18 #define mod 1000000007 #define mod1 998244353 long long int power(long long int a, long long int n, long long int m); long long int power(long long int a, long long int n, long long int m) { if (n == 0) return 1; long long ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define inf 9e18 #define mod 1000000007 #define mod1 998244353 long long int power(long long int a, long long int n, long long int m); long long int power(long long int a, long long int n, long long int m) { if (n == 0) return 1; long long ...
[["-", 15, 339, 51, 16, 31, 16, 31, 91, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
261
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ff first #define ss second #define ll long long int #define endl "\n" #define FASTIO \ ios_base::sync_with_stdio(false); \ cin.tie(NU...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ff first #define ss second #define ll long long int #define endl "\n" #define FASTIO \ ios_base::sync_with_stdio(false); \ cin.tie(NU...
[["-", 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, 43, 49, 50, 49, 22], ["+", 0, 7, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 31, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["+", 31...
1
299
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 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) { cout << i << ' ' << j << en...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long x; cin >> x; for (long long i = -200; i <= 200; i++) { for (long long j = -200; j <= 200; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << 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
113
#include <bits/stdc++.h> using namespace std; int main() { int x, a = 0, b = 0; bool flag = 0; cin >> x; for (int i = -1000; i < 1000; i++) { for (int j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { a = i; b = j; flag = 1; break; } ...
#include <bits/stdc++.h> using namespace std; int main() { long long x, a = 0, b = 0; bool flag = 0; cin >> x; for (long long i = -1000; i < 1000; i++) { for (long long j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == x) { a = i; b = j; flag = 1; ...
[["-", 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
124
#include <bits/stdc++.h> using namespace std; long long Pow(long long a, int b) { int mul = 1; for (int i = 1; i <= b; i++) mul *= a; return mul; } int main() { int x; scanf("%d", &x); for (long long i = -300; i <= 300; i++) for (long long j = -300; j <= 300; j++) if (Pow(i, 5) - Pow(j, 5) == ...
#include <bits/stdc++.h> using namespace std; long long Pow(long long a, int b) { long long mul = 1; for (int i = 1; i <= b; i++) mul *= a; return mul; } int main() { int x; scanf("%d", &x); for (long long i = -300; i <= 300; i++) for (long long j = -300; j <= 300; j++) if (Pow(i, 5) - Pow(j, ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
128
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; for (int i = -5000; i < 5000; i++) { for (int j = -5000; j < 5000; j++) { if (n == (i * i * i * i * i) - (j * j * j * j * j)) { cout << i << " " << j << endl; return (0); } } } return (0); }
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; for (long long i = -5000; i < 5000; i++) { for (long long j = -5000; j < 5000; j++) { if (n == (i * i * i * i * i) - (j * j * j * j * j)) { cout << i << " " << j << endl; return (0); } } } ret...
[["-", 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
104
X = int(input()) C = 0 for i in range(-0000,1000): if C == 1: break for j in range(-0000,1000): if i**5-j**5 == X: print(i,j) C += 1 break
X = int(input()) C = 0 for i in range(-1000,1000): if C == 1: break for j in range(-1000,1000): if i**5-j**5 == X: print(i,j) C += 1 break
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612]]
5
60
//#include <bits/stdc++.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric...
//#include <bits/stdc++.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric...
[["-", 31, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["+", 31, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["-", 0, 16, 12, 118, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 118, 28, 69, 341, 342, 0, 22]]
1
247
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
[["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33], ["+", 31, 16, 31, 16, 31, 16, 12, 91, 17, 33]]
1
1,198
#include <bits/stdc++.h> using namespace std; #define int long long int sq(int x) { return x * x * x * x * x; } signed main() { int x; cin >> x; for (int a = -5000; a <= 5000; a++) { for (int b = -5000; b <= 5000; b++) { if (sq(a) + sq(b) == x) { cout << a << " " << b << endl; return ...
#include <bits/stdc++.h> using namespace std; #define int long long int sq(int x) { return x * x * x * x * x; } signed main() { int x; cin >> x; for (int a = -5000; a <= 5000; a++) { for (int b = -5000; b <= 5000; b++) { if (sq(a) - sq(b) == x) { cout << a << " " << b << endl; return ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
107
#include <bits/stdc++.h> using namespace std; map<long long int, long long int> memo; int main(void) { cin.tie(0); ios::sync_with_stdio(false); long long int x; cin >> x; for (int i = -1000; i <= 1000; i++) { long long int B = i * i * i * i * i; memo[B] = i; } for (int i = -1000; i <= 1000; ...
#include <bits/stdc++.h> using namespace std; map<long long int, long long int> memo; int main(void) { cin.tie(0); ios::sync_with_stdio(false); long long int x; cin >> x; for (long long int i = -1000; i <= 1000; i++) { long long int B = i * i * i * i * i; // cout << ' ' << B << ' ' << i << '\n'; ...
[["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
165
#include <iostream> using namespace std; #include <algorithm> #include <iomanip> #include <map> #include <queue> #include <set> #include <string> #include <vector> int main() { long long int x; cin >> x; for (long long int a = -10000; a <= 10000; a++) { long long int aa = a * a * a * a * a; for (long ...
#include <iostream> using namespace std; #include <algorithm> #include <iomanip> #include <map> #include <queue> #include <set> #include <string> #include <vector> int main() { long long int x; cin >> x; for (long long int a = -1000; a <= 1000; a++) { long long int aa = a * a * a * a * a; for (long lo...
[["-", 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
129
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina...
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
182
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
[["-", 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
1,028
#include <bits/stdc++.h> #define ll long long #define ld long double #define mp make_pair #define pb push_back #define vll vector<ll> #define endl "\n" #define pll pair<ll, ll> #define all(x) (x).begin(), (x).end() #define f first #define s second #define pr(x) cout << x << endl; #define pr2(x, y) cout << x << " " << y...
#include <bits/stdc++.h> #define ll long long #define ld long double #define mp make_pair #define pb push_back #define vll vector<ll> #define endl "\n" #define pll pair<ll, ll> #define all(x) (x).begin(), (x).end() #define f first #define s second #define pr(x) cout << x << endl; #define pr2(x, y) cout << x << " " << y...
[["-", 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], ["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 15, 339, 51, 1...
1
308
#include <bits/stdc++.h> using namespace std; #define ll long long int #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statis...
#include <bits/stdc++.h> using namespace std; #define ll long long int #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statis...
[["-", 0, 30, 0, 14, 8, 9, 0, 7, 15, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
272
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) using ll = long long; using ld = long double; #define int ll #define double ld #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // con...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) using ll = long long; using ld = long double; #define int ll #define double ld #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // con...
[["-", 0, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 13]]
1
1,685
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; const double PI = 3.14159265358979; const ll INF = pow(10, 18); typedef pair<ll, ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) string abc ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1000000007; const double PI = 3.14159265358979; const ll INF = pow(10, 18); typedef pair<ll, ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) string abc ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["-", 0, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 13]]
1
173
#include <bits/stdc++.h> using namespace std; // int _; int x; int main() { // for(scanf("%d",&_);_;_--) cin >> x; for (int i = 0; i < 1000; i++) for (int j = 0; j < 1000; j++) { for (int k = 0; k < 3; k++) { if (k == 1) i = -i; if (k == 2) j = -j; if (abs(...
#include <bits/stdc++.h> using namespace std; // int _; int x; int main() { // for(scanf("%d",&_);_;_--) cin >> x; for (int i = 0; i < 1000; i++) for (int j = 0; j < 1000; j++) { for (int k = 0; k < 3; k++) { if (k == 1) i = -i; if (k == 2) j = -j; if (i * ...
[["-", 0, 57, 15, 339, 51, 16, 31, 2, 63, 22], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]]
1
150
lis = [i ** 5 for i in range(-300,300)] x = int(input()) for i in range(len(lis)): for j in range(len(lis)): if lis[i] + lis[j] == x: print(i-300,j-300) exit()
lis = [i ** 5 for i in range(-300,300)] x = int(input()) for i in range(len(lis)): for j in range(len(lis)): if lis[i] - lis[j] == x: print(i-300,j-300) exit()
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
73
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 42, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 42, 0, 1, 0, 11, 12, 16, 12, 22]]
1
1,653
/* * Welcome to my code! *---------------------------------------------* * author : lynmisakura(twitter : @andoreiji11) */ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include ...
/* * Welcome to my code! *---------------------------------------------* * author : lynmisakura(twitter : @andoreiji11) */ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include ...
[["-", 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
542
/* Author - Param Kothari Ah shit, here we go again */ #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); ...
/* Author - Param Kothari Ah shit, here we go again */ #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); ...
[["-", 31, 16, 31, 16, 31, 16, 12, 16, 31, 22], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22]]
1
294
#include <algorithm> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { long long x; cin >> x; for (long long i = -10000; i <= 10000; i++) { for (long long j = -10000; j <= 10000; j++) { long long tmp = 0; ...
#include <algorithm> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { long long x; cin >> x; for (long long i = -6208; i <= 6208; i++) { for (long long j = -6208; j <= 6208; j++) { long long tmp = 0; tmp ...
[["-", 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
121
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> using namespace __gnu_pbds; using namespace std; // Declaring ordered_set typedef tree<long long int, null_type, less<long long int>, rb_tree_tag, tree_order_stat...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> using namespace __gnu_pbds; using namespace std; // Declaring ordered_set typedef tree<long long int, null_type, less<long long int>, rb_tree_tag, tree_order_stat...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
427
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for (int i = 0; i < n; ++i) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #defi...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for (int i = 0; i < n; ++i) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #defi...
[["-", 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
642
#include <bits/stdc++.h> #include <iostream> //#include <algorithm> // #include <iomanip> #define ll long long #define map unordered_map #define set unordered_set using namespace std; const ll MOD = 1000000007; const ll INF = (1LL << 62); ll values[2005]; int main() { ll X; scanf("%lld", &X); for (ll i = 0;...
#include <bits/stdc++.h> #include <iostream> //#include <algorithm> // #include <iomanip> #define ll long long #define map unordered_map #define set unordered_set using namespace std; const ll MOD = 1000000007; const ll INF = (1LL << 62); ll values[2005]; int main() { ll X; scanf("%lld", &X); for (ll i = 0;...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
181
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll x; cin >> x; for (ll i = -10000; i <= 10000; i++) { for (ll j = -10000; j <= 10000; j++) { if ((i - j) * (i * i * i * i + i * i * i * j + i * i * j * j + i * j * j * j + j * j * j * j) == x...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll x; cin >> x; for (ll i = -1000; i <= 1000; i++) { for (ll j = -1000; j <= 1000; j++) { if ((i - j) * (i * i * i * i + i * i * i * j + i * i * j * j + i * j * j * j + j * j * j * j) == 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
123
X = int(input()) L = [i ** 5 for i in range(0, 500)] for i in L: for j in L: if i + j == X: print(int(i**0.2), int(j**0.2)) exit() if i - j == X: print(int(i**0.2), -int(j**0.2)) exit() if -i + j == X: print(-int(i**0.2), int(j**0.2...
X = int(input()) L = [i ** 5 for i in range(0, 500)] for i in L: for j in L: if i + j == X: print(int(i**0.2), -int(j**0.2)) exit() if i - j == X: print(int(i**0.2), int(j**0.2)) exit() if -i + j == X: print(-int(i**0.2), -int(j**0....
[["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]]
5
144
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll X; cin >> X; for (int x = -1000; x < 1000; ++x) { for (int y = -1000; y < 1000; ++y) { ll a = x * x * x * x...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll X; cin >> X; for (ll x = -1000; x < 1000; ++x) { for (ll y = -1000; y < 1000; ++y) { ll a = x * x * x * x *...
[["-", 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
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <ostream> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <t...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <ostream> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <t...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
266
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; //#define ll long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1;...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; //#define ll long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1;...
[["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22]]
1
367
#include <bits/stdc++.h> #define f(i, a, b) for (ll i = a; i < b; i++) #define af(i, a, b) for (ll i = a; i >= b; i--) #define rep(i, a, b, k) for (ll i = a; i < b; i += k) #define arep(i, a, b, k) for (ll i = a; i >= b; i -= k) #define ff first #define ss second #define pb push_back #define mp make_pair #define sz(a)...
#include <bits/stdc++.h> #define f(i, a, b) for (ll i = a; i < b; i++) #define af(i, a, b) for (ll i = a; i >= b; i--) #define rep(i, a, b, k) for (ll i = a; i < b; i += k) #define arep(i, a, b, k) for (ll i = a; i >= b; i -= k) #define ff first #define ss second #define pb push_back #define mp make_pair #define sz(a)...
[["-", 0, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 9, 0, 57, 64, 9, 0, 37, 0, 13]]
1
241
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; const ll MOD = 1000000007; const ll INF = 2147483647; const ll LINF = 9223372036854775807; #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() ll p(...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; const ll MOD = 1000000007; const ll INF = 2147483647; const ll LINF = 9223372036854775807; #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() ll p(...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33], ["-", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33]]
1
206
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> pi; typedef vector<pi> vpi; typedef long double ld; #define pb emplace_back #define emp emplace #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> pi; typedef vector<pi> vpi; typedef long double ld; #define pb emplace_back #define emp emplace #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(...
[["-", 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
229
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; bool ans = false; for (int i = 1; i < 1000; i++) { for (int j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; ans = true; } } if (ans) ...
#include <bits/stdc++.h> using namespace std; int main() { long long int X; cin >> X; bool ans = false; for (int i = 0; i < 10000; i++) { for (int j = -1000; j < 1000; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; ans = true; } } ...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 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
104
// make sure to make new file! import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); long n = Long.parseLong(f.readLine...
// make sure to make new file! import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); long n = Long.parseLong(f.readLine...
[["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["-", 8, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 8, 196, 0, 7, 502, 503, 39, 506, 0, 96], ["-", 0, 492, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 492, 3, 4, 0, 16, 31, 16, 31, 22]]
3
250
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(x) x.begin(), x.end() #define pll pair<long long, long long> #define ss second #define ff first #define inf 9223372036854775807 #define maa 1000000007 #define ld long double #define fast ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(x) x.begin(), x.end() #define pll pair<long long, long long> #define ss second #define ff first #define inf 9223372036854775807 #define maa 1000000007 #define ld long double #define fast ...
[["-", 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
219
#include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstdlib> #include <deque> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <tuple>...
#include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstdlib> #include <deque> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <tuple>...
[["-", 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, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
287
import math x = int(input()) for i in range(1,101): for j in range(-100,101): a5 = pow(i , 5) b5 = pow(j, 5) if a5 - b5 == x: exit(print(i , j))
import math x = int(input()) for i in range(-1000,1001): for j in range(-1000,1001): a5 = pow(i , 5) b5 = pow(j, 5) if a5 - b5 == x: exit(print(i , j))
[["-", 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], ["-", 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
63
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll X; cin >> X; for (ll i = 0; i < 10; i++) { double B5; ll B, A; A = i; B5 = pow(A, 5) - X; B = pow(abs(B5), 1.0 / 5.0); if (B5 < 0) B = -B; if (abs(p...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll X; cin >> X; for (ll i = 0; i < 10000; i++) { double B5; ll B, A; A = i; B5 = pow(A, 5) - X; B = pow(abs(B5), 1.0 / 5.0); if (B5 < 0) B = -B; if (ab...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
221
#include <bits/stdc++.h> #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (long long)(x).size() #define sqr(x) (x) * (x) #define sof sizeof #define resz resize #define ins insert #define lowerB lower_bound #define upperB upper_bound #define mkp make_pair ...
#include <bits/stdc++.h> #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (long long)(x).size() #define sqr(x) (x) * (x) #define sof sizeof #define resz resize #define ins insert #define lowerB lower_bound #define upperB upper_bound #define mkp make_pair ...
[["-", 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]]
1
639
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define endl "\n" #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr); #define all(x) x.begin(), x.end() #defi...
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define endl "\n" #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr); #define all(x) x.begin(), x.end() #defi...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22]]
1
333
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; using pll = pair<ll, ll>; #define fi first #define se second #define pb push_back #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define MOD 1000000007 template <class T> bool chmax(T &a, const T &b) { if (a < b) {...
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; using pll = pair<ll, ll>; #define fi first #define se second #define pb push_back #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define MOD 1000000007 template <class T> bool chmax(T &a, const T &b) { if (a < b) {...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
231
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
[["-", 0, 43, 49, 50, 51, 23, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 23, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 23, 0, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 23, 0, 16, 12, 22]]
1
4,376
x=int(input()) a=0 b=64 while True: t=a**5+b**5 if t==x: break if t>x: b-=1 else: a+=1 print(a,b)
x=int(input()) a=0 b=-64 while True: t=a**5-b**5 if t==x: break if t>x: b+=1 else: a+=1 print(a,b)
[["+", 0, 656, 0, 1, 0, 662, 12, 664, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107]]
5
51
/* 特徴 */ /* 教訓 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pint = pair<int, int>; using pll = pair<ll, ll>; using pld = pair<ld, ld>; const int INF = 1e9 + 7; const ll LINF = 9223372036854775807; const ll MOD = 1e9 + 7; const ld PI = acos(-1); cons...
/* 特徴 */ /* 教訓 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pint = pair<int, int>; using pll = pair<ll, ll>; using pld = pair<ld, ld>; const int INF = 1e9 + 7; const ll LINF = 9223372036854775807; const ll MOD = 1e9 + 7; const ld PI = acos(-1); cons...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
1,089
#include <bits/stdc++.h> #include <set> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define ld long double #define repl(i, n) for (ll i = 0; i < (ll)(n); i++) #define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl int main() { ll x; cin >>...
#include <bits/stdc++.h> #include <set> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define ld long double #define repl(i, n) for (ll i = 0; i < (ll)(n); i++) #define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl int main() { ll x; cin >>...
[["-", 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
151
#include <bits/stdc++.h> using namespace std; #define fast() \ { \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define fast() \ { \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
268
// I am so vegetable #pragma GCC optimize(2) #include <bits/stdc++.h> #define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define PB push_back #define IN insert #define ER erase #define CT count #define EP empty #define _for(i, a, b) for (int i = (a); i < (b); ++i) #define _rfor(i, a, b) for (int i = (a); ...
// I am so vegetable #pragma GCC optimize(2) #include <bits/stdc++.h> #define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define PB push_back #define IN insert #define ER erase #define CT count #define EP empty #define _for(i, a, b) for (int i = (a); i < (b); ++i) #define _rfor(i, a, b) for (int i = (a); ...
[["+", 31, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 48]]
1
416
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.en...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.en...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
197
#include <bits/stdc++.h> #define eps 1e-6 #define ll long long #define IOS \ cin.sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0);...
#include <bits/stdc++.h> #define eps 1e-6 #define ll long long #define IOS \ cin.sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0);...
[["-", 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
510
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int getRand(int l, int r) { uniform_int_distribution<int> uid(l, r); return uid(rng); } #de...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int getRand(int l, int r) { uniform_int_distribution<int> uid(l, r); return uid(rng); } #de...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
268
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect...
[["-", 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], ["-", 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
339
from collections import Counter n=int(input()) a=list(map(int,input().split())) q1=[] q2=[] for i in range(n): q1.append(i+a[i]) q2.append(i-a[i]) c2=Counter(q2) ans=0 for i in c1.keys(): ans+=c2[i] print(ans)
from collections import Counter n=int(input()) a=list(map(int,input().split())) q1=[] q2=[] for i in range(n): q1.append(i+a[i]) q2.append(i-a[i]) c2=Counter(q2) ans=0 for i in q1: ans+=c2[i] print(ans)
[["-", 0, 656, 0, 7, 12, 652, 63, 319, 500, 22], ["-", 0, 656, 0, 7, 12, 652, 63, 319, 0, 131], ["-", 0, 656, 0, 7, 12, 652, 63, 319, 319, 22], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22]]
5
95
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } func main() { N := nextInt() An := make([...
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } func main() { N := nextInt() An := make([...
[["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 21]]
7
989
import collections N = int(input()) A = list(map(int , input().split())) # N = 32 # A = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 6, 4, 3, 3, 8, 3, 2, 7, 9, 5] # N = 6 # A = [2, 3, 3, 1, 3, 1] i = [k for k in range(1,N+1)] j = [k for k in range(1,N+1)] Li = [i[k]+A[k] for k in range(N)] Rj...
import collections N = int(input()) A = list(map(int , input().split())) # N = 32 # A = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 6, 4, 3, 3, 8, 3, 2, 7, 9, 5] # N = 6 # A = [2, 3, 3, 1, 3, 1] i = [k for k in range(1,N+1)] j = [k for k in range(1,N+1)] Li = [i[k]+A[k] for k in range(N)] Rj...
[["+", 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
125
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T = ll> using vec = vector<T>; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int n; cin >> n; map<int, int> cnt; ll res = 0; for (int i = 0; i < n; i++) { int a; cin >> a; res += cnt[i ...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T = ll> using vec = vector<T>; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int n; cin >> n; map<int, int> cnt; ll res = 0; for (int i = 0; i < n; i++) { int a; cin >> a; res += cnt[i ...
[["-", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 72]]
1
115
n = int(input()) a = list(map(int, input().split())) ans = 0 cnt = defaultdict(int) for i in range(n): ans += cnt[i - a[i]] cnt[i + a[i]] += 1 print(ans)
from collections import defaultdict n = int(input()) a = list(map(int, input().split())) ans = 0 cnt = defaultdict(int) for i in range(n): ans += cnt[i - a[i]] cnt[i + a[i]] += 1 print(ans)
[["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]]
5
68