#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
int n, x, y, ch[202020], ans;
ll k, need[202020], dis[202020];
vector< pair<int, ll> > adj[202020];
priority_queue<pll> pq;
int L, midp;
vector< pair<int, ll> > path;
void find_path(int v) {
for (int i = 0; i < adj[v].size(); i++) {
if (path.back().first == y) return;
int u = adj[v][i].first; ll w = adj[v][i].second;
if (ch[u] == 1) continue;
ch[u] = 1;
path.push_back({u, w});
find_path(u);
if (path.back().first != y) path.pop_back();
}
}
int not_intersect() {
int cnt = 0;
for (int i = 0; i < n; i++) ch[i] = 0;
while (!pq.empty()) pq.pop();
pq.push({-0, x});
pq.push({-0, y});
while (!pq.empty()) {
int v = pq.top().second; ll w = -pq.top().first;
pq.pop();
if (k - w >= 0) {
cnt++;
k -= w;
}
else break;
ch[v] = 1;
for (int i = 0; i < (int)adj[v].size(); i++) {
if (ch[adj[v][i].first] == 1) continue;
if (v == path[midp - 1].first && adj[v][i].first == path[midp].first) continue;
if (v == path[midp].first && adj[v][i].first == path[midp - 1].first) continue;
pq.push({-w-adj[v][i].second, adj[v][i].first});
}
}
return cnt;
}
vector<pll> ab;
vector<ll> over, below;
bool compare(pll p, pll q) {
if (p.second == q.second) return p.first < q.first;
return p.second < q.second;
}
void DFS(int v, ll a, ll b) {
for (int i = 0; i < adj[v].size(); i++) {
int u = adj[v][i].first; ll w = adj[v][i].second;
if (ch[u] == 1) continue;
ch[u] = 1;
ab.push_back({a + w, b + w});
DFS(u, a + w, b + w);
}
}
int intersect() {
int cnt = 0;
ab.clear();
over.clear();
below.clear();
for (int i = 0; i < n; i++) ch[i] = 0;
for (int i = 0; i <= L; i++) ch[path[i].first] = 1;
for (int i = 0; i < midp; i++) need[i] = dis[i] - dis[0];
for (int i = midp; i <= L; i++) need[i] = dis[L] - dis[i];
for (int i = 1; i <= L; i++) k -= need[i];
if (k < 0) return 0;
for (int i = 0; i < midp; i++) {
ab.push_back({dis[L] - dis[i] - need[i], 2e18});
ll a = dis[i] - dis[0];
ll b = dis[L] - dis[i];
DFS(path[i].first, a, b);
}
for (int i = midp; i <= L; i++) {
ab.push_back({dis[i] - dis[0] - need[i], 2e18});
ll a = dis[L] - dis[i];
ll b = dis[i] - dis[0];
DFS(path[i].first, a, b);
}
over.push_back(0);
for (int i = 0; i < ab.size(); i++) {
if (ab[i].first * 2 <= ab[i].second) {
over.push_back(ab[i].first);
if (ab[i].second <= 1e18) over.push_back(ab[i].second - ab[i].first);
}
}
sort(over.begin(), over.end());
for (int i = 0; i < over.size(); i++) {
if (i >= 1) over[i] += over[i - 1];
}
ll diff = 0;
below.push_back(0);
sort(ab.begin(), ab.end(), compare);
for (int i = 0; i < ab.size(); i++) {
if (ab[i].first * 2 > ab[i].second) {
ll t = below.back() + ab[i].second;
diff = max(diff, ab[i].second - ab[i].first);
below.push_back(t - diff);
below.push_back(t);
}
}
sort(below.begin(), below.end());
for (int i = 0; i < over.size(); i++) {
if (k - over[i] < 0) break;
int idx = upper_bound(below.begin(), below.end(), k - over[i]) - below.begin() - 1;
cnt = max(cnt, i + idx);
}
return cnt + L + 1;
}
int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) {
n = N, x = X, y = Y, k = K;
ans = 0;
for (int i = 0; i < n; i++) adj[i].clear();
path.clear();
for (int i = 0; i < (int)U.size(); i++) {
adj[U[i]].push_back({V[i], W[i]});
adj[V[i]].push_back({U[i], W[i]});
}
for (int i = 0; i < n; i++) ch[i] = 0;
path.push_back({x, 0});
ch[x] = 1;
find_path(x);
assert(path.back().first == y);
L = path.size() - 1;
for (int i = 1; i <= L; i++) dis[i] = dis[i - 1] + path[i].second;
for (int i = 0; i <= L; i++) {
if (dis[i] - dis[0] > dis[L] - dis[i]) {
midp = i;
break;
}
}
k = K;
ans = not_intersect();
k = K;
ans = max(ans, intersect());
return ans;
}
Compilation message
closing.cpp: In function 'void find_path(int)':
closing.cpp:15:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
15 | for (int i = 0; i < adj[v].size(); i++) {
| ~~^~~~~~~~~~~~~~~
closing.cpp: In function 'void DFS(int, ll, ll)':
closing.cpp:62:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
62 | for (int i = 0; i < adj[v].size(); i++) {
| ~~^~~~~~~~~~~~~~~
closing.cpp: In function 'int intersect()':
closing.cpp:99:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int>, std::allocator<std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
99 | for (int i = 0; i < ab.size(); i++) {
| ~~^~~~~~~~~~~
closing.cpp:106:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
106 | for (int i = 0; i < over.size(); i++) {
| ~~^~~~~~~~~~~~~
closing.cpp:113:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int>, std::allocator<std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
113 | for (int i = 0; i < ab.size(); i++) {
| ~~^~~~~~~~~~~
closing.cpp:122:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
122 | for (int i = 0; i < over.size(); i++) {
| ~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
87 ms |
30412 KB |
Output is correct |
2 |
Correct |
105 ms |
38600 KB |
Output is correct |
3 |
Correct |
46 ms |
11344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8796 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
1 ms |
8796 KB |
Output is correct |
11 |
Correct |
2 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8796 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
1 ms |
8796 KB |
Output is correct |
11 |
Correct |
2 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8824 KB |
Output is correct |
15 |
Correct |
2 ms |
8796 KB |
Output is correct |
16 |
Correct |
1 ms |
8796 KB |
Output is correct |
17 |
Correct |
2 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8792 KB |
Output is correct |
23 |
Correct |
2 ms |
8796 KB |
Output is correct |
24 |
Correct |
3 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8796 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
1 ms |
8796 KB |
Output is correct |
11 |
Correct |
2 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8824 KB |
Output is correct |
15 |
Correct |
2 ms |
8796 KB |
Output is correct |
16 |
Correct |
1 ms |
8796 KB |
Output is correct |
17 |
Correct |
2 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8792 KB |
Output is correct |
23 |
Correct |
2 ms |
8796 KB |
Output is correct |
24 |
Correct |
3 ms |
8796 KB |
Output is correct |
25 |
Correct |
3 ms |
8796 KB |
Output is correct |
26 |
Correct |
4 ms |
9408 KB |
Output is correct |
27 |
Correct |
3 ms |
9308 KB |
Output is correct |
28 |
Correct |
3 ms |
9308 KB |
Output is correct |
29 |
Correct |
4 ms |
9308 KB |
Output is correct |
30 |
Correct |
3 ms |
9052 KB |
Output is correct |
31 |
Correct |
3 ms |
9308 KB |
Output is correct |
32 |
Correct |
3 ms |
9144 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
1 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
2 ms |
8796 KB |
Output is correct |
11 |
Correct |
2 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8796 KB |
Output is correct |
15 |
Correct |
2 ms |
8796 KB |
Output is correct |
16 |
Correct |
1 ms |
8796 KB |
Output is correct |
17 |
Correct |
2 ms |
8796 KB |
Output is correct |
18 |
Correct |
1 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8796 KB |
Output is correct |
23 |
Correct |
1 ms |
8796 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
2 ms |
8796 KB |
Output is correct |
11 |
Correct |
1 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8796 KB |
Output is correct |
15 |
Correct |
2 ms |
8824 KB |
Output is correct |
16 |
Correct |
2 ms |
8796 KB |
Output is correct |
17 |
Correct |
1 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
1 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8796 KB |
Output is correct |
23 |
Correct |
2 ms |
8796 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
25 |
Correct |
2 ms |
8796 KB |
Output is correct |
26 |
Correct |
2 ms |
8796 KB |
Output is correct |
27 |
Correct |
2 ms |
8796 KB |
Output is correct |
28 |
Correct |
1 ms |
8796 KB |
Output is correct |
29 |
Correct |
2 ms |
8796 KB |
Output is correct |
30 |
Correct |
1 ms |
8796 KB |
Output is correct |
31 |
Correct |
2 ms |
8796 KB |
Output is correct |
32 |
Correct |
2 ms |
8796 KB |
Output is correct |
33 |
Correct |
2 ms |
8796 KB |
Output is correct |
34 |
Correct |
2 ms |
8796 KB |
Output is correct |
35 |
Correct |
1 ms |
8796 KB |
Output is correct |
36 |
Correct |
2 ms |
8796 KB |
Output is correct |
37 |
Correct |
2 ms |
8796 KB |
Output is correct |
38 |
Correct |
2 ms |
8796 KB |
Output is correct |
39 |
Correct |
2 ms |
8796 KB |
Output is correct |
40 |
Correct |
2 ms |
8792 KB |
Output is correct |
41 |
Correct |
2 ms |
8796 KB |
Output is correct |
42 |
Correct |
2 ms |
8796 KB |
Output is correct |
43 |
Correct |
2 ms |
8796 KB |
Output is correct |
44 |
Correct |
2 ms |
9052 KB |
Output is correct |
45 |
Correct |
1 ms |
8792 KB |
Output is correct |
46 |
Correct |
2 ms |
8796 KB |
Output is correct |
47 |
Correct |
2 ms |
8796 KB |
Output is correct |
48 |
Correct |
2 ms |
8796 KB |
Output is correct |
49 |
Correct |
2 ms |
8796 KB |
Output is correct |
50 |
Correct |
2 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
2 ms |
8796 KB |
Output is correct |
11 |
Correct |
1 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8796 KB |
Output is correct |
15 |
Correct |
2 ms |
8824 KB |
Output is correct |
16 |
Correct |
2 ms |
8796 KB |
Output is correct |
17 |
Correct |
1 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8796 KB |
Output is correct |
23 |
Correct |
2 ms |
8792 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
25 |
Correct |
3 ms |
8796 KB |
Output is correct |
26 |
Correct |
1 ms |
8796 KB |
Output is correct |
27 |
Correct |
2 ms |
8796 KB |
Output is correct |
28 |
Correct |
2 ms |
8796 KB |
Output is correct |
29 |
Correct |
2 ms |
8796 KB |
Output is correct |
30 |
Correct |
2 ms |
8796 KB |
Output is correct |
31 |
Correct |
2 ms |
8796 KB |
Output is correct |
32 |
Correct |
2 ms |
8796 KB |
Output is correct |
33 |
Correct |
2 ms |
8796 KB |
Output is correct |
34 |
Correct |
2 ms |
8796 KB |
Output is correct |
35 |
Correct |
1 ms |
8796 KB |
Output is correct |
36 |
Correct |
2 ms |
8796 KB |
Output is correct |
37 |
Correct |
1 ms |
8796 KB |
Output is correct |
38 |
Correct |
2 ms |
8796 KB |
Output is correct |
39 |
Correct |
2 ms |
8796 KB |
Output is correct |
40 |
Correct |
2 ms |
8796 KB |
Output is correct |
41 |
Correct |
2 ms |
8796 KB |
Output is correct |
42 |
Correct |
1 ms |
8796 KB |
Output is correct |
43 |
Correct |
2 ms |
8796 KB |
Output is correct |
44 |
Correct |
2 ms |
8796 KB |
Output is correct |
45 |
Correct |
2 ms |
8796 KB |
Output is correct |
46 |
Correct |
2 ms |
8796 KB |
Output is correct |
47 |
Correct |
2 ms |
8792 KB |
Output is correct |
48 |
Correct |
2 ms |
8796 KB |
Output is correct |
49 |
Correct |
2 ms |
8796 KB |
Output is correct |
50 |
Correct |
2 ms |
8796 KB |
Output is correct |
51 |
Correct |
2 ms |
9052 KB |
Output is correct |
52 |
Correct |
1 ms |
8792 KB |
Output is correct |
53 |
Correct |
2 ms |
8796 KB |
Output is correct |
54 |
Correct |
2 ms |
8796 KB |
Output is correct |
55 |
Correct |
2 ms |
8796 KB |
Output is correct |
56 |
Correct |
2 ms |
8796 KB |
Output is correct |
57 |
Correct |
2 ms |
8796 KB |
Output is correct |
58 |
Correct |
3 ms |
8796 KB |
Output is correct |
59 |
Correct |
2 ms |
8792 KB |
Output is correct |
60 |
Correct |
2 ms |
8796 KB |
Output is correct |
61 |
Correct |
2 ms |
8796 KB |
Output is correct |
62 |
Correct |
2 ms |
8796 KB |
Output is correct |
63 |
Correct |
2 ms |
8796 KB |
Output is correct |
64 |
Correct |
2 ms |
8796 KB |
Output is correct |
65 |
Correct |
2 ms |
8816 KB |
Output is correct |
66 |
Correct |
2 ms |
8796 KB |
Output is correct |
67 |
Correct |
2 ms |
8796 KB |
Output is correct |
68 |
Correct |
2 ms |
8816 KB |
Output is correct |
69 |
Correct |
3 ms |
9068 KB |
Output is correct |
70 |
Correct |
2 ms |
8796 KB |
Output is correct |
71 |
Correct |
2 ms |
8816 KB |
Output is correct |
72 |
Correct |
2 ms |
8796 KB |
Output is correct |
73 |
Correct |
2 ms |
8796 KB |
Output is correct |
74 |
Correct |
2 ms |
8796 KB |
Output is correct |
75 |
Correct |
2 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
2 ms |
8796 KB |
Output is correct |
11 |
Correct |
1 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8796 KB |
Output is correct |
15 |
Correct |
2 ms |
8824 KB |
Output is correct |
16 |
Correct |
2 ms |
8796 KB |
Output is correct |
17 |
Correct |
1 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8796 KB |
Output is correct |
23 |
Correct |
2 ms |
8792 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
25 |
Correct |
3 ms |
8796 KB |
Output is correct |
26 |
Correct |
3 ms |
8796 KB |
Output is correct |
27 |
Correct |
4 ms |
9408 KB |
Output is correct |
28 |
Correct |
3 ms |
9308 KB |
Output is correct |
29 |
Correct |
3 ms |
9308 KB |
Output is correct |
30 |
Correct |
4 ms |
9308 KB |
Output is correct |
31 |
Correct |
3 ms |
9052 KB |
Output is correct |
32 |
Correct |
3 ms |
9308 KB |
Output is correct |
33 |
Correct |
3 ms |
9144 KB |
Output is correct |
34 |
Correct |
1 ms |
8796 KB |
Output is correct |
35 |
Correct |
2 ms |
8796 KB |
Output is correct |
36 |
Correct |
2 ms |
8796 KB |
Output is correct |
37 |
Correct |
2 ms |
8796 KB |
Output is correct |
38 |
Correct |
2 ms |
8796 KB |
Output is correct |
39 |
Correct |
2 ms |
8796 KB |
Output is correct |
40 |
Correct |
2 ms |
8796 KB |
Output is correct |
41 |
Correct |
2 ms |
8796 KB |
Output is correct |
42 |
Correct |
2 ms |
8796 KB |
Output is correct |
43 |
Correct |
1 ms |
8796 KB |
Output is correct |
44 |
Correct |
2 ms |
8796 KB |
Output is correct |
45 |
Correct |
1 ms |
8796 KB |
Output is correct |
46 |
Correct |
2 ms |
8796 KB |
Output is correct |
47 |
Correct |
2 ms |
8796 KB |
Output is correct |
48 |
Correct |
2 ms |
8796 KB |
Output is correct |
49 |
Correct |
2 ms |
8796 KB |
Output is correct |
50 |
Correct |
1 ms |
8796 KB |
Output is correct |
51 |
Correct |
2 ms |
8796 KB |
Output is correct |
52 |
Correct |
2 ms |
8796 KB |
Output is correct |
53 |
Correct |
2 ms |
8796 KB |
Output is correct |
54 |
Correct |
2 ms |
8796 KB |
Output is correct |
55 |
Correct |
2 ms |
8792 KB |
Output is correct |
56 |
Correct |
2 ms |
8796 KB |
Output is correct |
57 |
Correct |
2 ms |
8796 KB |
Output is correct |
58 |
Correct |
2 ms |
8796 KB |
Output is correct |
59 |
Correct |
2 ms |
9052 KB |
Output is correct |
60 |
Correct |
1 ms |
8792 KB |
Output is correct |
61 |
Correct |
2 ms |
8796 KB |
Output is correct |
62 |
Correct |
2 ms |
8796 KB |
Output is correct |
63 |
Correct |
2 ms |
8796 KB |
Output is correct |
64 |
Correct |
2 ms |
8796 KB |
Output is correct |
65 |
Correct |
2 ms |
8796 KB |
Output is correct |
66 |
Correct |
3 ms |
8796 KB |
Output is correct |
67 |
Correct |
2 ms |
8792 KB |
Output is correct |
68 |
Correct |
2 ms |
8796 KB |
Output is correct |
69 |
Correct |
2 ms |
8796 KB |
Output is correct |
70 |
Correct |
2 ms |
8796 KB |
Output is correct |
71 |
Correct |
2 ms |
8796 KB |
Output is correct |
72 |
Correct |
2 ms |
8796 KB |
Output is correct |
73 |
Correct |
2 ms |
8816 KB |
Output is correct |
74 |
Correct |
2 ms |
8796 KB |
Output is correct |
75 |
Correct |
2 ms |
8796 KB |
Output is correct |
76 |
Correct |
2 ms |
8816 KB |
Output is correct |
77 |
Correct |
3 ms |
9068 KB |
Output is correct |
78 |
Correct |
2 ms |
8796 KB |
Output is correct |
79 |
Correct |
2 ms |
8816 KB |
Output is correct |
80 |
Correct |
2 ms |
8796 KB |
Output is correct |
81 |
Correct |
2 ms |
8796 KB |
Output is correct |
82 |
Correct |
2 ms |
8796 KB |
Output is correct |
83 |
Correct |
2 ms |
8796 KB |
Output is correct |
84 |
Correct |
3 ms |
8796 KB |
Output is correct |
85 |
Correct |
3 ms |
8824 KB |
Output is correct |
86 |
Correct |
3 ms |
8796 KB |
Output is correct |
87 |
Correct |
3 ms |
8796 KB |
Output is correct |
88 |
Correct |
3 ms |
8796 KB |
Output is correct |
89 |
Correct |
3 ms |
9084 KB |
Output is correct |
90 |
Correct |
3 ms |
9052 KB |
Output is correct |
91 |
Correct |
3 ms |
9052 KB |
Output is correct |
92 |
Correct |
3 ms |
9052 KB |
Output is correct |
93 |
Correct |
3 ms |
9052 KB |
Output is correct |
94 |
Correct |
3 ms |
9304 KB |
Output is correct |
95 |
Correct |
3 ms |
9308 KB |
Output is correct |
96 |
Correct |
3 ms |
9048 KB |
Output is correct |
97 |
Correct |
4 ms |
9052 KB |
Output is correct |
98 |
Correct |
3 ms |
9164 KB |
Output is correct |
99 |
Correct |
4 ms |
9052 KB |
Output is correct |
100 |
Correct |
3 ms |
9124 KB |
Output is correct |
101 |
Correct |
3 ms |
8824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8792 KB |
Output is correct |
2 |
Correct |
2 ms |
8796 KB |
Output is correct |
3 |
Correct |
2 ms |
8796 KB |
Output is correct |
4 |
Correct |
2 ms |
8796 KB |
Output is correct |
5 |
Correct |
2 ms |
8796 KB |
Output is correct |
6 |
Correct |
2 ms |
8796 KB |
Output is correct |
7 |
Correct |
2 ms |
8796 KB |
Output is correct |
8 |
Correct |
2 ms |
8796 KB |
Output is correct |
9 |
Correct |
2 ms |
8796 KB |
Output is correct |
10 |
Correct |
2 ms |
8796 KB |
Output is correct |
11 |
Correct |
1 ms |
8796 KB |
Output is correct |
12 |
Correct |
2 ms |
8796 KB |
Output is correct |
13 |
Correct |
2 ms |
8796 KB |
Output is correct |
14 |
Correct |
2 ms |
8796 KB |
Output is correct |
15 |
Correct |
2 ms |
8824 KB |
Output is correct |
16 |
Correct |
2 ms |
8796 KB |
Output is correct |
17 |
Correct |
1 ms |
8796 KB |
Output is correct |
18 |
Correct |
2 ms |
8796 KB |
Output is correct |
19 |
Correct |
2 ms |
8796 KB |
Output is correct |
20 |
Correct |
2 ms |
8796 KB |
Output is correct |
21 |
Correct |
2 ms |
8796 KB |
Output is correct |
22 |
Correct |
2 ms |
8796 KB |
Output is correct |
23 |
Correct |
2 ms |
8792 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
25 |
Correct |
3 ms |
8796 KB |
Output is correct |
26 |
Correct |
3 ms |
8796 KB |
Output is correct |
27 |
Correct |
4 ms |
9408 KB |
Output is correct |
28 |
Correct |
3 ms |
9308 KB |
Output is correct |
29 |
Correct |
3 ms |
9308 KB |
Output is correct |
30 |
Correct |
4 ms |
9308 KB |
Output is correct |
31 |
Correct |
3 ms |
9052 KB |
Output is correct |
32 |
Correct |
3 ms |
9308 KB |
Output is correct |
33 |
Correct |
3 ms |
9144 KB |
Output is correct |
34 |
Correct |
1 ms |
8796 KB |
Output is correct |
35 |
Correct |
2 ms |
8796 KB |
Output is correct |
36 |
Correct |
2 ms |
8796 KB |
Output is correct |
37 |
Correct |
2 ms |
8796 KB |
Output is correct |
38 |
Correct |
2 ms |
8796 KB |
Output is correct |
39 |
Correct |
2 ms |
8796 KB |
Output is correct |
40 |
Correct |
2 ms |
8796 KB |
Output is correct |
41 |
Correct |
2 ms |
8796 KB |
Output is correct |
42 |
Correct |
2 ms |
8796 KB |
Output is correct |
43 |
Correct |
1 ms |
8796 KB |
Output is correct |
44 |
Correct |
2 ms |
8796 KB |
Output is correct |
45 |
Correct |
1 ms |
8796 KB |
Output is correct |
46 |
Correct |
2 ms |
8796 KB |
Output is correct |
47 |
Correct |
2 ms |
8796 KB |
Output is correct |
48 |
Correct |
2 ms |
8796 KB |
Output is correct |
49 |
Correct |
2 ms |
8796 KB |
Output is correct |
50 |
Correct |
1 ms |
8796 KB |
Output is correct |
51 |
Correct |
2 ms |
8796 KB |
Output is correct |
52 |
Correct |
2 ms |
8796 KB |
Output is correct |
53 |
Correct |
2 ms |
8796 KB |
Output is correct |
54 |
Correct |
2 ms |
8796 KB |
Output is correct |
55 |
Correct |
2 ms |
8792 KB |
Output is correct |
56 |
Correct |
2 ms |
8796 KB |
Output is correct |
57 |
Correct |
2 ms |
8796 KB |
Output is correct |
58 |
Correct |
2 ms |
8796 KB |
Output is correct |
59 |
Correct |
2 ms |
9052 KB |
Output is correct |
60 |
Correct |
1 ms |
8792 KB |
Output is correct |
61 |
Correct |
2 ms |
8796 KB |
Output is correct |
62 |
Correct |
2 ms |
8796 KB |
Output is correct |
63 |
Correct |
2 ms |
8796 KB |
Output is correct |
64 |
Correct |
2 ms |
8796 KB |
Output is correct |
65 |
Correct |
2 ms |
8796 KB |
Output is correct |
66 |
Correct |
3 ms |
8796 KB |
Output is correct |
67 |
Correct |
2 ms |
8792 KB |
Output is correct |
68 |
Correct |
2 ms |
8796 KB |
Output is correct |
69 |
Correct |
2 ms |
8796 KB |
Output is correct |
70 |
Correct |
2 ms |
8796 KB |
Output is correct |
71 |
Correct |
2 ms |
8796 KB |
Output is correct |
72 |
Correct |
2 ms |
8796 KB |
Output is correct |
73 |
Correct |
2 ms |
8816 KB |
Output is correct |
74 |
Correct |
2 ms |
8796 KB |
Output is correct |
75 |
Correct |
2 ms |
8796 KB |
Output is correct |
76 |
Correct |
2 ms |
8816 KB |
Output is correct |
77 |
Correct |
3 ms |
9068 KB |
Output is correct |
78 |
Correct |
2 ms |
8796 KB |
Output is correct |
79 |
Correct |
2 ms |
8816 KB |
Output is correct |
80 |
Correct |
2 ms |
8796 KB |
Output is correct |
81 |
Correct |
2 ms |
8796 KB |
Output is correct |
82 |
Correct |
2 ms |
8796 KB |
Output is correct |
83 |
Correct |
2 ms |
8796 KB |
Output is correct |
84 |
Correct |
3 ms |
8796 KB |
Output is correct |
85 |
Correct |
3 ms |
8824 KB |
Output is correct |
86 |
Correct |
3 ms |
8796 KB |
Output is correct |
87 |
Correct |
3 ms |
8796 KB |
Output is correct |
88 |
Correct |
3 ms |
8796 KB |
Output is correct |
89 |
Correct |
3 ms |
9084 KB |
Output is correct |
90 |
Correct |
3 ms |
9052 KB |
Output is correct |
91 |
Correct |
3 ms |
9052 KB |
Output is correct |
92 |
Correct |
3 ms |
9052 KB |
Output is correct |
93 |
Correct |
3 ms |
9052 KB |
Output is correct |
94 |
Correct |
3 ms |
9304 KB |
Output is correct |
95 |
Correct |
3 ms |
9308 KB |
Output is correct |
96 |
Correct |
3 ms |
9048 KB |
Output is correct |
97 |
Correct |
4 ms |
9052 KB |
Output is correct |
98 |
Correct |
3 ms |
9164 KB |
Output is correct |
99 |
Correct |
4 ms |
9052 KB |
Output is correct |
100 |
Correct |
3 ms |
9124 KB |
Output is correct |
101 |
Correct |
3 ms |
8824 KB |
Output is correct |
102 |
Correct |
75 ms |
12628 KB |
Output is correct |
103 |
Correct |
90 ms |
12580 KB |
Output is correct |
104 |
Correct |
155 ms |
42720 KB |
Output is correct |
105 |
Correct |
84 ms |
12948 KB |
Output is correct |
106 |
Correct |
84 ms |
12116 KB |
Output is correct |
107 |
Correct |
86 ms |
35516 KB |
Output is correct |
108 |
Correct |
91 ms |
38588 KB |
Output is correct |
109 |
Correct |
64 ms |
35980 KB |
Output is correct |
110 |
Correct |
167 ms |
36084 KB |
Output is correct |
111 |
Correct |
107 ms |
49228 KB |
Output is correct |
112 |
Correct |
142 ms |
35384 KB |
Output is correct |
113 |
Correct |
72 ms |
23592 KB |
Output is correct |
114 |
Correct |
112 ms |
35776 KB |
Output is correct |
115 |
Correct |
122 ms |
44560 KB |
Output is correct |
116 |
Correct |
139 ms |
41652 KB |
Output is correct |
117 |
Correct |
105 ms |
29828 KB |
Output is correct |
118 |
Correct |
153 ms |
33596 KB |
Output is correct |
119 |
Correct |
90 ms |
15152 KB |
Output is correct |
120 |
Correct |
65 ms |
11500 KB |
Output is correct |