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 |
|---|---|---|---|---|
from sys import stdin,stdout
inp = stdin.readline
out = stdout.write
n,m = map(int,inp().split())
h = [int(u) for u in inp().split()]
adj = [[] for _ in range(n)]
for i in range(m):
u,v = map(int,inp().split())
u -= 1
v -= 1
adj[u].append(v)
adj[v].append(u)
marked = [False for _ in range(n)]
cnt = ... | from sys import stdin,stdout
inp = stdin.readline
out = stdout.write
n,m = map(int,inp().split())
h = [int(u) for u in inp().split()]
adj = [[] for _ in range(n)]
for i in range(m):
u,v = map(int,inp().split())
u -= 1
v -= 1
adj[u].append(v)
adj[v].append(u)
marked = [False for _ in range(n)]
cnt = ... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 188 |
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
x = [set() for _ in range(n)]
for a, b in ab:
x[a-1].add(b-1)
x[b-1].add(a-1)
print(x)
ans = 0
for i, xx in enumerate(x):
for xxx in xx:
if h[i] <= h[xxx]:
b... | n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
x = [set() for _ in range(n)]
for a, b in ab:
x[a-1].add(b-1)
x[b-1].add(a-1)
ans = 0
for i, xx in enumerate(x):
for xxx in xx:
if h[i] <= h[xxx]:
break
... | [["-", 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 | 149 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e5 + 5;
int h[maxn], son[maxn];
int n, m, a, b, ans;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> h[i];
for (int i = 1; i <= m; i++) {
cin >> a >> b;
son[a] = max(son[a], h[b]);
son[b] = max(h[a], so... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e5 + 5;
int h[maxn], son[maxn];
int n, m, a, b, ans;
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++)
cin >> h[i];
for (int i = 1; i <= m; i++) {
cin >> a >> b;
son[a] = max(son[a], h[b]);
son[b] = max(h[a... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 166 |
n, m = map(int,input().split())
h = list(map(int,input().split()))
n_ans=[1]*n
for i in range(m):
a, b = map(int,input().split())
if h[a-1] <= h[b-1] and n_ans[a-1] == 1:
n_ans[a-1] = 0
if h[a-1] <= h[a-1] and n_ans[b-1] == 1:
n_ans[b-1] = 0
print(sum(n_ans))
| n, m = map(int,input().split())
h = list(map(int,input().split()))
n_ans=[1]*n
for i in range(m):
a, b = map(int,input().split())
if h[a-1] <= h[b-1] and n_ans[a-1] == 1:
n_ans[a-1] = 0
if h[b-1] <= h[a-1] and n_ans[b-1] == 1:
n_ans[b-1] = 0
print(sum(n_ans))
| [["-", 15, 679, 31, 666, 0, 206, 206, 657, 31, 22], ["+", 15, 679, 31, 666, 0, 206, 206, 657, 31, 22]] | 5 | 135 |
import numpy as np
argList = list(map(int, input().split()))
heights = list(map(int, input().split()))
#いい展望台フラグ
check = np.array([1]*argList[0])
for n in range(argList[1]):
#どことどこをつないでいるか
con = list(map(int, input().split()))
#低かったらいい展望台ではない
if heights[con[0]-1] < heights[con[1]-1]:
check[... | import numpy as np
argList = list(map(int, input().split()))
heights = list(map(int, input().split()))
#いい展望台フラグ
check = np.array([1]*argList[0])
for n in range(argList[1]):
#どことどこをつないでいるか
con = list(map(int, input().split()))
#低かったらいい展望台ではない
if heights[con[0]-1] <= heights[con[1]-1]:
check... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 157 |
n, m = tuple(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
adj = [[] for i in range(n)]
for i in range(m):
a, b = tuple(map(int, input().split(' ')))
a -= 1
b -= 1
adj[a].append(b)
adj[b].append(a)
ans = 0
for i in range(n):
if len(adj[i]) == 0:
ans += 1
else:
for j in adj[i... | n, m = tuple(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
adj = [[] for i in range(n)]
for i in range(m):
a, b = tuple(map(int, input().split(' ')))
a -= 1
b -= 1
adj[a].append(b)
adj[b].append(a)
ans = 0
for i in range(n):
if len(adj[i]) == 0:
ans += 1
else:
ok = True
... | [["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 146], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 12, 146]] | 5 | 171 |
n,m = map(int, input().split())
height = list(map(int, input().split()))
roads = [[] for i in range(n)]
for i in range(m):
x,y = map(int, input().split())
roads[x-1].append(y-1)
roads[y-1].append(x-1)
print(roads)
bestcount = 0
for i in range(n):
best = 1 # 良い展望台なら1
for j in roads[i]:
if... | n,m = map(int, input().split())
height = list(map(int, input().split()))
roads = [[] for i in range(n)]
for i in range(m):
x,y = map(int, input().split())
roads[x-1].append(y-1)
roads[y-1].append(x-1)
bestcount = 0
for i in range(n):
best = 1 # 良い展望台なら1
for j in roads[i]:
if (height[j] >=... | [["-", 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 | 157 |
def resolve():
num_ten, num_load = map(int, input().split())
hiehgts = list(map(int, input().split()))
tenbos = [[]for i in range(num_ten)]
ans = 0
for i in range(num_load):
a, b = map(int, input().split())
tenbos[a-1].append(b-1)
tenbos[b-1].append(a-1)
for index in ran... | def resolve():
num_ten, num_load = map(int, input().split())
hiehgts = list(map(int, input().split()))
tenbos = [[]for i in range(num_ten)]
ans = 0
for i in range(num_load):
a, b = map(int, input().split())
tenbos[a-1].append(b-1)
tenbos[b-1].append(a-1)
for index in ran... | [["-", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372]] | 5 | 159 |
n,m = map(int,input().split())
H = list(map(int,input().split()))
edge = [[] for _ in range(n)]
for _ in range(m):
a,b = map(int,input().split())
a -= 1
b -= 1
edge[a].append(b)
edge[b].append(a)
ans = 0
for i in range(n):
x = edge[i]
if len(x) == 0:
ans += 1
break
... | n,m = map(int,input().split())
H = list(map(int,input().split()))
edge = [[] for _ in range(n)]
for _ in range(m):
a,b = map(int,input().split())
a -= 1
b -= 1
edge[a].append(b)
edge[b].append(a)
ans = 0
for i in range(n):
x = edge[i]
if len(x) == 0:
ans += 1
continu... | [["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117]] | 5 | 157 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
int n, m;
int h[200001];
vector<int> vc[200001];
bool help(int i) {
for (int j = 0; j < vc[i].size(); j++)
if (h[i] < h[vc[i][j]])
return false;
return true;
}
int main... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
int n, m;
int h[200001];
vector<int> vc[200001];
bool help(int i) {
for (int j = 0; j < vc[i].size(); j++)
if (h[i] <= h[vc[i][j]])
return false;
// cout<<i<<endl;
re... | [["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 19]] | 1 | 202 |
N,M= map(int,input().split())
h = [int(i) for i in input().split()]
judge = [True]*N
for i in range (M):
a,b= map(int,input().split())
if h[a - 1] > h[b - 1]:
judge[b-1] = False
if h[a - 1] < h[b - 1]:
judge[a - 1] = False
if h[a - 1] == h[b - 1]:
judge[b-1] = False
jud... | N,M= map(int,input().split())
h = [int(i) for i in input().split()]
judge = [True]*N
for i in range (M):
a,b= map(int,input().split())
if h[a - 1] > h[b - 1]:
judge[b-1] = False
if h[a - 1] < h[b - 1]:
judge[a - 1] = False
if h[a - 1] == h[b - 1]:
judge[b-1] = False
jud... | [["-", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22]] | 5 | 151 |
n,m=map(int,input().split(" "))
h=list(map(int,input().split(" ")))
g=[1]*n
for i in range(m):
r=list(map(int,input().split(" ")))
if h[r[0]-1]<h[r[1]-1]:
g[r[0]-1]*=0
elif h[r[0]-1]>h[r[1]-1]:
g[r[1]-1]*=0
print(sum(g)) | n,m=map(int,input().split(" "))
h=list(map(int,input().split(" ")))
g=[1]*n
for i in range(m):
r=list(map(int,input().split(" ")))
if h[r[0]-1]<=h[r[1]-1]:
g[r[0]-1]*=0
if h[r[0]-1]>=h[r[1]-1]:
g[r[1]-1]*=0
print(sum(g)) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 145 |
#include <iostream>
using namespace std;
int main() {
int n, m, a, b, ans = 0;
int h[100001] = {}, ab[100001] = {};
cin >> n >> m;
for (int i = 1; i <= n; i++) {
scanf("%d", &h[i]);
}
for (int i = 0; i < m; i++) {
scanf("%d%d", &a, &b);
if (ab[a] < h[b]) {
ab[a] = h[b];
}
if (ab[b]... | #include <iostream>
using namespace std;
int main() {
int n, m, a, b, ans = 0;
int h[100001] = {}, ab[100001] = {};
cin >> n >> m;
for (int i = 1; i <= n; i++) {
scanf("%d", &h[i]);
}
for (int i = 0; i < m; i++) {
scanf("%d%d", &a, &b);
if (ab[a] < h[b]) {
ab[a] = h[b];
}
if (ab[b]... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 194 |
#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>;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n + 1);
vector<bool> s(n + 1);
for (int i = 1; i <= n; i++) {
cin >> h[i];
s[i] = true;
}
for (int i ... | #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>;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n + 1);
vector<bool> s(n + 1);
for (int i = 1; i <= n; i++) {
cin >> h[i];
s[i] = true;
}
for (int i ... | [["-", 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 | 201 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
vector<bool> ok(n, true);
rep(i, n) cin >> h[i];
rep(i, n) {
int a, b;
cin >> a >> b;
a--, b--;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
vector<bool> ok(n, true);
rep(i, n) cin >> h[i];
rep(i, m) {
int a, b;
cin >> a >> b;
a--, b--;... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 176 |
cnt = 0
n, m = gets.chomp.split(" ").map{|i|i.to_i}
h = gets.chomp.split(" ").map{|i|i.to_i}
a=[]; b=[]
m.times do |i|
a[i], b[i] = gets.chomp.split(" ").map{|j|j.to_i}
end
max=Array.new(n+1, 0)
p max
0.upto(a.size-1) do |i|
max[a[i]] = [h[b[i]-1], max[a[i]]].max
max[b[i]] = [h[a[i]-1], max[b[i]]].max
end
1.upt... | cnt = 0
n, m = gets.chomp.split(" ").map{|i|i.to_i}
h = gets.chomp.split(" ").map{|i|i.to_i}
a=[]; b=[]
m.times do |i|
a[i], b[i] = gets.chomp.split(" ").map{|j|j.to_i}
end
max=Array.new(n+1, 0)
0.upto(a.size-1) do |i|
max[a[i]] = [h[b[i]-1], max[a[i]]].max
max[b[i]] = [h[a[i]-1], max[b[i]]].max
end
1.upto(n) d... | [["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]] | 4 | 211 |
#include <bits/stdc++.h>
#define ll long long int
#define N 100010
using namespace std;
int main() {
ll n, m, h[N], ma[N];
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> h[i];
ma[i] = 0;
}
ll a, b;
for (int i = 0; i < m; i++) {
cin >> a >> b;
ma[a] = max(ma[a], h[b]);
ma[b] = max(ma... | #include <bits/stdc++.h>
#define ll long long int
#define N 100010
using namespace std;
int main() {
ll n, m, h[N], ma[N];
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> h[i];
ma[i] = 0;
}
ll a, b;
for (int i = 0; i < m; i++) {
cin >> a >> b;
ma[a] = max(ma[a], h[b]);
ma[b] = max(m... | [["-", 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]] | 1 | 174 |
n,m = map(int, input().split())
h_a = list(map(int, input().split()))
m_l = [[0,0]]*m
r_l = [{}]*n
for i in range(m):
r = list(map(int, input().split()))
a = r[0] - 1
b = r[1] - 1
ral = set([]) if len(r_l[a]) == 0 else r_l[a]
rbl = set([]) if len(r_l[b]) == 0 else r_l[b]
ral.add(b)
rbl.add(a)
r_l[a]... | n,m = map(int, input().split())
h_a = list(map(int, input().split()))
m_l = [[0,0]]*m
r_l = [{}]*n
for i in range(m):
r = list(map(int, input().split()))
a = r[0] - 1
b = r[1] - 1
ral = set([]) if len(r_l[a]) == 0 else r_l[a]
rbl = set([]) if len(r_l[b]) == 0 else r_l[b]
ral.add(b)
rbl.add(a)
r_l[a]... | [["-", 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 | 205 |
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int N, M;
cin >> N >> M;
vector<int> H(N + 1);
vector<int> mx(N + 1, 0);
vector<int> A(M);
vector<int> B(M);
rep(i, N) { cin >> H[i + ... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int N, M;
cin >> N >> M;
vector<int> H(N + 1);
vector<int> mx(N + 1, 0);
vector<int> A(M);
vector<int> B(M);
rep(i, N) { cin >> H[i + ... | [["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 217 |
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
a,b=map(int,input().split())
if h[a-1]>h[b-1]:
count[b-1]=0
elif h[a-1]==h[b-1]:
count[a-1]=0
count[b-1]=0
else:
count[b-1]=0
print(sum(count))
| n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
a,b=map(int,input().split())
if h[a-1]>h[b-1]:
count[b-1]=0
elif h[a-1]==h[b-1]:
count[a-1]=0
count[b-1]=0
else:
count[a-1]=0
print(sum(count))
| [["-", 0, 1, 0, 662, 31, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 31, 22]] | 5 | 135 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, u, v, h[N], ans;
struct edge {
int v, next;
} edges[N << 1];
int tot, head[N];
void add_edges(int u, int v) {
edges[++tot].v = v;
edges[tot].next = head[u];
head[u] = tot;
edges[++tot].v = u;
edges[tot].next = head[v];
head[v] ... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, u, v, h[N], ans;
struct edge {
int v, next;
} edges[N << 1];
int tot, head[N];
void add_edges(int u, int v) {
edges[++tot].v = v;
edges[tot].next = head[u];
head[u] = tot;
edges[++tot].v = u;
edges[tot].next = head[v];
head[v] ... | [["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 260 |
N,M=map(int, input().split())
H=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]
sup_list=[1 for i in range(N)]
for j in range(M):
if H[List[j][0]-1]>H[List[j][1]-1]:
sup_list[List[j][1]-1]=0
elif H[List[j][0]-1]==H[List[j][1]-1]:
sup_list[List[j][0]-1]=0
... | N,M=map(int, input().split())
H=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]
sup_list=[1 for i in range(N)]
for j in range(M):
if H[List[j][0]-1]>H[List[j][1]-1]:
sup_list[List[j][1]-1]=0
elif H[List[j][0]-1]==H[List[j][1]-1]:
sup_list[List[j][0]-1]=0
... | [["-", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612], ["+", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612]] | 5 | 198 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int H[] = new int[N];
int ma[] = new int[N];
for (int i = 1; i <= N; i++) {
H[i] = sc.nextInt();
ma[i] = 0;
}... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int H[] = new int[N + 1];
int ma[] = new int[N + 1];
for (int i = 1; i <= N; i++) {
H[i] = sc.nextInt();
ma[i] = ... | [["+", 49, 200, 51, 227, 497, 505, 0, 16, 17, 72], ["+", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499]] | 3 | 230 |
#include <bits/stdc++.h>
#define speed \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define oprecision ... | #include <bits/stdc++.h>
#define speed \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define oprecision ... | [["-", 28, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 28, 2, 3, 4, 0, 2, 63, 118, 119, 120]] | 1 | 227 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mv = 200003;
int h[mv], n, m, hi, a, b, c = 0;
vector<int> adj[mv];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> hi;
h[i] = hi;
}
for (int i = 0; i < m; i++) {
cin >> a >> b;
adj[a].push_back(b);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mv = 200003;
int h[mv], n, m, hi, a, b, c = 0;
vector<int> adj[mv];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> hi;
h[i] = hi;
}
for (int i = 0; i < m; i++) {
cin >> a >> b;
adj[a].push_back(b);
... | [["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]] | 1 | 236 |
#include <array>
#include <iostream>
using namespace std;
const int MaxObservatoryNum = 100000;
// const int MaxObservatoryNum = 100;
// 負けがない展望台を出力
int main() {
int observatory_num;
int road_num;
array<int, MaxObservatoryNum + 1> observatory_height_list;
array<bool, MaxObservatoryNum + 1> is_good_observator... | #include <array>
#include <iostream>
using namespace std;
const int MaxObservatoryNum = 100000;
// const int MaxObservatoryNum = 100;
// 負けがない展望台を出力
int main() {
int observatory_num;
int road_num;
array<int, MaxObservatoryNum + 1> observatory_height_list;
array<bool, MaxObservatoryNum + 1> is_good_observator... | [["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117]] | 1 | 231 |
N, M = map(int, input().split())
H = list(map(int, input().split()))
Height = []
Good = []
for i in range(N):
Height.append(H[i])
Good.append(0)
for i in range(M):
A, B = map(int, input().split())
if Height[A - 1] < Height[B - 1]:
Good[A - 1] = 1
if Height[A - 1] > Height[B - 1]:
Goo... | N, M = map(int, input().split())
H = list(map(int, input().split()))
Height = []
Good = []
for i in range(N):
Height.append(H[i])
Good.append(0)
for i in range(M):
A, B = map(int, input().split())
if Height[A - 1] < Height[B - 1]:
Good[A - 1] = 1
elif Height[A - 1] > Height[B - 1]:
G... | [["-", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683]] | 5 | 178 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57,... | 1 | 817 |
N, M = map(int, input().split())
H = [int(h) for h in input().split()]
flag = [1 for i in range(N)]
for i in range(M):
a, b = map(int, input().split())
if H[a-1] < H[b-1]:
flag[a-1] = 0
elif H[a-1] > H[b-1]:
flag[b-1] = 0
print(sum(flag)) | N, M = map(int, input().split())
H = [int(h) for h in input().split()]
flag = [1 for i in range(N)]
for i in range(M):
a, b = map(int, input().split())
if H[a-1] <= H[b-1]:
flag[a-1] = 0
if H[a-1] >= H[b-1]:
flag[b-1] = 0
print(sum(flag)) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 123 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n), ma(n);
for (int i = 1; i < n + 1; i++) {
cin >> h[i];
ma[i] = 0;
}
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
ma[a] = max(h[b], ma[a]);
ma[b] = max(h[a], ma[b]);
}
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n + 1), ma(n + 1);
for (int i = 1; i < n + 1; i++) {
cin >> h[i];
ma[i] = 0;
}
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
ma[a] = max(h[b], ma[a]);
ma[b] = max(h[a], ma[b]);... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]] | 1 | 179 |
#include <stdio.h>
int main(void) {
int N, M, H[100001], i, A[100001], B[100001];
int frag[100001] = {0}, ans = 0;
scanf("%d %d", &N, &M);
for (i = 1; i <= N; i = i + 1) {
scanf("%d", &H[i]);
}
for (i = 0; i < M; i = i + 1) {
scanf("%d %d", &A[i], B[i]);
}
for (i = 0; i < M; i = i + 1) {
... | #include <stdio.h>
int main(void) {
int N, M, H[100001], i, A[100001], B[100001];
int frag[100001] = {0}, ans = 0;
scanf("%d %d", &N, &M);
for (i = 1; i <= N; i = i + 1) {
scanf("%d", &H[i]);
}
for (i = 0; i < M; i = i + 1) {
scanf("%d %d", &A[i], &B[i]);
}
for (i = 0; i < M; i = i + 1) {
... | [["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]] | 0 | 264 |
N,M=map(int,input().split())
H=list(map(int,input().split))
check=[0]*N
for i in range(M):
A,B=map(int,input.split)
if H[A-1]>H[B-1]:
check[B-1]=check[B-1]+1
elif H[A-1]<H[B-1]:
check[A-1]=check[A-1]+1
else:
check[A-1]+=1
check[B-1]+=1
ans=check.count(0)
print(ans) | N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
A,B=map(int,input().split())
if H[A-1]>H[B-1]:
check[B-1]=check[B-1]+1
elif H[A-1]<H[B-1]:
check[A-1]=check[A-1]+1
else:
check[A-1]+=1
check[B-1]+=1
ans=check.count(0)
print(ans) | [["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 148 |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int n, m;
int h[maxn], a, b;
int ans = 0;
vector<int> v[maxn];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++)
cin >> h[i];
for (int i = 0; i < m; i++) {
cin >> a >> b;
v[a].push_back(h[b]);
v[b].push_back(h[a]);
}
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int n, m;
int h[maxn], a, b;
int ans = 0;
vector<int> v[maxn];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++)
cin >> h[i];
for (int i = 0; i < m; i++) {
cin >> a >> b;
v[a].push_back(h[b]);
v[b].push_back(h[a]);
}
... | [["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]] | 1 | 210 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m, ans = 0;
cin >> n >> m;
long long h[n], mm[n];
for (int i = 0; i < n; i++) {
cin >> h[i];
mm[i] = 0;
}
long long a[m], b[m];
for (int i = 0; i < m; i++) {
cin >> a[i] >> b[i];
mm[a[i] - 1] = max(mm[a[i] - 1], h[b[i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m, ans = 0;
cin >> n >> m;
long long h[n], mm[n];
for (int i = 0; i < n; i++) {
cin >> h[i];
mm[i] = 0;
}
long long a[m], b[m];
for (int i = 0; i < m; i++) {
cin >> a[i] >> b[i];
mm[a[i] - 1] = max(mm[a[i] - 1], h[b[i]... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 213 |
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<int> h(N);
for (int i = 0; i < N; ++i)
std::cin >> h[i];
std::vector<int> co_h(N);
for (int i = 0; i < M; ++i) {
int s, d;
std::cin >> s >> d;
co_h[s - 1] = std::max(co_h[s - ... | #include <algorithm>
#include <iostream>
#include <vector>
int main() {
int N, M;
std::cin >> N >> M;
std::vector<int> h(N);
for (int i = 0; i < N; ++i)
std::cin >> h[i];
std::vector<int> co_h(N);
for (int i = 0; i < M; ++i) {
int s, d;
std::cin >> s >> d;
co_h[s - 1] = std::max(co_h[s - ... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 20], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 47]] | 1 | 194 |
N,M = map(int,input().split())
H=list(map(int,input().split()))
ABmap=[[] for i in range(N)]
count=0
for i in range(M):
A,B=map(lambda x:x-1,map(int,input().split()))
ABmap[A].append(H[B])
ABmap[B].append(H[A])
for i in range(N):
if len(ABmap[i])==0:
count+=1
elif max(ABmap[i])<H[i]... | N,M = map(int,input().split())
H=list(map(int,input().split()))
ABmap=[[] for i in range(N)]
count=0
for i in range(M):
A,B=map(lambda x:x-1,map(int,input().split()))
ABmap[A].append(H[B])
ABmap[B].append(H[A])
for i in range(N):
if len(ABmap[i])==0:
count+=1
elif max(ABmap[i])<H[i]... | [["+", 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 | 148 |
N, M = map(int, input().split(" "))
flag = [1 for i in range(M)]
height = list(map(int, input().split(" ")))
for i in range(M):
a, b = map(int, input().split(" "))
if height[a - 1] < height[b - 1]:
flag[a - 1] = 0
elif height[a - 1] > height[b - 1]:
flag[b - 1] = 0
else:
flag[a - 1] = 0
flag[b -... | N, M = map(int, input().split(" "))
flag = [1 for i in range(N)]
height = list(map(int, input().split(" ")))
for i in range(M):
a, b = map(int, input().split(" "))
if height[a - 1] < height[b - 1]:
flag[a - 1] = 0
elif height[a - 1] > height[b - 1]:
flag[b - 1] = 0
else:
flag[a - 1] = 0
flag[b -... | [["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 22], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 22]] | 5 | 149 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
ll MM = 1000000000;
ll mod ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
ll MM = 1000000000;
ll mod ... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 343 |
def i():
return int(input())
def i2():
return map(int,input().split())
def s():
return str(input())
def l():
return list(input())
def intl():
return list(int(k) for k in input().split())
n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
a,b=i2()
l[a-1].append(b-1)
l[b-1... | def i():
return int(input())
def i2():
return map(int,input().split())
def s():
return str(input())
def l():
return list(input())
def intl():
return list(int(k) for k in input().split())
n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
a,b=i2()
l[a-1].append(b-1)
l[b-1... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 222 |
N,M=map(int,input().split())
H=list(map(int,input().split()))
ans=[0]*N #N個のメモ欄を用意
for i in range(M):
A,B=map(int,input().split())
if H[A-1]<H[B-1]: #A,Bで繋がれた展望台のうち、低いほうに印を着けていく。
ans[A-1]+=1
elif H[B-1]<H[A-1]:
ans[A-1]+=1
else: #AとBの標高が同じならどちらにも印をつける。
ans[A-1]+=1
... | N,M=map(int,input().split())
H=list(map(int,input().split()))
ans=[0]*N #N個のメモ欄を用意
for i in range(M):
A,B=map(int,input().split())
if H[A-1]<H[B-1]: #A,Bで繋がれた展望台のうち、低いほうに印を着けていく。
ans[A-1]+=1
elif H[B-1]<H[A-1]:
ans[B-1]+=1 #ここのB間違えとるやないかい
else: #AとBの標高が同じならどちらにも印をつける。
... | [["-", 0, 1, 0, 677, 31, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 31, 22]] | 5 | 141 |
#include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010], vis[100010], h[1000010];
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> h[i];
}
for (int i = 1; i <= m; i++) {
cin >> a[i] >> b[i];
}
for (int i = 1; i <= m; i++) {
if (h[a[i]] == h[b[i]]) {
... | #include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010], vis[100010], h[1000010];
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> h[i];
}
for (int i = 1; i <= m; i++) {
cin >> a[i] >> b[i];
}
for (int i = 1; i <= m; i++) {
if (h[a[i]] == h[b[i]]) {
... | [["-", 12, 16, 31, 69, 341, 342, 0, 69, 28, 22], ["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73]] | 1 | 305 |
#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> H;
int main() {
cin >> N >> M;
H.resize(N);
for (int i = 0; i < N; i++)
cin >> H[i];
vector<bool> flag(N, true);
for (int i = 0; i < M; i++) {
int temp1, temp2;
cin >> temp1 >> temp2;
if (H[temp1 - 1] > H[temp2 - 1])
f... | #include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> H;
int main() {
cin >> N >> M;
H.resize(N);
for (int i = 0; i < N; i++)
cin >> H[i];
vector<bool> flag(N, true);
for (int i = 0; i < M; i++) {
int temp1, temp2;
cin >> temp1 >> temp2;
if (H[temp1 - 1] > H[temp2 - 1])
f... | [["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 204 |
n,m=map(int,input().split())
h=list(map(int,input().split()))
ab=[list(map(int,input().split())) for i in range(m)]
ans=[1 for i in range(n)]
for i in range(m):
aa=ab[i][0]-1
bb=ab[i][1]-1
if h[aa]>h[bb]:
ans[bb]=0
elif h[aa]<h[aa]:
ans[aa]=0
else:
ans[aa]=0
ans[bb]... | n,m=map(int,input().split())
h=list(map(int,input().split()))
ab=[list(map(int,input().split())) for i in range(m)]
ans=[1 for i in range(n)]
for i in range(m):
aa=ab[i][0]-1
bb=ab[i][1]-1
if h[aa]>h[bb]:
ans[bb]=0
elif h[aa]<h[bb]:
ans[aa]=0
else:
ans[aa]=0
ans[bb]... | [["-", 0, 57, 75, 665, 15, 666, 0, 206, 206, 22], ["+", 0, 57, 75, 665, 15, 666, 0, 206, 206, 22]] | 5 | 156 |
def q3():
N, M = (int(i) for i in input().split())
H = [int(i) for i in input().split()]
ans = [True]*N
for i in range(M):
A, B = (int(i) for i in input().split())
if H[A-1] <= H[B-1]:
ans[A-1] = False
if H[B-1] <= H[A-1]:
ans[B-1] = False
print(ans... | def q3():
N, M = (int(i) for i in input().split())
H = [int(i) for i in input().split()]
ans = [True]*N
for i in range(M):
A, B = (int(i) for i in input().split())
if H[A-1] <= H[B-1]:
ans[A-1] = False
if H[B-1] <= H[A-1]:
ans[B-1] = False
print(ans... | [["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 146], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 138 |
N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
a,b = map(int,input().split())
if H[a-1] >= H[b-1]:
W[b-1] = 0
if H[b-1] >= H[a]:
W[a-1] = 0
ans = 0
for i in W:
ans += i
print(ans) | N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
a,b = map(int,input().split())
if H[a-1] >= H[b-1]:
W[b-1] = 0
if H[b-1] >= H[a-1]:
W[a-1] = 0
ans = 0
for i in W:
ans += i
print(ans) | [["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]] | 5 | 128 |
#include <bits/stdc++.h>
#define N 100010
int main() {
using namespace std;
int n, m, h[N], ma[N];
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
cin >> h[i];
ma[i] = 0;
}
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
ma[a] = max(ma[a], h[b]);
ma[b] = max(ma[b], h[a]);
in... | #include <bits/stdc++.h>
#define N 100010
int main() {
using namespace std;
int n, m, h[N], ma[N];
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
cin >> h[i];
ma[i] = 0;
}
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
ma[a] = max(ma[a], h[b]);
ma[b] = max(ma[b], h[a]);
}
... | [["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 166 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
int main() {
int n, m;
int h[100000], ma[100000];
cin >> n >> m;
rep(i, n) {
cin >> h[i + 1];
ma[i + 1] = 0;
}
rep(i, m) {
int a, b;
cin >> a >> b;
ma[a] = max(ma[a]... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
int main() {
int n, m;
int h[100000], ma[100000];
cin >> n >> m;
rep(i, n) {
cin >> h[i + 1];
ma[i + 1] = 0;
}
rep(i, m) {
int a, b;
cin >> a >> b;
ma[a] = max(ma[a]... | [["+", 12, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 12, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 162 |
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return [list(x) for x in s... | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return [list(x) for x in s... | [["-", 15, 666, 0, 206, 206, 657, 31, 206, 206, 612], ["+", 15, 666, 0, 206, 206, 657, 31, 206, 206, 612], ["-", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612], ["+", 0, 662, 31, 206, 206, 657, 31, 206, 206, 612]] | 5 | 383 |
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
H = list(map(int, input().split()))
C = [0]*N
for i in range(M):
A, B = map(int, input().split())
if H[A-1] > H[B-1]:
C[B-1]=1
if H[A-1] < H[B-1]:
C[A-1]=1
if H[A-1] == H[B-1]:
if H[A-1]==1:
C[B-1] = 1
... | # -*- coding: utf-8 -*-
N, M = map(int, input().split())
H = list(map(int, input().split()))
C = [0]*N
for i in range(M):
A, B = map(int, input().split())
if H[A-1] >= H[B-1]:
C[B-1]=1
if H[A-1] <= H[B-1]:
C[A-1]=1
if H[A-1] == H[B-1]:
if C[A-1]==1:
C[B-1]... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 64, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 64, 196, 0, 57, 15, 666, 0, 206, 51, 22]] | 5 | 178 |
n,m=map(int,input().split())
H=list(map(int,input().split()))
lb=[True]*n
for r in range(m):
a,b=input().split()
a,b=int(a)-1,int(b)-1
if H[a]>H[b]:
lb[b]=False
elif H[a]<H[b]:
lb[a]=False
else:
lb[a]=False
lb[b]=False
lb.count(True) | n,m=map(int,input().split())
H=list(map(int,input().split()))
lb=[True]*n
for r in range(m):
a,b=input().split()
a,b=int(a)-1,int(b)-1
if H[a]>H[b]:
lb[b]=False
elif H[a]<H[b]:
lb[a]=False
else:
lb[a]=False
lb[b]=False
print(lb.count(True)) | [["+", 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, 3, 4, 0, 25]] | 5 | 130 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> tenbou(N, 0);
vector<int> t_check(N, 1);
for (int i = 0; i < N; i++) {
int a = 0;
cin >> a;
tenbou[i] = a;
}
for (int j = 0; j < M; j++) {
int b, c;
cin >> b >> c;
if (tenbou[b - 1] >= ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> tenbou(N, 0);
vector<int> t_check(N, 1);
for (int i = 0; i < N; i++) {
int a = 0;
cin >> a;
tenbou[i] = a;
}
for (int j = 0; j < M; j++) {
int b, c;
cin >> b >> c;
if (tenbou[b - 1] >= ... | [["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 188 |
n,m=map(int,input().split())
h=list(map(int,input().split()))
ans=[True]*n
for i in range(m):
a,b=map(int,input().split())
a,b=a-1,b-1
ha=h[a]
hb=h[b]
if ha>hb:
ans[b]=False
if hb>ha:
ans[a]=False
else:
ans[a]=False
ans[b]=False
cnt=0
for f in ans:
if f:
... | n,m=map(int,input().split())
h=list(map(int,input().split()))
ans=[True]*n
for i in range(m):
a,b=map(int,input().split())
a,b=a-1,b-1
ha=h[a]
hb=h[b]
if ha>hb:
ans[b]=False
elif hb>ha:
ans[a]=False
else:
ans[a]=False
ans[b]=False
cnt=0
for f in ans:
if f... | [["-", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683]] | 5 | 141 |
#include <cmath>
#include <iostream>
#include <limits>
#include <set>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
vector<bool> ok(n, true);
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
... | #include <cmath>
#include <iostream>
#include <limits>
#include <set>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
vector<bool> ok(n, true);
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 185 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
scanf("%d %d", &n, &m);
vector<int> h(n);
for (int i = 0; i < n; i++) {
scanf("%d", &h[i]);
}
vector<int> a(m);
vector<int> b(m);
vector<bool> v(n);
for (int i = 0; i < n; i++) {
v[i] = true;
}
for (int i = 0; i < m; i++... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
scanf("%d %d", &n, &m);
vector<int> h(n);
for (int i = 0; i < n; i++) {
scanf("%d", &h[i]);
}
vector<int> a(m);
vector<int> b(m);
vector<bool> v(n);
for (int i = 0; i < n; i++) {
v[i] = true;
}
for (int i = 0; i < m; i++... | [["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 269 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
vector<int> g[100005];
vector<int> h(100005);
int bfs(int nod) {
if (g[nod].size() == 0)
return 0;
for (int i = 0; i < g[nod].size(); i++) {
if (h[g[nod][i]] > h[nod])
return 0;
}
return 1;
}
int main() {
ios_base::sy... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
vector<int> g[100005];
vector<int> h(100005);
int bfs(int nod) {
if (g[nod].size() == 0)
return 1;
for (int i = 0; i < g[nod].size(); i++) {
if (h[g[nod][i]] >= h[nod])
return 0;
}
return 1;
}
int main() {
ios_base::s... | [["-", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 231 |
#include <cstdio>
#include <vector>
using namespace std;
int N, M, H[100100];
vector<int> G[100100];
int main() {
scanf("%d %d", &N, &M);
for (int i = 1; i <= N; i++)
scanf("%d", &H[i]);
for (int i = 1; i <= M; i++) {
int x, y;
scanf("%d %d", &x, &y);
G[x].push_back(y);
G[y].push_back(x);
... | #include <cstdio>
#include <vector>
using namespace std;
int N, M, H[100100];
vector<int> G[100100];
int main() {
scanf("%d %d", &N, &M);
for (int i = 1; i <= N; i++)
scanf("%d", &H[i]);
for (int i = 1; i <= M; i++) {
int x, y;
scanf("%d %d", &x, &y);
G[x].push_back(y);
G[y].push_back(x);
... | [["-", 0, 338, 8, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 338, 8, 57, 15, 339, 51, 16, 17, 19]] | 1 | 199 |
N,M=map(int,input().split())
h=list(map(int,input().split()))
t=[0]*N
for i in range(M):
A,B=map(int,input().split())
t[A-1] = max(t[A-1], H[B-1])
t[B-1] = max(t[B-1], H[A-1])
ct=0
for j in range(N):
if H[j]>[j]:
ct+=1
print(ct)
| N,M=map(int,input().split())
h=list(map(int,input().split()))
t=[0]*N
for i in range(M):
A,B=map(int,input().split())
t[A-1] = max(t[A-1], h[B-1])
t[B-1] = max(t[B-1], h[A-1])
ct=0
for j in range(N):
if h[j]>t[j]:
ct+=1
print(ct)
| [["-", 0, 662, 12, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 206, 51, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22]] | 5 | 138 |
n,m=map(int,input().split())
h=list(map,input().split())
x=[[] for i in range(n)]
for i in range(m):
a,b=map(int,input().split())
x[a-1].append(b-1)
x[b-1].append(a-1)
c=0
for i in range(n):
f=1
maxh=0
for j in x[i]:
maxh=max(maxh,h[j])
if maxh>=h[i]:
f=0
c+=f
print(c) | 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-1)
x[b-1].append(a-1)
c=0
for i in range(n):
f=1
maxh=0
for j in x[i]:
maxh=max(maxh,h[j])
if maxh>=h[i]:
f=0
c+=f
print(c) | [["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 147 |
N,M=map(int,input().split())
H=list(map(int,input().split()))
AB=[list(map(int,input().split())) for i in range(M)]
hasi=[0]*N
ans=N
for i in range(M):
if H[AB[i][0]-1]>H[AB[i][1]-1]:
hasi[AB[i][1]-1]+=1
elif H[AB[i][0]-1]<H[AB[i][1]-1]:
hasi[AB[i][0]-1]+=1
else:
hasi[AB[i][0]-1]+=1
... | N,M=map(int,input().split())
H=list(map(int,input().split()))
AB=[list(map(int,input().split())) for i in range(M)]
hasi=[0]*N
for i in range(M):
if H[AB[i][0]-1]>H[AB[i][1]-1]:
hasi[AB[i][1]-1]+=1
elif H[AB[i][0]-1]<H[AB[i][1]-1]:
hasi[AB[i][0]-1]+=1
else:
hasi[AB[i][0]-1]+=1
... | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 200 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sta... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sta... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 335 |
#include <algorithm>
#include <iostream>
using namespace std;
int n, m;
int height[100001];
int biggest[100001]; // the largest peak the height is directly connected to
int main() {
cin >> n >> m;
for (int in1 = 1; in1 <= n; in1++) {
cin >> height[in1];
}
for (int in2 = 0; in2 < m; in2++) {
int a, b;
... | #include <algorithm>
#include <iostream>
using namespace std;
int n, m;
int height[100001];
int biggest[100001]; // the largest peak the height is directly connected to
int main() {
cin >> n >> m;
for (int in1 = 1; in1 <= n;
in1++) // start with 1 because it makes input easier
{
cin >> height[in1];
... | [["-", 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]] | 1 | 168 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<long> heights(n + 1);
for (int i = 1; i <= n; i++) {
cin >> heights[i];
}
vector<vector<int>> adj_list(n + 1);
while (m--) {
int x1, x2;
cin >> x1 >> x2;
adj_list[x1].push_back(x2);
adj_list... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<long> heights(n + 1);
for (int i = 1; i <= n; i++) {
cin >> heights[i];
}
vector<vector<int>> adj_list(n + 1);
while (m--) {
int x1, x2;
cin >> x1 >> x2;
adj_list[x1].push_back(x2);
adj_list... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 218 |
#include <bits/stdc++.h>
using namespace std;
// 総数を1000000007(素数)で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vec... | #include <bits/stdc++.h>
using namespace std;
// 総数を1000000007(素数)で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vec... | [["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]] | 1 | 343 |
#ABC166d
N, M = map(int,input().split())
H = list(map(int, input().split()))
count=[0]*M
A = [0]*M
B = [0]*M
for i in range(M):
A[i], B[i] = map(int, input().split())
ans = [1]*N
for i in range(N):
if H[A[i]-1] == H[B[i]-1]:
ans[A[i]-1] = 0
ans[B[i]-1] = 0
elif H[A[i]-1] > H[B[i]-1]:
... | #ABC166d
N, M = map(int,input().split())
H = list(map(int, input().split()))
count=[0]*M
A = [0]*M
B = [0]*M
for i in range(M):
A[i], B[i] = map(int, input().split())
ans = [1]*N
for i in range(M):
if H[A[i]-1] == H[B[i]-1]:
ans[A[i]-1] = 0
ans[B[i]-1] = 0
elif H[A[i]-1] > H[B[i]-1]:
... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 214 |
n, m = map(int, input().split())
high = list(map(int, input().split()))
judge = ["ok" for i in range(n)]
for i in range(m):
a, b = [int(s) - 1 for i in input().split()]
if high[a] < high[b]:
judge[a] = "ng"
elif high[a] > high[b]:
judge[b] = "ng"
else:
judge[a] = "ng"
... | n, m = map(int, input().split())
high = list(map(int, input().split()))
judge = ["ok" for i in range(n)]
for i in range(m):
a, b = [int(s) - 1 for s in input().split()]
if high[a] < high[b]:
judge[a] = "ng"
elif high[a] > high[b]:
judge[b] = "ng"
else:
judge[a] = "ng"
... | [["-", 0, 1, 0, 662, 12, 658, 0, 659, 31, 22], ["+", 0, 1, 0, 662, 12, 658, 0, 659, 31, 22]] | 5 | 144 |
n, m = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
hs = [[] for i in range(n)]
for i in range(m):
a, b = [int(i) for i in input().split()]
hs[a-1].append(h[b-1])
hs[b-1].appned(h[a-1])
c = 0
for i in range(n):
if len(hs[i]) == 0:
c += 1
elif h[i] > max(hs[i]):
c += 1
print(... | n, m = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
hs = [[] for i in range(n)]
for i in range(m):
a, b = [int(i) for i in input().split()]
hs[a-1].append(h[b-1])
hs[b-1].append(h[a-1])
c = 0
for i in range(n):
if len(hs[i]) == 0:
c += 1
elif h[i] > max(hs[i]):
... | [["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22]] | 5 | 157 |
import java.util.*;
import java.util.stream.*;
class Main {
public static void main(String[] args) {
var scanner = new Scanner(System.in);
var N = scanner.nextInt();
var M = scanner.nextInt();
var height = new int[N + 1];
var good = new int[N + 1];
Arrays.fill(good, 1);
good[0] = 0;
f... | import java.util.*;
import java.util.stream.*;
class Main {
public static void main(String[] args) {
var scanner = new Scanner(System.in);
var N = scanner.nextInt();
var M = scanner.nextInt();
var height = new int[N + 1];
var good = new int[N + 1];
Arrays.fill(good, 1);
good[0] = 0;
f... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 221 |
N, M = map(int, input().split())
O = list(map(int, input().split()))
B = [[] for i in range(N)]
for j in range(M):
o_1, o_2 = map(int, input().split())
B[o_1-1].append(o_2-1)
B[o_2-1].append(o_1-1)
print(B)
ans = 0
for node in range(N):
flag =1
for l in B[node]:
if O[node] <= O[l]:
flag = 0
... | N, M = map(int, input().split())
O = list(map(int, input().split()))
B = [[] for i in range(N)]
for j in range(M):
o_1, o_2 = map(int, input().split())
B[o_1-1].append(o_2-1)
B[o_2-1].append(o_1-1)
ans = 0
for node in range(N):
flag =1
for l in B[node]:
if O[node] <= O[l]:
flag = 0
if flag ==1... | [["-", 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 | 148 |
#include <cstdio>
using namespace std;
int n, m, a[100005], head[100005], cnt = 0;
struct Edge {
int to, nxt;
} e[200005];
void add_edge(int u, int v) {
e[++cnt].to = v;
e[cnt].nxt = head[u];
head[u] = cnt;
}
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i)
scanf("%d", &a[i]);
for (int... | #include <cstdio>
using namespace std;
int n, m, a[100005], head[100005], cnt = 0;
struct Edge {
int to, nxt;
} e[200005];
void add_edge(int u, int v) {
e[++cnt].to = v;
e[cnt].nxt = head[u];
head[u] = cnt;
}
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i)
scanf("%d", &a[i]);
for (int... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 264 |
n, m = map(int, input().split())
H = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
a, b = map(int, input().split())
if H[a-1]<H[b-1]:
ans[a-1] = 0
elif H[b-1]>H[a-1]:
ans[b-1] = 0
else:
ans[a-1], ans[b-1] = 0, 0
print(sum(ans))
| n, m = map(int, input().split())
H = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
a, b = map(int, input().split())
if H[a-1]<H[b-1]:
ans[a-1] = 0
elif H[b-1]<H[a-1]:
ans[b-1] = 0
else:
ans[a-1], ans[b-1] = 0, 0
print(sum(ans))
| [["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 18]] | 5 | 136 |
n,m=map(int,input())
h=list(map(int,input().split( )))
tall=[0]*n
for i in range(m):
a,b=map(int,input().split())
a-=1
b-=1
tall[a]=max(tall[a],h[b])
tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
if h[i]>tall[i]:
res+=1
print(res) | n,m=map(int,input().split())
h=list(map(int,input().split()))
tall=[0]*n
for i in range(m):
a,b=map(int,input().split())
a-=1
b-=1
tall[a]=max(tall[a],h[b])
tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
if h[i]>tall[i]:
res+=1
print(res) | [["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 129 |
#include <cmath>
#include <iostream>
using namespace std;
int a[100003], ch[100003];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
ch[i] = 1000000003;
}
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--;
y--;
ch[x] = min(ch[x], a[y]);
... | #include <cmath>
#include <iostream>
using namespace std;
int a[100003], ch[100003];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
ch[i] = 0;
}
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--;
y--;
ch[x] = max(ch[x], a[y]);
ch[y] =... | [["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 214 |
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> heights(N, 0);
for (int i = 0; i < N; i++) {
cin >> heights[i];
}
unordered_map<int, vector<int>> m;
vector<int> good(N, 0);
for (int i = 0; i < M; i++) {
int k,... | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> heights(N, 0);
for (int i = 0; i < N; i++) {
cin >> heights[i];
}
unordered_map<int, vector<int>> m;
vector<int> good(N, 0);
for (int i = 0; i < M; i++) {
int k,... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 258 |
def main():
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
good = [1] * N
for i in range(0, M, 1):
A, B = list(map(int, input().split()))
if H[A-1] == H[B-1]:
good[B-1] = 0
good[A-1] = 0
elif H[A-1] > H[B-1]:
good[B... | def main():
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
good = [1] * N
for i in range(0, M, 1):
A, B = list(map(int, input().split()))
if H[A-1] == H[B-1]:
good[B-1] = 0
good[A-1] = 0
elif H[A-1] > H[B-1]:
good[B... | [["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 198 |
N,M = map(int, input().split())
H = list(map(int,input().split()))
route = []
for i in range(N):
route.append([])
more_high = []
for i in range(N):
more_high.append([])
result = 0
for m in range(M):
a,b = map(int, input().split())
route[a-1].append(b-1)
route[b-1].append(a-1)
c = 0
f... | N,M = map(int, input().split())
H = list(map(int,input().split()))
route = []
for i in range(N):
route.append([])
more_high = []
for i in range(N):
more_high.append([])
result = 0
for m in range(M):
a,b = map(int, input().split())
route[a-1].append(b-1)
route[b-1].append(a-1)
c = 0
f... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 193 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
typedef pair<long, long> P;
int main() {
long n, m;
cin >> n >> m;
long temp;
vector<P> h;
rep(i, n) {
cin >> temp;
h.push_back(P(temp, 1));
// cout << h[i].first << endl;
}
v... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
typedef pair<long, long> P;
int main() {
long n, m;
cin >> n >> m;
long temp;
vector<P> h;
rep(i, n) {
cin >> temp;
h.push_back(P(temp, 1));
// cout << h[i].first << endl;
}
v... | [["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 240 |
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int h[100100];
vector<int> G[100100];
bool used[100100];
bool flag;
int Max;
int main(void) {
int i, j, s, t;
int n, m;
int ans = 0;
scanf("%d%d", &n, &m);
... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int h[100100];
vector<int> G[100100];
bool used[100100];
bool flag;
int Max;
int main(void) {
int i, j, s, t;
int n, m;
int ans = 0;
scanf("%d%d", &n, &m);
... | [["-", 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, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 250 |
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(M)
for i in range(M):
A, B = map(int, input().split())
if H[A-1] > H[B-1]:
yoi[B-1] = 0
elif H[B-1] > H[A-1]:
yoi[A-1] = 0
elif H[A-1]==H[B-1]:
yoi[A-1] = 0
yoi[B-1] = 0
... | import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(N)
for i in range(M):
A, B = map(int, input().split())
if H[A-1] > H[B-1]:
yoi[B-1] = 0
elif H[B-1] > H[A-1]:
yoi[A-1] = 0
elif H[A-1]==H[B-1]:
yoi[A-1] = 0
yoi[B-1] = 0
... | [["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]] | 5 | 158 |
n, m = (int(each) for each in input().split())
h = [int(each) for each in input().split()]
pathlist = list()
for i in range(m):
pathlist.append([int(each) for each in input().split()])
# print(pathlist)
score = 0
decklist = set(range(1, n+1))
for path in pathlist:
# もし道のうち前者が高ければ
if h[path[0]-1] >= h[path[... | n, m = (int(each) for each in input().split())
h = [int(each) for each in input().split()]
pathlist = list()
for i in range(m):
pathlist.append([int(each) for each in input().split()])
score = 0
decklist = set(range(1, n+1))
for path in pathlist:
# もし道のうち前者が高ければ
if h[path[0]-1] >= h[path[1]-1]:
# p... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 165 |
n,m=map(int,input().split())
h=input().split()
r=[]
for i in range(m):
r.append([])
r[i]=input().split()
a=[1]*n
for i in range(m):
if int(h[int(r[i][0])-1])>int(h[int(r[i][1])-1]):
a[int(r[i][1])-1]="0"
elif int(h[int(r[i][0])-1])<int(h[int(r[i][1])-1]):
a[int(r[i][0])-1]="0"
elif int(h[int(r[i][0])-1])==int(... | n,m=map(int,input().split())
h=input().split()
r=[]
for i in range(m):
r.append([])
r[i]=input().split()
a=[1]*n
for i in range(m):
if int(h[int(r[i][0])-1])>int(h[int(r[i][1])-1]):
a[int(r[i][1])-1]="0"
elif int(h[int(r[i][0])-1])<int(h[int(r[i][1])-1]):
a[int(r[i][0])-1]="0"
elif int(h[int(r[i][0])-1])==int(... | [["-", 0, 1, 0, 662, 12, 662, 31, 206, 51, 22], ["+", 0, 1, 0, 662, 12, 662, 31, 206, 51, 22]] | 5 | 276 |
N, M = map(int, input().split())
H = list(map(int, input().split()))
r = [1] * len(H)
a = []
for i in range(M):
A, B = map(int, input().split())
if H[A - 1] > H[B - 1]:
r[B - 1] = 0
if H[B - 1] > H[A - 1]:
r[A - 1] = 0
print(r.count(1))
| N, M = map(int, input().split())
H = list(map(int, input().split()))
r = [1] * len(H)
a = []
for i in range(M):
A, B = map(int, input().split())
if H[A - 1] >= H[B - 1]:
r[B - 1] = 0
if H[B - 1] >= H[A - 1]:
r[A - 1] = 0
print(r.count(1))
| [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 126 |
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = []
for _ in range(M):
AB.append(list(map(int, input().split())))
cnt = 0
new = [0 for i in range(N)]
for ab in AB:
if H[ab[0]-1] < H[ab[1]-1]:
new[ab[0]-1] += 1
if H[ab[0] - 1] > H[ab[1] - 1]:
new[ab[1]-1] += 1
print(n... | N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = []
for _ in range(M):
AB.append(list(map(int, input().split())))
cnt = 0
new = [0 for i in range(N)]
for ab in AB:
if H[ab[0]-1] <= H[ab[1]-1]:
new[ab[0]-1] += 1
if H[ab[0] - 1] >= H[ab[1] - 1]:
new[ab[1]-1] += 1
print... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 158 |
N,M=map(int,input().split())#M道の数,N展望台数
H=list(map(int,input().split()))
lists=[]
for i in range(M):
A,B=map(int,input().split())
list=[A,B]
lists.append([A,B])
list=[1]*N
for i in range(M-1):
if H[lists[i][0]-1]<H[lists[i][1]-1]:
list[lists[i][0]-1]=0
elif H[lists[i][0]-1]>H[lists[i][1]-1]:
list[list... | N,M=map(int,input().split())#M道の数,N展望台数
H=list(map(int,input().split()))
lists=[]
for i in range(M):
A,B=map(int,input().split())
list=[A,B]
lists.append([A,B])
list=[1]*N
for i in range(M):
if H[lists[i][0]-1]<H[lists[i][1]-1]:
list[lists[i][0]-1]=0
elif H[lists[i][0]-1]>H[lists[i][1]-1]:
list[lists[... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 229 |
from collections import defaultdict
N, M = map(int, input().split())
H = list(map(int, input().split()))
adj = defaultdict(set)
for i in range(M):
a, b = map(int, input().split())
adj[a-1].add(H[b-1])
adj[b-1].add(H[a-1])
ans = 0
for i in range(N):
adj[H[i]].add(-1)
if H[i] > max(adj[H[i]]):
... | from collections import defaultdict
N, M = map(int, input().split())
H = list(map(int, input().split()))
adj = defaultdict(set)
for i in range(M):
a, b = map(int, input().split())
adj[a-1].add(H[b-1])
adj[b-1].add(H[a-1])
ans = 0
for i in range(N):
adj[i].add(-1)
if H[i] > max(adj[i]):
ans +... | [["-", 0, 652, 63, 319, 500, 206, 206, 206, 51, 22], ["-", 0, 652, 63, 319, 500, 206, 206, 206, 0, 70], ["-", 0, 652, 63, 319, 500, 206, 206, 206, 0, 73], ["-", 15, 666, 0, 652, 3, 4, 0, 206, 0, 70], ["-", 0, 652, 3, 4, 0, 206, 206, 206, 51, 22], ["-", 0, 652, 3, 4, 0, 206, 206, 206, 0, 73]] | 5 | 147 |
n = list(map(int,input().split()))
m = list(map(int,input().split()))
a = []
kaku = []
for x in range(n[1]) :
a.append(list(map(int, input().split())))
kaku = [0]* len(m)
cou = 0
for x in range(n[1]):
if m[a[x][0] -1 ] > m[a[x][1] -1 ]:
kaku[a[x][0] -1 ] += 1
else:
kaku[a[x][0] - 1] -= 1
... | n = list(map(int,input().split()))
m = list(map(int,input().split()))
a = []
kaku = []
for x in range(n[1]) :
a.append(list(map(int, input().split())))
kaku = [0]* len(m)
cou = 0
for x in range(n[1]):
if m[a[x][0] -1 ] > m[a[x][1] -1 ]:
kaku[a[x][0] -1 ] += 1
else:
kaku[a[x][0] - 1] -= 10... | [["-", 75, 76, 8, 196, 0, 1, 0, 677, 12, 612], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 12, 612]] | 5 | 237 |
N,M = map(int, input().split())
H = list(map(int, input().split()))
loadJ = []
kekka = [True] * N
for i in range(M):
temp = list(map(int, input().split()))
loadJ.append(temp)
if H[temp[0] - 1] < H[temp[1] - 1]:
kekka[temp[0] - 1] = False
if H[temp[1] - 1] < H[temp[0] - 1]:
kekk... | N,M = map(int, input().split())
H = list(map(int, input().split()))
loadJ = []
kekka = [True] * N
for i in range(M):
temp = list(map(int, input().split()))
loadJ.append(temp)
if H[temp[0] - 1] <= H[temp[1] - 1]:
kekka[temp[0] - 1] = False
if H[temp[1] - 1] <= H[temp[0] - 1]:
ke... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 148 |
N, M = map(int,input().split())
H = [int(h) for h in input().split()]
A = [0] * M
B = [0] * M
for i in range(M):
A[i], B[i] = map(int, input().split())
count = ['good'] * N
for i in range(M):
if H[A[i] - 1] < H[B[i] - 1]:
count[A[i] - 1] = 'bad'
elif H[A[i] - 1] < H[B[i] - 1]:
count[B[i] - 1] = 'bad'
... | N, M = map(int,input().split())
H = [int(h) for h in input().split()]
A = [0] * M
B = [0] * M
for i in range(M):
A[i], B[i] = map(int, input().split())
count = ['good'] * N
for i in range(M):
if H[A[i] - 1] < H[B[i] - 1]:
count[A[i] - 1] = 'bad'
elif H[A[i] - 1] > H[B[i] - 1]:
count[B[i] - 1] = 'bad' ... | [["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 18], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47]] | 5 | 221 |
// Peaks
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> height(N);
vector<bool> vec(N, true);
for (int i = 0; i < N; i++) {
int temp;
cin >> temp;
height[i] = temp;
}
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
... | // Peaks
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> height(N);
vector<bool> vec(N, true);
for (int i = 0; i < N; i++) {
int temp;
cin >> temp;
height[i] = temp;
}
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 147], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 146]] | 1 | 203 |
n, m = map(int, input().split())
h = [int(i) for i in input().split()]
load = [list(map(int, input().split())) for _ in range(m)]
result = {i: 1 for i in range(n)}
for l in load:
a, b = l[0] - 1, l[1] - 1
if h[a] < h[b]:
result[a] = 0
elif h[a] > h[b]:
result[b] = 0
elif h[a] == h[b]:
... | n, m = map(int, input().split())
h = [int(i) for i in input().split()]
load = [list(map(int, input().split())) for _ in range(m)]
result = {i: 1 for i in range(n)}
for l in load:
a, b = l[0] - 1, l[1] - 1
if h[a] < h[b]:
result[a] = 0
elif h[a] > h[b]:
result[b] = 0
elif h[a] == h[b]:
... | [["-", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612]] | 5 | 164 |
n = [int(e) for e in input().split(" ")]
d = []
c = 0
for e in input().split(" "):
d.append([(int(e)), []])
for _ in range(n[1]):
x = [int(e) - 1 for e in input().split(" ")]
d[x[0]][1].append(d[x[1]][0])
d[x[1]][1].append(x[0])
for e_d in d:
try:
m = max(e_d[1])
except:
m = -1
... | n = [int(e) for e in input().split(" ")]
d = []
c = 0
for e in input().split(" "):
d.append([(int(e)), []])
for _ in range(n[1]):
x = [int(e) - 1 for e in input().split(" ")]
d[x[0]][1].append(d[x[1]][0])
d[x[1]][1].append(d[x[0]][0])
for e_d in d:
try:
m = max(e_d[1])
except:
m ... | [["+", 0, 652, 3, 4, 0, 206, 51, 206, 51, 22], ["+", 0, 652, 3, 4, 0, 206, 51, 206, 0, 70], ["+", 3, 4, 0, 206, 51, 206, 206, 206, 0, 70], ["+", 3, 4, 0, 206, 51, 206, 206, 206, 206, 612], ["+", 3, 4, 0, 206, 51, 206, 206, 206, 0, 73], ["+", 0, 652, 3, 4, 0, 206, 51, 206, 0, 73]] | 5 | 173 |
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int N, M, a, b;
vector<int> ma(M, 0), h(M, 0);
cin >> N >> M;
for (int i = 1; i <= N; i++) {
cin >> h[i];
}
for (int i = 0; i < M; i++) {
cin >> a >> b;
ma[a] = max(ma[a], h[b]);
m... | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int N, M, a, b;
vector<int> ma(1000000, 0), h(1000000, 0);
cin >> N >> M;
for (int i = 1; i <= N; i++) {
cin >> h[i];
}
for (int i = 0; i < M; i++) {
cin >> a >> b;
ma[a] = max(ma[a], ... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 178 |
n,m = map(int,input().split())
h = list(map(int,input().split()))
d = [[] for i in range(n)]
for i in range(m):
a,b = map(int,input().split())
a,b = a-1,b-1
d[a].append(b)
d[b].append(a)
cnt = 0
for i in range(n):
H = h[i]
max1 = 0
for j in d[i]:
max1 = max(max1,h[j])
if max1 > ... | n,m = map(int,input().split())
h = list(map(int,input().split()))
d = [[] for i in range(n)]
for i in range(m):
a,b = map(int,input().split())
a,b = a-1,b-1
d[a].append(b)
d[b].append(a)
cnt = 0
for i in range(n):
H = h[i]
max1 = 0
for j in d[i]:
max1 = max(max1,h[j])
if H > max... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]] | 5 | 150 |
N, M = map(int, input().split())
H = list(map(int, input().split()))
good_H = [1] * N
for i in range(M):
A, B = map(int, input().split())
if H[A-1] < H[B-1]:
good_H[A-1] = 0
elif H[A-1] > H[B-1]:
good_H[B-1] = 0
print(good_H.count(1)) | N, M = map(int, input().split())
H = list(map(int, input().split()))
good_H = [1] * N
for i in range(M):
A, B = map(int, input().split())
if H[A-1] <= H[B-1]:
good_H[A-1] = 0
if H[A-1] >= H[B-1]:
good_H[B-1] = 0
print(good_H.count(1)) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 119 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, m, h[200010], ma[200010];
cin >> n >> m;
for (int i = 1; i <= n; i++) {
ll height;
cin >> height;
h[i] = height;
ma[i] = 0;
}
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
ma[a] = max(m... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, m, h[200010], ma[200010];
cin >> n >> m;
for (int i = 1; i <= n; i++) {
ll height;
cin >> height;
h[i] = height;
ma[i] = 0;
}
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
ma[a] = max(m... | [["-", 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]] | 1 | 183 |
n,m = map(int,input().split())
h = list(map(int,input().split()))
a = b = [0]*m
for i in range(m):
a[i],b[i] = map(int,input().split())
sw = [1]*n
for i in range(m):
if h[a[i]-1] > h[b[i]-1]:
sw[b[i]-1] = 0
elif h[a[i]-1] < h[b[i]-1]:
sw[a[i]-1] = 0
else:
sw[a[i]-1] = 0
s... | n,m = map(int,input().split())
h = list(map(int,input().split()))
a = [0]*m
b = [0]*m
for i in range(m):
a[i],b[i] = map(int,input().split())
sw = [1]*n
for i in range(m):
if h[a[i]-1] > h[b[i]-1]:
sw[b[i]-1] = 0
elif h[a[i]-1] < h[b[i]-1]:
sw[a[i]-1] = 0
else:
sw[a[i]-1] = 0
... | [["+", 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], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 184 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int h[N], a, b, ma[N];
int main() {
int n, m, res = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d", &h[i]);
for (int i = 1; i <= m; i++) {
scanf("%d%d", &a, &b);
ma[a] = max(ma[a], h[b]);
ma[b] = max(ma[b], ... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int h[N], a, b, ma[N];
int main() {
int n, m, res = 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d", &h[i]);
for (int i = 1; i <= m; i++) {
scanf("%d%d", &a, &b);
ma[a] = max(ma[a], h[b]);
ma[b] = max(ma[b], ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 192 |
n,m = map(int,input().split())
h = [int(x) for x in input().split()]
a = [0] * m
b = [0] * m
for i in range(m):
a[i],b[i] = map(int,input().split())
ind = []
for i in range(m):
if h[a[i]-1] < h[b[i]-1]:
ind.append(a[i])
elif h[a[i]-1] == h[b[i]-1]:
ind.append(a[i])
ind.append(b[i])
... | n,m = map(int,input().split())
h = [int(x) for x in input().split()]
a = [0] * m
b = [0] * m
for i in range(m):
a[i],b[i] = map(int,input().split())
ind = []
for i in range(m):
if h[a[i]-1] < h[b[i]-1]:
ind.append(a[i])
elif h[a[i]-1] == h[b[i]-1]:
ind.append(a[i])
ind.append(b[i])
... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 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, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 222 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
for (auto &&e : h) {
cin >> e;
}
vector<bool> f(n, true);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
if (h[a] <= h[b]) {
f[a] = false;
}
if (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
for (auto &&e : h) {
cin >> e;
}
vector<bool> f(n, true);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
if (h[a] <= h[b]) {
f[a] = false;
}
if (... | [["-", 51, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 51, 2, 3, 4, 0, 2, 3, 4, 0, 22]] | 1 | 166 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
for (auto &&e : h) {
cin >> e;
}
vector<bool> f(n, true);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
if (h[a] <= h[b]) {
f[a] = false;
}
if (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> h(n);
for (auto &&e : h) {
cin >> e;
}
vector<bool> f(n, true);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
if (h[a] <= h[b]) {
f[a] = false;
}
if (... | [["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22]] | 1 | 162 |
N, M = map(int, input().split())
H = list(map(int, input().split()))
C = [1]*(N)
for i in range(M):
a, b = map(int, input().split())
if H[a-1] >= H[b-1]:
H[b-1] = 0
if H[b-1] >= H[a-1]:
H[a-1] = 0
print(sum(C)) | N, M = map(int, input().split())
H = list(map(int, input().split()))
C = [1]*(N)
for i in range(M):
a, b = map(int, input().split())
if H[a-1] >= H[b-1]:
C[b-1] = 0
if H[b-1] >= H[a-1]:
C[a-1] = 0
print(sum(C)) | [["-", 64, 196, 0, 1, 0, 662, 31, 206, 51, 22], ["+", 64, 196, 0, 1, 0, 662, 31, 206, 51, 22]] | 5 | 119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.