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
#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <numeric> #define ll long long #define ull unsigned long #define mpa make_pair #define pb push_back #define ff first #define pii pair<ll, ll> #define dd double #define trace(x) cerr << #x << " : " << x << endl #define ss second #define boost ios_ba...
#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <numeric> #define ll long long #define ull unsigned long #define mpa make_pair #define pb push_back #define ff first #define pii pair<ll, ll> #define dd double #define trace(x) cerr << #x << " : " << x << endl #define ss second #define boost ios_ba...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
296
n,m = map(int,input().split()) h = list(map(int,input().split())) ans = 0 arr = [[] for i in range(n)] for i in range(m): a,b = map(int,input().split()) arr[a-1].append(b-1) arr[b-1].append(a-1) for i in range(len(h)): tmph = h[i] flg = 1 if arr[i]: for j in arr[i]: if tmph ...
n,m = map(int,input().split()) h = list(map(int,input().split())) ans = 0 arr = [[] for i in range(n)] for i in range(m): a,b = map(int,input().split()) arr[a-1].append(b-1) arr[b-1].append(a-1) for i in range(len(h)): tmph = h[i] flg = 1 if arr[i]: for j in arr[i]: if tmph ...
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
161
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namesp...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namesp...
[["-", 31, 69, 341, 342, 0, 16, 31, 69, 28, 22], ["+", 31, 69, 341, 342, 0, 16, 31, 69, 28, 22]]
1
481
N, M = map(int,input().split()) Hs = list(map(int,input().split())) L = [[] for i in range(N)] count = 0 for i in range(M): A, B = map(int,input().split()) (L[A-1]).append(Hs[B-1]) (L[B-1]).append(Hs[A-1]) for i in range(N): if not L[i]: count+=1 continue if i+1 > max(L[i]): ...
N, M = map(int,input().split()) Hs = list(map(int,input().split())) L = [[] for i in range(N)] count = 0 for i in range(M): A, B = map(int,input().split()) (L[A-1]).append(Hs[B-1]) (L[B-1]).append(Hs[A-1]) for i in range(N): if not L[i]: count+=1 continue if Hs[i] > max(L[i]): ...
[["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 70], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 73]]
5
148
n, m = map(int, input().split()) h = list(map(int, input().split())) good = [True for i in range(n)] for i in range(m): a, b = map(int, input().split()) if (h[a - 1] == h[b - 1]): good[a - 1] = False good[b - 1] = False elif h[a - 1] < h[b - 1]: good[a - 1] = False else: good[b - 1] = False result = 0 ...
n, m = map(int, input().split()) h = list(map(int, input().split())) good = [True for i in range(n)] for i in range(m): a, b = map(int, input().split()) if (h[a - 1] == h[b - 1]): good[a - 1] = False good[b - 1] = False elif h[a - 1] < h[b - 1]: good[a - 1] = False else: good[b - 1] = False result = 0 ...
[["-", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372]]
5
154
N, M = map(int, input().split()) H = list(map(int, input().split())) l = [1] * N for _ in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 if H[a] >= H[b]: l[b] = 0 if a <= b: l[a] = 0 print(sum(l))
N, M = map(int, input().split()) H = list(map(int, input().split())) l = [1] * N for _ in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 if H[a] >= H[b]: l[b] = 0 if H[a ]<= H[b]: l[a] = 0 print(sum(l))
[["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 70], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 73]]
5
105
#template def inputlist(): return [int(k) for k in input().split()] #template N,M = inputlist() H = inputlist() graph = [[] for _ in range(N)] print(graph) for i in range(M): A,B = inputlist() A -=1 B -=1 graph[A].append(B) graph[B].append(A) ans = 0 for i in range(N): h = H[i] k = 0 fo...
#template def inputlist(): return [int(k) for k in input().split()] #template N,M = inputlist() H = inputlist() graph = [[] for _ in range(N)] for i in range(M): A,B = inputlist() A -=1 B -=1 graph[A].append(B) graph[B].append(A) ans = 0 for i in range(N): h = H[i] k = 0 for j in graph[...
[["-", 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
143
N,M = map(int,input().split()) H = list(map(int,input().split())) li = [1 for i in range(N)] for i in range(M): a,b = map(int,input().split()) a-=1 b-=1 if H[a]>=H[b]: li[b]=0 elif H[a]<=H[b]: li[a]=0 # print(li) ans = 0 for i in range(N): if li[i]: ans += 1 print(ans)...
N,M = map(int,input().split()) H = list(map(int,input().split())) li = [1 for i in range(N)] for i in range(M): a,b = map(int,input().split()) a-=1 b-=1 if H[a]>=H[b]: li[b]=0 if H[a]<=H[b]: li[a]=0 # print(li) ans = 0 for i in range(N): if li[i]: ans += 1 print(ans)
[["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121]]
5
134
# -*- coding: utf-8 -*- n,m=map(int,input().split()) h=list(map(int,input().split())) ans=[True for _ in range(n)] for i in range(m): a,b=map(int,input().split()) if h[a-1]>=h[b-1]: ans[b-1]=False elif h[a-1]<=h[b-1]: ans[a-1]=False print(ans.count(True))
# -*- coding: utf-8 -*- n,m=map(int,input().split()) h=list(map(int,input().split())) ans=[True for _ in range(n)] for i in range(m): a,b=map(int,input().split()) if h[a-1]>=h[b-1]: ans[b-1]=False if h[a-1]<=h[b-1]: ans[a-1]=False print(ans.count(True))
[["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121]]
5
125
#include <bits/stdc++.h> #define endl '\n' using namespace std; const int MAX = 1e5 + 2; int n, m; int res; int u0, v0; int h[MAX]; vector<int> adj[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> h[i]; } for (int i = 0; i < m; i++)...
#include <bits/stdc++.h> #define endl '\n' using namespace std; const int MAX = 1e5 + 2; int n, m; int res; int u0, v0; int h[MAX]; vector<int> adj[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> h[i]; } for (int i = 1; i <= m; i++...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
219
#!/usr/bin/env python3 import sys input = sys.stdin.readline n, m = map(int, input().split()) h = [int(item) for item in input().split()] ans = [True] * n for _ in range(m): a, b = map(int, input().split()) a -= 1; b -= 1 if h[a] >= h[b]: ans[b] = False elif h[b] >= h[a]: ans[a] = False...
#!/usr/bin/env python3 import sys input = sys.stdin.readline n, m = map(int, input().split()) h = [int(item) for item in input().split()] ans = [True] * n for _ in range(m): a, b = map(int, input().split()) a -= 1; b -= 1 if h[a] >= h[b]: ans[b] = False if h[b] >= h[a]: ans[a] = False ...
[["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121]]
5
123
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR1(i, n) for (int(i) = 1; (i) <= (n); (i)++) #define FORI(i, n) for (int(i) = n - 1; (i) >= 0; (i)--) int n, m; vector<vector<int>> edge; vector<int> h; vector...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR1(i, n) for (int(i) = 1; (i) <= (n); (i)++) #define FORI(i, n) for (int(i) = n - 1; (i) >= 0; (i)--) int n, m; vector<vector<int>> edge; vector<int> h; vector...
[["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
310
n, m = map(int, input().split()) H = list(map(int, input().split())) X=[[0] for i in range(n)] for i in range(m): a, b = map(int, input().split()) X[a-1].append(b) X[b-1].append(a) t=0 for i in range(n): E=list(H[k-1] for k in X[i]) if max(E) < H[i]: t+=1 print(t)
n, m = map(int, input().split()) H = list(map(int, input().split())) X=[[] for i in range(n)] for i in range(m): a, b = map(int, input().split()) X[a-1].append(b) X[b-1].append(a) t=0 for i in range(n): E=[0]+list(H[k-1] for k in X[i]) if max(E) < H[i]: t+=1 print(t)
[["-", 0, 1, 0, 662, 12, 658, 8, 634, 0, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 70], ["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 73], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
140
#include <bits/stdc++.h> #include <iostream> #define ll long long int #define fo(i, a, b) for (i = (ll)a; i < (ll)b; ++i) #define loopr(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define pb push_back #define mset(a, b, c) loop(i, 0, b) a[i] = c #define F first #define S second #define mp make_pair #define clr(x) x...
#include <bits/stdc++.h> #include <iostream> #define ll long long int #define fo(i, a, b) for (i = (ll)a; i < (ll)b; ++i) #define loopr(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define pb push_back #define mset(a, b, c) loop(i, 0, b) a[i] = c #define F first #define S second #define mp make_pair #define clr(x) x...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
1
441
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int, int> pii; typedef vector<pii> vii; #define ll long long #define ff first #define ss second #define pb push_back #define mkp make_pair #define sz size() #define forf(a, b, c) for (int i = a; i <= b; i...
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int, int> pii; typedef vector<pii> vii; #define ll long long #define ff first #define ss second #define pb push_back #define mkp make_pair #define sz size() #define forf(a, b, c) for (int i = a; i <= b; i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
399
import sys input = sys.stdin.readline # sys.setrecursionlimit(10 ** 7) def main(): N, M = map(int, input().split()) H = list(map(int, input().split())) good = [True] * N for i in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 if H[a] < H[b]: goo...
import sys input = sys.stdin.readline # sys.setrecursionlimit(10 ** 7) def main(): N, M = map(int, input().split()) H = list(map(int, input().split())) good = [True] * N for i in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 if H[a] < H[b]: goo...
[["-", 0, 57, 75, 665, 15, 666, 0, 206, 206, 22], ["+", 0, 57, 75, 665, 15, 666, 0, 206, 206, 22]]
5
152
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); long long int n, m; cin >> n >> m; long long int h[100001]; for (long long int i = 1; i <= n; i++) { cin >> h[i]; } long long int g[100001]; for (long long int i = 1; i <= n; i++) { g[i] =...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); long long int n, m; cin >> n >> m; long long int h[100001]; for (long long int i = 1; i <= n; i++) { cin >> h[i]; } long long int g[100001]; for (long long int i = 1; i <= n; i++) { g[i] =...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
311
import collections n,m = list(map(int,input().split())) tower_high = list(map(int,input().split())) good_tower = [1]*n def check_tower(a,b): if tower_high[a]<tower_high[b]: good_tower[a]=0 elif tower_high[a] > tower_high[b]: good_tower[b]=0 else: good_tower[a]=0 good_tower[b...
import collections n,m = list(map(int,input().split())) tower_high = list(map(int,input().split())) good_tower = [1]*n def check_tower(a,b): if tower_high[a]<tower_high[b]: good_tower[a]=0 elif tower_high[a] > tower_high[b]: good_tower[b]=0 else: good_tower[a]=0 good_tower[b...
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22]]
5
151
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, const T &b...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, const T &b...
[["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
295
N, M = list(map(int, input().split())) H = list(map(int, input().split())) G = [[] for i in range(N)] for i in range(M): A, B = list(map(int, input().split())) G[A - 1].append(B-1) G[B-1].append(A-1) ans = 0 for i in range(N): self_h = H[i] self_max_flag = True for to in range(len(G[i])): ...
N, M = list(map(int, input().split())) H = list(map(int, input().split())) G = [[] for i in range(N)] for i in range(M): A, B = list(map(int, input().split())) G[A - 1].append(B - 1) G[B - 1].append(A - 1) ans = 0 for i in range(N): self_h = H[i] self_max_flag = True for to in G[i]: ...
[["-", 0, 7, 8, 196, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 25]]
5
161
N,M = map(int,input().split()) H = [int(x) for x in input().split()] AB = [[int(x) for x in input().split()]for i in range(M)] good = [-1]*N for j in range(M): if H[AB[j][0]-1] > H[AB[j][1]-1]: good[AB[j][0]-1] = 1 good[AB[j][1]-1] = 0 elif H[AB[j][0]-1] < H[AB[j][1]-1]: good[AB[j][0]-1] = 0 good...
N,M = map(int,input().split()) H = [int(x) for x in input().split()] AB = [[int(x) for x in input().split()]for i in range(M)] good = [-1]*N for j in range(M): if H[AB[j][0]-1] > H[AB[j][1]-1]: good[AB[j][0]-1] *= 1 good[AB[j][1]-1] *= 0 elif H[AB[j][0]-1] < H[AB[j][1]-1]: good[AB[j][0]-1] *= 0 g...
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 108], ["-", 75, 665, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 665, 64, 196, 0, 1, 0, 677, 17, 108], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 108]]
5
234
#include <bits/stdc++.h> #define FOR(i, a, n) for (int(i) = (int)(a); (i) < (int)(n); ++(i)) #define FORe(i, a, n) for (int(i) = (int)(a); (i) <= (int)(n); ++(i)) #define rFOR(i, a, n) for (int(i) = (int)(n)-1; (i) >= (int)(a); --(i)) #define rFORe(i, a, n) for (int(i) = (int)(n); (i) >= (int)(a); --(i)) #define REP(i,...
#include <bits/stdc++.h> #define FOR(i, a, n) for (int(i) = (int)(a); (i) < (int)(n); ++(i)) #define FORe(i, a, n) for (int(i) = (int)(a); (i) <= (int)(n); ++(i)) #define rFOR(i, a, n) for (int(i) = (int)(n)-1; (i) >= (int)(a); --(i)) #define rFORe(i, a, n) for (int(i) = (int)(n); (i) >= (int)(a); --(i)) #define REP(i,...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
603
n, m = map(int, input().split()) hList = [int(x) for x in input().split()] tenboudai = [1 for i in range(n)] for i in range(m): a, b = map(int, input().split()) if hList[a - 1] == hList[b - 1]: tenboudai[a - 1] = 0 tenboudai[b - 1] = 0 elif hList[a - 1] > hList[b - 1]: tenboudai[b...
n, m = map(int, input().split()) hList = [int(x) for x in input().split()] tenboudai = [1 for i in range(n)] for i in range(m): a, b = map(int, input().split()) if hList[a - 1] == hList[b - 1]: tenboudai[a - 1] = 0 tenboudai[b - 1] = 0 elif hList[a - 1] > hList[b - 1]: tenboudai[b...
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612], ["-", 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, ...
5
158
#include <bits/stdc++.h> #define p5(i) i *i *i *i *i using namespace std; int n, a[100005]; int m; vector<int> g[100005]; int main() { cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i]; while (m--) { int u, v; cin >> u >> v; g[u].push_back(a[v]); g[v].push_back(a[u]); } int r = n; ...
#include <bits/stdc++.h> #define p5(i) i *i *i *i *i using namespace std; int n, a[100005]; int m; vector<int> g[100005]; int main() { cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i]; while (m--) { int u, v; cin >> u >> v; g[u].push_back(a[v]); g[v].push_back(a[u]); } int r = n; ...
[["+", 8, 9, 0, 338, 8, 57, 64, 9, 0, 45], ["+", 0, 338, 8, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 338, 8, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 338, 8, 57, 64, 9, 0, 46]]
1
156
/* Author: Qaseem Hasan alias Mikepayne14(Codeforces,SPOJ) qaseem_hasan_ (Codechef,HackerRank,HackerEarth) */ //--------------------------------------------------------- //#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <list> using namespace std; //--------------------------...
/* Author: Qaseem Hasan alias Mikepayne14(Codeforces,SPOJ) qaseem_hasan_ (Codechef,HackerRank,HackerEarth) */ //--------------------------------------------------------- //#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <list> using namespace std; //--------------------------...
[["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
1,238
import sys input = sys.stdin.readline def main(): N,M = map(int,input().split()) H = tuple(map(int,input().split())) good = [1]*N for _ in range(M): a,b = map(int,input().split()) a-=1;b-=1 if H[a]<H[b]: good[a] = 0 elif H[a] > H[b]: good[a] = 0 ...
import sys input = sys.stdin.readline def main(): N,M = map(int,input().split()) H = tuple(map(int,input().split())) good = [1]*N for _ in range(M): a,b = map(int,input().split()) a-=1;b-=1 if H[a]<H[b]: good[a] = 0 elif H[a] ==H[b]: good[a] = 0 ...
[["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 60]]
5
152
#include "algorithm" #include "bitset" #include "cstring" #include "ctime" #include "iomanip" #include "iostream" #include "map" #include "math.h" #include "numeric" #include "queue" #include "set" #include "stack" #include "string" #include "vector" #include "ext/pb_ds/assoc_container.hpp" // Common file #include "ex...
#include "algorithm" #include "bitset" #include "cstring" #include "ctime" #include "iomanip" #include "iostream" #include "map" #include "math.h" #include "numeric" #include "queue" #include "set" #include "stack" #include "string" #include "vector" #include "ext/pb_ds/assoc_container.hpp" // Common file #include "ex...
[["-", 0, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["-", 0, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["+", 0, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
546
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define maxn 100010 const int MOD = 1000000007; int visited[maxn], h[maxn]; vector<int> g[maxn]; int ct; void dfs(int u) { visited[u] = true; bool ch = true; for (auto x : g[u]) { if (h[x] >= h[u]) ch = false; } ...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define maxn 100010 const int MOD = 1000000007; int visited[maxn], h[maxn]; vector<int> g[maxn]; int ct; void dfs(int u) { visited[u] = true; bool ch = true; for (auto x : g[u]) { if (h[x] >= h[u]) ch = false; } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
285
#include <stdio.h> #include <vector> using namespace std; vector<int> v[111111]; int h[111111]; int main(void) { int n, m, i, j; scanf("%d %d", &n, &m); for (i = 1; i <= n; i++) scanf("%d", &h[i]); while (m--) { int a, b; scanf("%d %d", &a, &b); v[a].push_back(b); v[b].push_back(a); ...
#include <stdio.h> #include <vector> using namespace std; vector<int> v[111111]; int h[111111]; int main(void) { int n, m, i, j; scanf("%d %d", &n, &m); for (i = 1; i <= n; i++) scanf("%d", &h[i]); while (m--) { int a, b; scanf("%d %d", &a, &b); v[a].push_back(b); v[b].push_back(a); ...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 19]]
1
209
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> using namespace std; #define pb push_back #define FAST_IO ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> using namespace std; #define pb push_back #define FAST_IO ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
329
#include <bits/stdc++.h> #define REP(i, e) for (int(i) = 0; (i) < (e); ++(i)) #define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i)) #define ALL(c) (c).begin(), (c).end() #define PRINT(x) cout << (x) << "\n" using namespace std; using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>; template <t...
#include <bits/stdc++.h> #define REP(i, e) for (int(i) = 0; (i) < (e); ++(i)) #define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i)) #define ALL(c) (c).begin(), (c).end() #define PRINT(x) cout << (x) << "\n" using namespace std; using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>; template <t...
[["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 46]]
1
251
#include <bits/stdc++.h> using namespace std; const int N = 100005; int n, m, h[N], x, y; vector<int> v[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> h[i]; } for (int i = 1; i <= m; ++i) { cin >> x >> y; v[x].push_back(y); v[y].p...
#include <bits/stdc++.h> using namespace std; const int N = 100005; int n, m, h[N], x, y; vector<int> v[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> h[i]; } for (int i = 1; i <= m; ++i) { cin >> x >> y; v[x].push_back(h[y]); v[y...
[["+", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
184
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++) #define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--) #define sort_vec(v) sort((v).begin(), (v).end()) typedef int64_t lint; // lint mod = 9982443...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++) #define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--) #define sort_vec(v) sort((v).begin(), (v).end()) typedef int64_t lint; // lint mod = 9982443...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
271
#include <bits/stdc++.h> #define fo(i, a, b) for ((i) = (a); i <= (b); i++) #define rfo(i, a, b) for ((i) = (a); i >= (b); i--) #define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z))) #define ALL(vec) ((vec).begin(), (vec).end()) #define SOR(vec) sort(ALL(vec)) #define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()...
#include <bits/stdc++.h> #define fo(i, a, b) for ((i) = (a); i <= (b); i++) #define rfo(i, a, b) for ((i) = (a); i >= (b); i--) #define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z))) #define ALL(vec) ((vec).begin(), (vec).end()) #define SOR(vec) sort(ALL(vec)) #define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()...
[["-", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
251
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define REP(i, x, n) for (int i = (x); i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const ll mod = 1e9 + 7; co...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define REP(i, x, n) for (int i = (x); i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const ll mod = 1e9 + 7; co...
[["-", 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
197
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
[["-", 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
259
x = gets.to_i (-120..120).each do |i| (-120..120).each do |j| if (i ** 5 - j ** j) == x puts "#{i} #{j}" return end end end
x = gets.to_i (-120..120).each do |i| (-120..120).each do |j| if (i ** 5 - j ** 5) == x puts "#{i} #{j}" return end end end
[["-", 15, 738, 31, 739, 0, 738, 12, 738, 12, 22], ["+", 15, 738, 31, 739, 0, 738, 12, 738, 12, 612]]
4
55
N, M = map(int, input().split()) H = list(map(int, input().split())) h = [] for i in H: h.append(i) for i in range(M): a, b = map(int, input().split()) if h[a-1] <= H[b-1] and h[b-1] != -1: h[a-1] = -1 if h[b-1] <= H[a-1] and h[b-1] != -1: h[b-1] = -1 ans = N for i in h: if i == -1...
N, M = map(int, input().split()) H = list(map(int, input().split())) h = [] for i in H: h.append(i) for i in range(M): a, b = map(int, input().split()) if h[a-1] <= H[b-1] and h[a-1] != -1: h[a-1] = -1 if h[b-1] <= H[a-1] and h[b-1] != -1: h[b-1] = -1 ans = N for i in h: if i == -1...
[["-", 15, 679, 12, 666, 0, 206, 206, 657, 31, 22], ["+", 15, 679, 12, 666, 0, 206, 206, 657, 31, 22]]
5
161
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n + 1] = {0}; for (int i = 1; i < n; i++) { cin >> a[i]; } vector<vector<int>> ans(n + 1); for (int i = 0; i < m; i++) { int s, b; cin >> s >> b; ans[s].push_back(b); ans[b].push_back(s); } in...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n + 1]; for (int i = 1; i <= n; i++) { cin >> a[i]; } vector<vector<int>> ans(n + 1); for (int i = 0; i < m; i++) { int s, b; cin >> s >> b; ans[s].push_back(b); ans[b].push_back(s); } int cou...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["-", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
208
n,m=map(int, input().split()) h = list(map(int, input().split())) ab=[list(map(int,list(input().split()))) for i in range(m)] ans = [1]*n for i in ab: if h[i[0]-1] <= h[i[1]-1]: ans[i[0]-1] = 0 if h[i[0]-1] >= h[i[1]-1]: ans[i[0]-2] = 0 print(ans.count(1))
n,m=map(int, input().split()) h = list(map(int, input().split())) ab=[list(map(int,list(input().split()))) for i in range(m)] ans = [1]*n for i in ab: if h[i[0]-1] <= h[i[1]-1]: ans[i[0]-1] = 0 if h[i[0]-1] >= h[i[1]-1]: ans[i[1]-1] = 0 print(ans.count(1))
[["-", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612], ["+", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612], ["-", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612]]
5
147
# coding: utf-8 def main(): N, M = map(int, input().split()) H = list(map(int, input().split())) A = [None] * M B = [None] * M for i in range(M): A[i], B[i] = map(int, input().split()) A[i] -= 1 B[i] -= 1 paths = {i: [] for i in range(N)} for i in range(M): ...
# coding: utf-8 def main(): N, M = map(int, input().split()) H = list(map(int, input().split())) A = [None] * M B = [None] * M for i in range(M): A[i], B[i] = map(int, input().split()) A[i] -= 1 B[i] -= 1 paths = [[] for _ in range(N)] for i in range(M): ...
[["-", 8, 196, 0, 1, 0, 662, 12, 703, 0, 45], ["-", 0, 1, 0, 662, 12, 703, 8, 569, 448, 22], ["-", 0, 1, 0, 662, 12, 703, 8, 569, 0, 102], ["+", 8, 196, 0, 1, 0, 662, 12, 658, 0, 70], ["-", 0, 1, 0, 662, 12, 703, 0, 659, 31, 22], ["+", 0, 1, 0, 662, 12, 658, 0, 659, 31, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 703, 0, 46],...
5
290
n,m = gets.split.map(&:to_i) h = gets.split.map(&:to_i) ar = Array.new(n).map{Array.new} m.times do a,b = gets.split.map(&:to_i) ar[a-1] << h[b-1] ar[b-1] << h[a-1] end ans = 0 for i in 0..(n-1) if ar[i] == [] || ar[i].max < h[i] ans += 1 puts i end end puts ans
n,m = gets.split.map(&:to_i) h = gets.split.map(&:to_i) ar = Array.new(n).map{Array.new} m.times do a,b = gets.split.map(&:to_i) ar[a-1] << h[b-1] ar[b-1] << h[a-1] end ans = 0 for i in 0..(n-1) if ar[i] == [] || ar[i].max < h[i] ans += 1 end end puts ans
[["-", 8, 170, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 0, 121, 64, 749, 0, 652, 3, 4, 0, 22]]
4
125
N,M = map(int,input().split()) H = list(map(int,input().split())) AB = [list(map(int,input().split())) for _ in range(M)] load = [[] for _ in range(N)] ans = 0 for a,b in AB: a-=1 b-=1 load[a].append(b) load[b].append(a) for i,lis in enumerate(load): if len(lis)==N-1: ans+=1 else: judge = True ...
N,M = map(int,input().split()) H = list(map(int,input().split())) AB = [list(map(int,input().split())) for _ in range(M)] load = [[] for _ in range(N)] ans = 0 for a,b in AB: a-=1 b-=1 load[a].append(b) load[b].append(a) for i,lis in enumerate(load): if len(lis)==0: ans+=1 else: judge = True ...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
164
#include <bits/stdc++.h> using namespace std; #define int long long #define N 666666 int arr[N]; int n, m; vector<int> v[N]; signed main() { cin >> n >> m; for (int i = 1; i <= n; i++) cin >> arr[i]; for (int i = 1; i < m; i++) { int a, b; cin >> a >> b; v[a].push_back(b); v[b].push_back(a); ...
#include <bits/stdc++.h> using namespace std; #define int long long #define N 666666 int arr[N]; int n, m; vector<int> v[N]; signed main() { cin >> n >> m; for (int i = 1; i <= n; i++) cin >> arr[i]; for (int i = 1; i <= m; i++) { int a, b; cin >> a >> b; v[a].push_back(b); v[b].push_back(a); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
201
#include "bits/stdc++.h" using namespace std; typedef long long int lli; #define pb push_back #define mp make_pair #define mod 998244353 #define ff first #define ss second #define pi pair<lli, lli> #define pii pair<lli, pi> #define endl "\n" #define IOS ...
#include "bits/stdc++.h" using namespace std; typedef long long int lli; #define pb push_back #define mp make_pair #define mod 998244353 #define ff first #define ss second #define pi pair<lli, lli> #define pii pair<lli, pi> #define endl "\n" #define IOS ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
309
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; #define ll long long #define pp pair<ll, ll> #define ppp pair<ll, pp> #define trace(...) ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; #define ll long long #define pp pair<ll, ll> #define ppp pair<ll, pp> #define trace(...) ...
[["-", 0, 338, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 338, 8, 57, 15, 339, 51, 16, 17, 20]]
1
418
n,m = map(int,input().split()) h = list(map(int,input().split())) g = [[] for i in range(n)] for i in range(m): a,b = map(int,input().split()) a -= 1 b -= 1 g[a].append(h[b]) g[b].append(h[a]) ans = 0 for i in range(n): if len(g[i]) == 0: ans +=1 continue if h[i] >= ma...
n,m = map(int,input().split()) h = list(map(int,input().split())) g = [[] for i in range(n)] for i in range(m): a,b = map(int,input().split()) a -= 1 b -= 1 g[a].append(h[b]) g[b].append(h[a]) ans = 0 for i in range(n): if len(g[i]) == 0: ans +=1 continue if h[i] > max...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47]]
5
147
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math from collections import deque from math import gcd from functools import lru_cache ############# # Constants # ############# MOD = 10**9+7 INF = float('inf') ############# # Functions # ###########...
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math from collections import deque from math import gcd from functools import lru_cache ############# # Constants # ############# MOD = 10**9+7 INF = float('inf') ############# # Functions # ###########...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
725
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair #define F first #define S second #define ld long double #define pii pair<int, int> #define sz(a) (int)(a.size()) #define resize(v) v.resize(unique(all(v)) - v.begin()); #defin...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair #define F first #define S second #define ld long double #define pii pair<int, int> #define sz(a) (int)(a.size()) #define resize(v) v.resize(unique(all(v)) - v.begin()); #defin...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
449
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() #define mem(x, y) \ memset(x, y, ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() #define mem(x, y) \ memset(x, y, ...
[["-", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
478
////////////// VATSAL AGARWAL //////////////////////// ////////////// Codeforces id : warhead38 //////////////////////// ////////////// Codechef id : vatsal38 //////////////////////// #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace s...
////////////// VATSAL AGARWAL //////////////////////// ////////////// Codeforces id : warhead38 //////////////////////// ////////////// Codechef id : vatsal38 //////////////////////// #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace s...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
1,279
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define x first #...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define x first #...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
208
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, 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
144
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rev1(i, n) for (int i = (int)(n); i > 0; i--) #define pb push_back #define all(v) (v).begin(), (v).e...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rev1(i, n) for (int i = (int)(n); i > 0; i--) #define pb push_back #define all(v) (v).begin(), (v).e...
[["-", 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
324
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (ll i = (ll)(n); i <= (ll)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c.rbe...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
1
263
#include <bits/stdc++.h> using namespace std; int main() { long X; cin >> X; long N = 1001; vector<long> V(N); long v = -501; for (long i = 0; i < N; i++) V.at(i) = ++v; for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { if (pow(V.at(j), 5) - pow(V.at(i), 5) == X) return ...
#include <bits/stdc++.h> using namespace std; int main() { long X; cin >> X; long N = 1001; vector<long> V(N); long v = -501; for (long i = 0; i < N; i++) V.at(i) = ++v; for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { if (pow(V.at(i), 5) - pow(V.at(j), 5) == X) return ...
[["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
149
x = int(input()) aa, bb = 0, 0 for i in range(-200, 200): for j in range(-200, 200): if(j**5 - i**5 == x): aa, bb = i, j if(aa != 0 or bb != 0): break if(aa != 0 or bb != 0): break print(str(aa) + " " + str(bb))
x = int(input()) aa, bb = 0, 0 for i in range(-200, 200): for j in range(-200, 200): if(i**5 - j**5 == x): aa, bb = i, j if(aa != 0 or bb != 0): break if(aa != 0 or bb != 0): break print(str(aa) + " " + str(bb))
[["-", 15, 23, 0, 666, 0, 657, 31, 657, 31, 22], ["+", 15, 23, 0, 666, 0, 657, 31, 657, 31, 22], ["-", 15, 23, 0, 666, 0, 657, 12, 657, 31, 22], ["+", 15, 23, 0, 666, 0, 657, 12, 657, 31, 22]]
5
97
#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++) #define All(vec) vec.begin(), vec.end() #define Sum(vec) accumulate(vec.begin(), vec.end(), 0) #define Sort(vec)...
#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++) #define All(vec) vec.begin(), vec.end() #define Sum(vec) accumulate(vec.begin(), vec.end(), 0) #define Sort(vec)...
[["-", 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
import sys def resolve(in_): x = int(in_.read()) for a in range(-118, 119 + 1): for b in range(-118, 119 + 1): if x == a ** 5 - b ** 5: return a, b raise ValueError() def main(): answer = resolve(sys.stdin.buffer) print('{} {}'.format(answer)) if __name__ ==...
import sys def resolve(in_): x = int(in_.read()) for a in range(-118, 119 + 1): for b in range(-118, 119 + 1): if x == a ** 5 - b ** 5: return a, b raise ValueError() def main(): answer = resolve(sys.stdin.buffer) print('{} {}'.format(*answer)) if __name__ =...
[["+", 3, 4, 0, 652, 3, 4, 0, 661, 0, 48]]
5
99
x=int(input()) for i in range(-120,120): for j in range(-120,120): if i**5-j**5==x: print(i,j) break
x=int(input()) for i in range(-120,120): for j in range(-120,120): if i**5-j**5==x: print(i,j) exit()
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
48
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll x; cin >> x; for (int i = -200; i <= 200; i++) { for (int j = -200; j <= 200; j++) { ll ans = i * i * i * i * i - j * j * j * j * j; if (ans == x) { cout << i << " " << j; return 0; } } ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll x; cin >> x; for (int i = 0; i <= 200; i++) { for (int j = -200; j <= 200; j++) { ll ans = i * i * i * i * i - j * j * j * j * j; if (ans == x) { cout << i << " " << j; return 0; } } } ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
100
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string.h> #include <string> #include <vector> using namespace std; #define IOS \ ios::sync_with_...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string.h> #include <string> #include <vector> using namespace std; #define IOS \ ios::sync_with_...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 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
135
#include <bits/stdc++.h> #define INF 1e9 using namespace std; #define REPR(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define endl "\n" template <class T> bool chmin(...
#include <bits/stdc++.h> #define INF 1e9 using namespace std; #define REPR(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (ll i = (m); i < (n); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define endl "\n" template <class T> bool chmin(T...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
1
223
x = int(input()) for a in range(10): b = round(abs(a ** 5 - x) ** (1 / 5)) if x in [a ** 5 + b ** 5, a ** 5 - b ** 5]: if a ** 5 < x: b *= -1 print(a, b) break
x = int(input()) for a in range(1000000): b = round(abs(a ** 5 - x) ** (1 / 5)) if x in [a ** 5 + b ** 5, a ** 5 - b ** 5]: if a ** 5 < x: b *= -1 print(a, b) break
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
74
#include <bits/stdc++.h> #include <time.h> using namespace std; #include <math.h> #define ll long long // to increase precision // std::cout<<std::fixed; // std::cout<<std::setprecision(6)<<z; // clock_t tStart = clock(); // printf("Time taken: %.9fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC); #define max1 200001 ...
#include <bits/stdc++.h> #include <time.h> using namespace std; #include <math.h> #define ll long long // to increase precision // std::cout<<std::fixed; // std::cout<<std::setprecision(6)<<z; // clock_t tStart = clock(); // printf("Time taken: %.9fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC); #define max1 200001 ...
[["-", 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
137
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define ALL(x) (x).begin(), (x).end() #defi...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define ALL(x) (x).begin(), (x).end() #defi...
[["+", 10, 43, 49, 50, 51, 16, 31, 91, 17, 33]]
1
251
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 2e9; int main() { int x; cin >> x; for (int i = -200; i <= 200; i++) { for (int j = -200; j <= 200; j++) { ll a = i * i * i * i * i; ll ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 2e9; int main() { int x; cin >> x; for (ll i = -200; i <= 200; i++) { for (ll j = -200; j <= 200; j++) { ll a = i * i * i * i * i; ll b ...
[["-", 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 <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; const int N = 1234567; int a[123][123]; int main() { int x; cin >> x; for (int i = -1000; i <= 1000; i++) for (int j = -1000; ...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; const int N = 1234567; int a[123][123]; int main() { long long x; cin >> x; for (int i = -1000; i <= 1000; i++) for (int j = -...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 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
138
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n) for (ll i = 0; i < n; ++i) int main() { ll x; cin >> x; ll a, b; rep(i, 150) { rep(j, 150) { a = pow(i, 5); b = pow(j, 5); if (a + b == x) { cout << i << " -33" << j << endl; return 0...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n) for (ll i = 0; i < n; ++i) int main() { ll x; cin >> x; ll a, b; rep(i, 150) { rep(j, 150) { a = pow(i, 5); b = pow(j, 5); if (a + b == x) { cout << i << " -" << j << endl; return 0; ...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
128
x = int(input()) for i in range(0, 120): for j in range(-119, 120): if (i**5 + j**5) == x: print(i,j) exit()
x = int(input()) for i in range(-119, 120): for j in range(-119, 120): if i**5 - j**5 == x: print(i,j) exit()
[["-", 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], ["-", 8, 196, 0, 57, 15, 666, 0, 23, 0, 24], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 23, 0, 25]]
5
51
x = int(input()) for i in range(0, 120): for j in range(-119, 120): if (i**5 + j**5) == x: print(i,j) exit()
x = int(input()) for i in range(0, 120): for j in range(-119, 120): if (i**5 - j**5) == x: print(i,j) exit()
[["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 72], ["+", 0, 57, 15, 666, 0, 23, 0, 657, 17, 33]]
5
51
#include <bits/stdc++.h> using namespace std; #define int long long const int M = 5e3 + 5; int x, pw[2 * M]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for (int i = -M + 1; i < M; i++) pw[i + M] = pow(i, 5); cin >> x; for (int i = -M; i < M; i++) { int a = pw[i + M]; ...
#include <bits/stdc++.h> using namespace std; #define int long long const int M = 5e3 + 5; int x, pw[2 * M]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for (int i = -M; i < M; i++) pw[i + M] = pow(i, 5); cin >> x; for (int i = -M; i < M; i++) { int a = pw[i + M]; fo...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
167
#include <iostream> #include <stdio.h> #include <stdlib.h> int main() { int x; int a, b; int max_roop = 130; bool roop_break = false; int i, j; scanf("%d", &x); for (a = -max_roop; a <= max_roop; a++) { for (b = -max_roop; b <= max_roop; b++) { if ((a * a * a * a * a - b * b * b * b * b) == x...
#include <iostream> #include <stdio.h> #include <stdlib.h> int main() { int x; long a, b; int max_roop = 130; bool roop_break = false; int i, j; scanf("%d", &x); for (a = -max_roop; a <= max_roop; a++) { for (b = -max_roop; b <= max_roop; b++) { if ((a * a * a * a * a - b * b * b * b * b) == ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
134
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace std; using namespace __gnu_pbds; #define ll long long #define mk make_pair template <class key, class cmp = std::less<key>> using ordered_set = tree<key, null_type, cmp, rb_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> using namespace std; using namespace __gnu_pbds; #define ll long long #define mk make_pair template <class key, class cmp = std::less<key>> using ordered_set = tree<key, null_type, cmp, rb_...
[["-", 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
270
#include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #incl...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
1,582
#include <bits/stdc++.h> #define pb push_back #define vl vector #define ll long long #define ff first #define ss second #define fast std::ios::sync_with_stdio(false) using namespace std; ll ras(ll a) { return a * a * a * a * a; } int main() { fast; ll x; cin >> x; ll i, j; for (i = -200; i <= 200; i++) { ...
#include <bits/stdc++.h> #define pb push_back #define vl vector #define ll long long #define ff first #define ss second #define fast std::ios::sync_with_stdio(false) using namespace std; ll ras(ll a) { return a * a * a * a * a; } int main() { fast; ll x; cin >> x; ll i, j; for (i = -200; i <= 200; i++) { ...
[["-", 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], ["+", 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
x = int(input()) for a in range(1000): for b in range(1000): if a ** 5 - b ** 5 == x: print(a,b) exit()
x = int(input()) for a in range(-1000,1000): for b in range(-1000,1000): if a ** 5 - b ** 5 == x: print(a,b) exit()
[["+", 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, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
44
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; for (int i = -120; i <= 121; ++i) { for (int j = -120; j <= 121; ++j) { long a = pow(i, 5); long b = pow(j, 5); if (a - b == x) { cout << a << " " << b; return 0; } } } }
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; for (int i = -120; i <= 121; ++i) { for (int j = -120; j <= 121; ++j) { long a = pow(i, 5); long b = pow(j, 5); if (a - b == x) { cout << i << " " << j; return 0; } } } }
[["-", 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
95
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; long long int A, B; int flag = false; for (int i = -200; i <= 200; i++) { for (int j = -200; j <= 200; j++) { A = i * i * i * i * i; B = j * j * j * j * j; if (A - B == x) { cout << i << " " << j << endl;...
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; long long int A, B; int flag = false; for (long long int i = -200; i <= 200; i++) { for (long long int j = -200; j <= 200; j++) { A = i * i * i * i * i; B = j * j * j * j * j; if (A - B == x) { cout << i ...
[["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
123
/* ID: learnin7 TASK: test LANG: C++ */ /* LANG can be C++11 or C++14 for those more recent releases */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); // ofstream fout ("test.out"); // ifstream fin ("test.in"); // fin >> a >> b; // fout << a+b...
/* ID: learnin7 TASK: test LANG: C++ */ /* LANG can be C++11 or C++14 for those more recent releases */ #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); // ofstream fout ("test.out"); // ifstream fin ("test.in"); // fin >> a >> b; // fout << a+b...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
107
#include "bits/stdc++.h" #pragma optimize("unroll-loops"); #pragma optimize("Ofast"); //#include "pch.h" using namespace std; unordered_map<int, bool> here; using ll = long long; const int nax = 1e5 + 10; vector<int> edges[nax]; int main() { ll x; cin >> x; for (ll a = -1000; a <= 1000; ++a) { for (ll b =...
#include "bits/stdc++.h" #pragma optimize("unroll-loops"); #pragma optimize("Ofast"); //#include "pch.h" using namespace std; unordered_map<int, bool> here; using ll = long long; const int nax = 1e5 + 10; vector<int> edges[nax]; int main() { ll x; cin >> x; for (ll a = -1000; a <= 1000; ++a) { for (ll b =...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22]]
1
142
x=int(input()) for i in range(-118,120): for j in range(-118,120): if i**2-j**2==x: print(i,j) exit(1)
x=int(input()) # an = n^5 - (n - 1)^5 # a -> 120~-119 -> -118~119 # b -> 119~-120 -> -119~118 for i in range(-118,120): for j in range(-119,119): if i**5-j**5==x: print(i,j) exit()
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 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, ...
5
51
#include <bits/stdc++.h> using namespace std; /* typedef */ typedef long long ll; typedef pair<int, int> pii; /* constant */ const ll MAX = 1e+9; /* global variables */ /* function */ /* main */ int main() { ll X; cin >> X; int lower = -120; int upper = 120; for (int i = lower; i <= upper; i++) { ll p = ...
#include <bits/stdc++.h> using namespace std; /* typedef */ typedef long long ll; typedef pair<int, int> pii; /* constant */ const ll MAX = 1e+9; /* global variables */ /* function */ /* main */ int main() { ll X; cin >> X; int lower = -120; int upper = 120; for (int i = lower; i <= upper; i++) { ll p = ...
[["-", 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
133
#include <bits/stdc++.h> using namespace std; int main() { long long x; long long ansa, ansb; bool endf = false; for (int i = -1000; i <= 1000; i++) { for (int j = -1000; j <= 1000; j++) { if (powl(i, 5) - powl(j, 5) == x) { ansa = i; ansb = j; endf = true; break; ...
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; long long ansa, ansb; bool endf = false; for (int i = -1000; i <= 1000; i++) { for (int j = -1000; j <= 1000; j++) { if (powl(i, 5) - powl(j, 5) == x) { ansa = i; ansb = j; endf = true; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
111
#include <bits/stdc++.h> using namespace std; int main() { long long x, a, b; bool btf = false; cin >> x; long long i, j; for (i = -1000; i <= 1000; i++) { for (j = -1000; j <= 1000; j++) { if (powl(i, 5) - powl(j, 5) == x) break; } if (j != 101) break; } cout << i << " ...
#include <bits/stdc++.h> using namespace std; int main() { long long x, a, b; bool btf = false; cin >> x; long long i, j; for (i = -1000; i <= 1000; i++) { for (j = -1000; j <= 1000; j++) { if (powl(i, 5) - powl(j, 5) == x) break; } if (j != 1001) break; } cout << i << "...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
105
#include <algorithm> #include <iostream> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <assert.h> #include <bitset> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <assert.h> #include <bitset> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
1,798
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
131
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) #define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i) using ll = long long; using ld = long double; const ll INF = 1e18; const int Inf = 1e9; const double EPS = 1...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) #define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i) using ll = long long; using ld = long double; const ll INF = 1e18; const int Inf = 1e9; const double EPS = 1...
[["+", 8, 9, 0, 37, 0, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 37, 0, 16, 31, 16, 12, 22]]
1
201
#include <bits/stdc++.h> using namespace std; template <typename T> void print_vector(vector<T> &vec) { cout << "print_vector -> "; for (int i = 0; i < vec.size(); i++) { if (i == vec.size() - 1) { cout << vec[i] << endl; } else { cout << vec[i] << " "; } } return; } int main() { lo...
#include <bits/stdc++.h> using namespace std; template <typename T> void print_vector(vector<T> &vec) { cout << "print_vector -> "; for (int i = 0; i < vec.size(); i++) { if (i == vec.size() - 1) { cout << vec[i] << endl; } else { cout << vec[i] << " "; } } return; } int main() { lo...
[["-", 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
190
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; for (int i = -200; i < 201; i++) { for (int j = -200; j < 201; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } } } }
#include <bits/stdc++.h> using namespace std; int main() { long long X; cin >> X; for (long long i = -200; i < 201; i++) { for (long long j = -200; j < 201; j++) { if (i * i * i * i * i - j * j * j * j * j == X) { cout << i << " " << j << endl; return 0; } } } }
[["-", 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
92
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define dup(x, y) (((x) + (y)-1) / (y)) #define ALL(x) (x).begin(), (x).end() typedef long long ll; typedef pair<int, int> pii; const double EPS = 1e-10; const int INF = 1e9; const ll LINF = 1e15; const int MOD = 1000000007; c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define dup(x, y) (((x) + (y)-1) / (y)) #define ALL(x) (x).begin(), (x).end() typedef long long ll; typedef pair<int, int> pii; const double EPS = 1e-10; const int INF = 1e9; const ll LINF = 1e15; const int MOD = 1000000007; c...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
193
import sys import heapq from decimal import Decimal input = sys.stdin.readline x = int(input()) for i in range(1,1000): for j in range(-1000,1000): if i**5 + j**5 == x: print(i,j) exit(0)
import sys import heapq from decimal import Decimal input = sys.stdin.readline x = int(input()) for i in range(-1000,1000): for j in range(-1000,1000): if i**5 - j**5 == x: print(i,j) exit(0)
[["-", 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], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33]]
5
65
#include <bits/stdc++.h> #include <chrono> #include <math.h> using namespace std; using ll = long long; using ld = long double; using namespace std::chrono; #define fo(i, z, n) for (int i = z; i < n; i++) #define Fo(i, z, n) for (ll i = z; i < n; i++) #define INT_BITS 32 #define mod 1000000007 #define vi vector<int> #d...
#include <bits/stdc++.h> #include <chrono> #include <math.h> using namespace std; using ll = long long; using ld = long double; using namespace std::chrono; #define fo(i, z, n) for (int i = z; i < n; i++) #define Fo(i, z, n) for (ll i = z; i < n; i++) #define INT_BITS 32 #define mod 1000000007 #define vi vector<int> #d...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
326
#include <bits/stdc++.h> using ll = long long; using namespace std; int main(void) { ll x; cin >> x; ll q = sqrtl(sqrtl(x)); for (ll a = -q; abs(a) <= q; ++a) for (ll b = -q; abs(b) <= q; --b) if (a * a * a * a * a - b * b * b * b * b == x) { printf("%lld %lld\n", a, b); return 0; ...
#include <bits/stdc++.h> using ll = long long; using namespace std; int main(void) { int x; cin >> x; int q = sqrtl(sqrtl(x)); for (ll a = -q; abs(a) <= q; ++a) for (ll b = -q; abs(b) <= q; ++b) if (a * a * a * a * a - b * b * b * b * b == x) { printf("%lld %lld\n", a, b); return 0; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 7, 8, 7, 26, 27, 17, 68], ["+", 8, 9, 0, 7, 8, 7, 26, 27, 17, 29]]
1
117
x = int(input()) def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] p = make...
x = int(input()) def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] p = make...
[["-", 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], ["-", 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, ...
5
126
// Hail god Yato #include <bits/stdc++.h> using namespace std; #define hs \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0...
// Hail god Yato #include <bits/stdc++.h> using namespace std; #define hs \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(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, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 7, 8, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 7...
1
170
#include <iostream> #define ill long long #define rep(i, a, b) for (ill i = a; i < b; i++) using namespace std; int main() { int x; cin >> x; rep(i, -500, 501) { rep(j, -500, 501) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << "\n"; break; } } }...
#include <iostream> #define ill long long #define rep(i, a, b) for (ill i = a; i < b; i++) using namespace std; int main() { int x; cin >> x; rep(i, -500, 501) { rep(j, -500, 501) { if (i * i * i * i * i - j * j * j * j * j == x) { cout << i << " " << j << "\n"; return 0; } } ...
[["-", 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
96
#include <bits/stdc++.h> using namespace ::std; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; typedef array<int, 3> tri; typedef long double ld; template <class T> istream &operator>>(istream &I, vector<T> &v) { for (T &e : v) I >> e; return I; } template <class T>...
#include <bits/stdc++.h> using namespace ::std; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; typedef array<int, 3> tri; typedef long double ld; template <class T> istream &operator>>(istream &I, vector<T> &v) { for (T &e : v) I >> e; return I; } template <class T>...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 25]]
1
261
#include <algorithm> #include <cmath> //abs()かfabs()で少数絶対値 #include <cstdlib> //abs()で整数絶対値 #include <functional> //sort第三引数greater<型名>()で降順 #include <iomanip> //cout<<setw(数字) で空白による桁揃え #include <iostream> //cout<<right で右揃え #include <queue> #include <string> #include <vector> using namespace std; using ...
#include <algorithm> #include <cmath> //abs()かfabs()で少数絶対値 #include <cstdlib> //abs()で整数絶対値 #include <functional> //sort第三引数greater<型名>()で降順 #include <iomanip> //cout<<setw(数字) で空白による桁揃え #include <iostream> //cout<<right で右揃え #include <queue> #include <string> #include <vector> using namespace std; using ...
[["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
129
def main(): x = int(input()) kouhodic = dict() for i in range(200): kouhodic[i ** 5] = i kouhodic[-i ** 5] = -i kouhodic = sorted(kouhodic.items()) kazu = len(kouhodic) print(kouhodic) for i in range(kazu): for j in range(i+1, kazu): if kouhodic[j][...
def main(): x = int(input()) kouhodic = dict() for i in range(200): kouhodic[i ** 5] = i kouhodic[-i ** 5] = -i kouhodic = sorted(kouhodic.items()) kazu = len(kouhodic) #print(kouhodic) for i in range(kazu): for j in range(i+1, kazu): if kouhodic[j]...
[["-", 0, 14, 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
134