#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;
#ifndef WAIMAI
#include "closing.h"
#else
#include "grader.cpp"
#endif
#ifdef WAIMAI
#define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE)
void dout() {cout << '\n';}
template<typename T, typename...U>
void dout(T t, U...u) {cout << t << (sizeof...(u) ? ", " : ""), dout(u...);}
#else
#define debug(...) 7122
#endif
#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for (int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second
const ll INF = 2e18;
const int SIZE = 3005;
int n, x, y, ans;
int sz[SIZE];
vector<pair<int, int>> adj[SIZE];
ll k, dx[SIZE], dy[SIZE], dp[SIZE][4][SIZE << 1], tmp[SIZE << 1];
void chmin(ll &x, ll y) {
x = min(x, y);
}
void build(int s, ll *dis) {
fill(dis + 1, dis + n + 1, INF);
queue<int> q;
dis[s] = 0;
q.push(s);
while (q.size()) {
int pos = q.front();
q.pop();
for (auto [np, w] : adj[pos]) if (dis[pos] + w < dis[np]) {
dis[np] = dis[pos] + w;
q.push(np);
}
}
}
void merge(int sz1, int sz2, ll *a, ll *b) {
FOR (i, 0, sz1) if (a[i] != INF) {
FOR (j, 0, sz2) {
chmin(tmp[i + j], a[i] + b[j]);
}
}
}
void dfs(int pos, int fa) {
sz[pos] = 2;
dp[pos][0][0] = 0;
dp[pos][1][1] = dx[pos];
dp[pos][2][1] = dy[pos];
dp[pos][3][2] = max(dx[pos], dy[pos]);
for (auto [np, w] : adj[pos]) if (np != fa) {
dfs(np, pos);
int tsz = sz[pos] + sz[np];
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][0], dp[np][0]);
if (dy[np] < dy[pos]) merge(sz[pos], sz[np], dp[pos][0], dp[np][2]);
FOR (i, 0, tsz) chmin(dp[pos][0][i], tmp[i]);
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][1], dp[np][0]);
merge(sz[pos], sz[np], dp[pos][1], dp[np][1]);
if (dy[np] < dy[pos]) {
merge(sz[pos], sz[np], dp[pos][1], dp[np][2]);
merge(sz[pos], sz[np], dp[pos][1], dp[np][3]);
}
FOR (i, 0, tsz) chmin(dp[pos][1][i], tmp[i]);
if (dy[np] < dy[pos]) {
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][2], dp[np][2]);
FOR (i, 0, tsz) dp[pos][2][i] = tmp[i];
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][3], dp[np][2]);
merge(sz[pos], sz[np], dp[pos][3], dp[np][3]);
FOR (i, 0, tsz) dp[pos][3][i] = tmp[i];
} else {
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][2], dp[np][0]);
merge(sz[pos], sz[np], dp[pos][2], dp[np][2]);
FOR (i, 0, tsz) chmin(dp[pos][2][i], tmp[i]);
fill(tmp, tmp + tsz + 1, INF);
merge(sz[pos], sz[np], dp[pos][3], dp[np][0]);
merge(sz[pos], sz[np], dp[pos][3], dp[np][1]);
merge(sz[pos], sz[np], dp[pos][3], dp[np][2]);
merge(sz[pos], sz[np], dp[pos][3], dp[np][3]);
FOR (i, 0, tsz) chmin(dp[pos][3][i], tmp[i]);
}
sz[pos] = tsz;
}
}
int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) {
n = N, x = X + 1, y = Y + 1, k = K;
FOR (i, 1, n) adj[i].clear();
FOR (i, 0, n - 2) {
U[i]++, V[i]++;
adj[U[i]].pb(V[i], W[i]);
adj[V[i]].pb(U[i], W[i]);
}
FOR (i, 1, n) FOR (mask, 0, 3) fill(dp[i][mask], dp[i][mask] + 2 * n + 1, INF);
build(x, dx), build(y, dy);
dfs(x, x);
ans = 0;
FOR (j, 0, 2 * n) FOR (i, 0, 3) if (dp[x][i][j] <= k) ans = j;
return ans;
}
/*
in1
2
7 0 2 10
0 1 2
0 3 3
1 2 4
2 4 2
2 5 5
5 6 3
4 0 3 20
0 1 18
1 2 1
2 3 19
out1
6
3
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
46 ms |
8616 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
860 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
0 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
1372 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
860 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
0 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
1372 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1624 KB |
Output is correct |
12 |
Correct |
1 ms |
2652 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
2 ms |
2396 KB |
Output is correct |
16 |
Correct |
1 ms |
2652 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
10 ms |
24412 KB |
Output is correct |
20 |
Correct |
8 ms |
21084 KB |
Output is correct |
21 |
Correct |
10 ms |
22792 KB |
Output is correct |
22 |
Correct |
11 ms |
24156 KB |
Output is correct |
23 |
Correct |
11 ms |
24412 KB |
Output is correct |
24 |
Correct |
10 ms |
24408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
860 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
0 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
1372 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1624 KB |
Output is correct |
12 |
Correct |
1 ms |
2652 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
2 ms |
2396 KB |
Output is correct |
16 |
Correct |
1 ms |
2652 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
10 ms |
24412 KB |
Output is correct |
20 |
Correct |
8 ms |
21084 KB |
Output is correct |
21 |
Correct |
10 ms |
22792 KB |
Output is correct |
22 |
Correct |
11 ms |
24156 KB |
Output is correct |
23 |
Correct |
11 ms |
24412 KB |
Output is correct |
24 |
Correct |
10 ms |
24408 KB |
Output is correct |
25 |
Correct |
3 ms |
1372 KB |
Output is correct |
26 |
Correct |
205 ms |
565672 KB |
Output is correct |
27 |
Correct |
192 ms |
525648 KB |
Output is correct |
28 |
Correct |
206 ms |
529748 KB |
Output is correct |
29 |
Correct |
221 ms |
550996 KB |
Output is correct |
30 |
Correct |
193 ms |
523344 KB |
Output is correct |
31 |
Correct |
234 ms |
565844 KB |
Output is correct |
32 |
Correct |
230 ms |
565844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
0 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
0 ms |
516 KB |
Output is correct |
9 |
Correct |
0 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
860 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
860 KB |
Output is correct |
15 |
Correct |
0 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
776 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
860 KB |
Output is correct |
20 |
Correct |
0 ms |
776 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
22 |
Correct |
0 ms |
856 KB |
Output is correct |
23 |
Correct |
0 ms |
860 KB |
Output is correct |
24 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
0 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1372 KB |
Output is correct |
12 |
Correct |
1 ms |
1624 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2652 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
2 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
2652 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
0 ms |
516 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
22 |
Correct |
1 ms |
604 KB |
Output is correct |
23 |
Correct |
1 ms |
860 KB |
Output is correct |
24 |
Correct |
0 ms |
604 KB |
Output is correct |
25 |
Correct |
1 ms |
860 KB |
Output is correct |
26 |
Correct |
0 ms |
860 KB |
Output is correct |
27 |
Correct |
0 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
776 KB |
Output is correct |
29 |
Correct |
1 ms |
604 KB |
Output is correct |
30 |
Correct |
0 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
860 KB |
Output is correct |
32 |
Correct |
0 ms |
776 KB |
Output is correct |
33 |
Correct |
0 ms |
604 KB |
Output is correct |
34 |
Correct |
0 ms |
856 KB |
Output is correct |
35 |
Correct |
0 ms |
860 KB |
Output is correct |
36 |
Correct |
0 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
1112 KB |
Output is correct |
38 |
Correct |
1 ms |
1372 KB |
Output is correct |
39 |
Correct |
1 ms |
2652 KB |
Output is correct |
40 |
Correct |
1 ms |
2652 KB |
Output is correct |
41 |
Correct |
2 ms |
2652 KB |
Output is correct |
42 |
Correct |
1 ms |
2652 KB |
Output is correct |
43 |
Correct |
1 ms |
2392 KB |
Output is correct |
44 |
Correct |
1 ms |
2496 KB |
Output is correct |
45 |
Correct |
1 ms |
2652 KB |
Output is correct |
46 |
Correct |
1 ms |
2652 KB |
Output is correct |
47 |
Correct |
1 ms |
2652 KB |
Output is correct |
48 |
Correct |
1 ms |
2392 KB |
Output is correct |
49 |
Correct |
1 ms |
1624 KB |
Output is correct |
50 |
Correct |
0 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
0 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1372 KB |
Output is correct |
12 |
Correct |
1 ms |
1624 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2652 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
2 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
2652 KB |
Output is correct |
19 |
Correct |
1 ms |
860 KB |
Output is correct |
20 |
Correct |
10 ms |
24412 KB |
Output is correct |
21 |
Correct |
8 ms |
21084 KB |
Output is correct |
22 |
Correct |
10 ms |
22792 KB |
Output is correct |
23 |
Correct |
11 ms |
24156 KB |
Output is correct |
24 |
Correct |
11 ms |
24412 KB |
Output is correct |
25 |
Correct |
10 ms |
24408 KB |
Output is correct |
26 |
Correct |
1 ms |
604 KB |
Output is correct |
27 |
Correct |
0 ms |
516 KB |
Output is correct |
28 |
Correct |
0 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
604 KB |
Output is correct |
32 |
Correct |
1 ms |
860 KB |
Output is correct |
33 |
Correct |
0 ms |
860 KB |
Output is correct |
34 |
Correct |
0 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
776 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
0 ms |
860 KB |
Output is correct |
38 |
Correct |
0 ms |
860 KB |
Output is correct |
39 |
Correct |
0 ms |
776 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
856 KB |
Output is correct |
42 |
Correct |
0 ms |
860 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
1112 KB |
Output is correct |
45 |
Correct |
1 ms |
1372 KB |
Output is correct |
46 |
Correct |
1 ms |
2652 KB |
Output is correct |
47 |
Correct |
1 ms |
2652 KB |
Output is correct |
48 |
Correct |
2 ms |
2652 KB |
Output is correct |
49 |
Correct |
1 ms |
2652 KB |
Output is correct |
50 |
Correct |
1 ms |
2392 KB |
Output is correct |
51 |
Correct |
1 ms |
2496 KB |
Output is correct |
52 |
Correct |
1 ms |
2652 KB |
Output is correct |
53 |
Correct |
1 ms |
2652 KB |
Output is correct |
54 |
Correct |
1 ms |
2652 KB |
Output is correct |
55 |
Correct |
1 ms |
2392 KB |
Output is correct |
56 |
Correct |
1 ms |
1624 KB |
Output is correct |
57 |
Correct |
0 ms |
860 KB |
Output is correct |
58 |
Correct |
1 ms |
860 KB |
Output is correct |
59 |
Correct |
2 ms |
2392 KB |
Output is correct |
60 |
Correct |
1 ms |
2652 KB |
Output is correct |
61 |
Correct |
4 ms |
4188 KB |
Output is correct |
62 |
Correct |
4 ms |
4188 KB |
Output is correct |
63 |
Correct |
10 ms |
24156 KB |
Output is correct |
64 |
Correct |
9 ms |
21612 KB |
Output is correct |
65 |
Correct |
8 ms |
20572 KB |
Output is correct |
66 |
Correct |
9 ms |
21880 KB |
Output is correct |
67 |
Correct |
9 ms |
23900 KB |
Output is correct |
68 |
Correct |
9 ms |
20976 KB |
Output is correct |
69 |
Correct |
13 ms |
24156 KB |
Output is correct |
70 |
Correct |
11 ms |
22608 KB |
Output is correct |
71 |
Correct |
10 ms |
22360 KB |
Output is correct |
72 |
Correct |
9 ms |
23132 KB |
Output is correct |
73 |
Correct |
7 ms |
16304 KB |
Output is correct |
74 |
Correct |
7 ms |
17752 KB |
Output is correct |
75 |
Correct |
2 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
0 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1372 KB |
Output is correct |
12 |
Correct |
1 ms |
1624 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2652 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
2 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
2652 KB |
Output is correct |
19 |
Correct |
1 ms |
860 KB |
Output is correct |
20 |
Correct |
10 ms |
24412 KB |
Output is correct |
21 |
Correct |
8 ms |
21084 KB |
Output is correct |
22 |
Correct |
10 ms |
22792 KB |
Output is correct |
23 |
Correct |
11 ms |
24156 KB |
Output is correct |
24 |
Correct |
11 ms |
24412 KB |
Output is correct |
25 |
Correct |
10 ms |
24408 KB |
Output is correct |
26 |
Correct |
3 ms |
1372 KB |
Output is correct |
27 |
Correct |
205 ms |
565672 KB |
Output is correct |
28 |
Correct |
192 ms |
525648 KB |
Output is correct |
29 |
Correct |
206 ms |
529748 KB |
Output is correct |
30 |
Correct |
221 ms |
550996 KB |
Output is correct |
31 |
Correct |
193 ms |
523344 KB |
Output is correct |
32 |
Correct |
234 ms |
565844 KB |
Output is correct |
33 |
Correct |
230 ms |
565844 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
0 ms |
516 KB |
Output is correct |
36 |
Correct |
0 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
860 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
860 KB |
Output is correct |
41 |
Correct |
0 ms |
860 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
776 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
860 KB |
Output is correct |
47 |
Correct |
0 ms |
776 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
0 ms |
856 KB |
Output is correct |
50 |
Correct |
0 ms |
860 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
1 ms |
1112 KB |
Output is correct |
53 |
Correct |
1 ms |
1372 KB |
Output is correct |
54 |
Correct |
1 ms |
2652 KB |
Output is correct |
55 |
Correct |
1 ms |
2652 KB |
Output is correct |
56 |
Correct |
2 ms |
2652 KB |
Output is correct |
57 |
Correct |
1 ms |
2652 KB |
Output is correct |
58 |
Correct |
1 ms |
2392 KB |
Output is correct |
59 |
Correct |
1 ms |
2496 KB |
Output is correct |
60 |
Correct |
1 ms |
2652 KB |
Output is correct |
61 |
Correct |
1 ms |
2652 KB |
Output is correct |
62 |
Correct |
1 ms |
2652 KB |
Output is correct |
63 |
Correct |
1 ms |
2392 KB |
Output is correct |
64 |
Correct |
1 ms |
1624 KB |
Output is correct |
65 |
Correct |
0 ms |
860 KB |
Output is correct |
66 |
Correct |
1 ms |
860 KB |
Output is correct |
67 |
Correct |
2 ms |
2392 KB |
Output is correct |
68 |
Correct |
1 ms |
2652 KB |
Output is correct |
69 |
Correct |
4 ms |
4188 KB |
Output is correct |
70 |
Correct |
4 ms |
4188 KB |
Output is correct |
71 |
Correct |
10 ms |
24156 KB |
Output is correct |
72 |
Correct |
9 ms |
21612 KB |
Output is correct |
73 |
Correct |
8 ms |
20572 KB |
Output is correct |
74 |
Correct |
9 ms |
21880 KB |
Output is correct |
75 |
Correct |
9 ms |
23900 KB |
Output is correct |
76 |
Correct |
9 ms |
20976 KB |
Output is correct |
77 |
Correct |
13 ms |
24156 KB |
Output is correct |
78 |
Correct |
11 ms |
22608 KB |
Output is correct |
79 |
Correct |
10 ms |
22360 KB |
Output is correct |
80 |
Correct |
9 ms |
23132 KB |
Output is correct |
81 |
Correct |
7 ms |
16304 KB |
Output is correct |
82 |
Correct |
7 ms |
17752 KB |
Output is correct |
83 |
Correct |
2 ms |
2652 KB |
Output is correct |
84 |
Correct |
4 ms |
1372 KB |
Output is correct |
85 |
Correct |
13 ms |
9820 KB |
Output is correct |
86 |
Correct |
6 ms |
2648 KB |
Output is correct |
87 |
Correct |
16 ms |
4444 KB |
Output is correct |
88 |
Correct |
14 ms |
4484 KB |
Output is correct |
89 |
Correct |
213 ms |
565144 KB |
Output is correct |
90 |
Correct |
185 ms |
505944 KB |
Output is correct |
91 |
Correct |
264 ms |
562652 KB |
Output is correct |
92 |
Correct |
189 ms |
524480 KB |
Output is correct |
93 |
Correct |
193 ms |
530004 KB |
Output is correct |
94 |
Correct |
313 ms |
538192 KB |
Output is correct |
95 |
Correct |
271 ms |
551760 KB |
Output is correct |
96 |
Correct |
278 ms |
513400 KB |
Output is correct |
97 |
Correct |
251 ms |
549920 KB |
Output is correct |
98 |
Correct |
193 ms |
542268 KB |
Output is correct |
99 |
Correct |
205 ms |
565328 KB |
Output is correct |
100 |
Correct |
116 ms |
306308 KB |
Output is correct |
101 |
Correct |
19 ms |
24412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
860 KB |
Output is correct |
4 |
Correct |
1 ms |
860 KB |
Output is correct |
5 |
Correct |
0 ms |
860 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
1 ms |
1372 KB |
Output is correct |
8 |
Correct |
1 ms |
1372 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
1 ms |
1372 KB |
Output is correct |
11 |
Correct |
1 ms |
1372 KB |
Output is correct |
12 |
Correct |
1 ms |
1624 KB |
Output is correct |
13 |
Correct |
1 ms |
2652 KB |
Output is correct |
14 |
Correct |
1 ms |
2652 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
2 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2652 KB |
Output is correct |
18 |
Correct |
1 ms |
2652 KB |
Output is correct |
19 |
Correct |
1 ms |
860 KB |
Output is correct |
20 |
Correct |
10 ms |
24412 KB |
Output is correct |
21 |
Correct |
8 ms |
21084 KB |
Output is correct |
22 |
Correct |
10 ms |
22792 KB |
Output is correct |
23 |
Correct |
11 ms |
24156 KB |
Output is correct |
24 |
Correct |
11 ms |
24412 KB |
Output is correct |
25 |
Correct |
10 ms |
24408 KB |
Output is correct |
26 |
Correct |
3 ms |
1372 KB |
Output is correct |
27 |
Correct |
205 ms |
565672 KB |
Output is correct |
28 |
Correct |
192 ms |
525648 KB |
Output is correct |
29 |
Correct |
206 ms |
529748 KB |
Output is correct |
30 |
Correct |
221 ms |
550996 KB |
Output is correct |
31 |
Correct |
193 ms |
523344 KB |
Output is correct |
32 |
Correct |
234 ms |
565844 KB |
Output is correct |
33 |
Correct |
230 ms |
565844 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
0 ms |
516 KB |
Output is correct |
36 |
Correct |
0 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
860 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
860 KB |
Output is correct |
41 |
Correct |
0 ms |
860 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
776 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
860 KB |
Output is correct |
47 |
Correct |
0 ms |
776 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
0 ms |
856 KB |
Output is correct |
50 |
Correct |
0 ms |
860 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
1 ms |
1112 KB |
Output is correct |
53 |
Correct |
1 ms |
1372 KB |
Output is correct |
54 |
Correct |
1 ms |
2652 KB |
Output is correct |
55 |
Correct |
1 ms |
2652 KB |
Output is correct |
56 |
Correct |
2 ms |
2652 KB |
Output is correct |
57 |
Correct |
1 ms |
2652 KB |
Output is correct |
58 |
Correct |
1 ms |
2392 KB |
Output is correct |
59 |
Correct |
1 ms |
2496 KB |
Output is correct |
60 |
Correct |
1 ms |
2652 KB |
Output is correct |
61 |
Correct |
1 ms |
2652 KB |
Output is correct |
62 |
Correct |
1 ms |
2652 KB |
Output is correct |
63 |
Correct |
1 ms |
2392 KB |
Output is correct |
64 |
Correct |
1 ms |
1624 KB |
Output is correct |
65 |
Correct |
0 ms |
860 KB |
Output is correct |
66 |
Correct |
1 ms |
860 KB |
Output is correct |
67 |
Correct |
2 ms |
2392 KB |
Output is correct |
68 |
Correct |
1 ms |
2652 KB |
Output is correct |
69 |
Correct |
4 ms |
4188 KB |
Output is correct |
70 |
Correct |
4 ms |
4188 KB |
Output is correct |
71 |
Correct |
10 ms |
24156 KB |
Output is correct |
72 |
Correct |
9 ms |
21612 KB |
Output is correct |
73 |
Correct |
8 ms |
20572 KB |
Output is correct |
74 |
Correct |
9 ms |
21880 KB |
Output is correct |
75 |
Correct |
9 ms |
23900 KB |
Output is correct |
76 |
Correct |
9 ms |
20976 KB |
Output is correct |
77 |
Correct |
13 ms |
24156 KB |
Output is correct |
78 |
Correct |
11 ms |
22608 KB |
Output is correct |
79 |
Correct |
10 ms |
22360 KB |
Output is correct |
80 |
Correct |
9 ms |
23132 KB |
Output is correct |
81 |
Correct |
7 ms |
16304 KB |
Output is correct |
82 |
Correct |
7 ms |
17752 KB |
Output is correct |
83 |
Correct |
2 ms |
2652 KB |
Output is correct |
84 |
Correct |
4 ms |
1372 KB |
Output is correct |
85 |
Correct |
13 ms |
9820 KB |
Output is correct |
86 |
Correct |
6 ms |
2648 KB |
Output is correct |
87 |
Correct |
16 ms |
4444 KB |
Output is correct |
88 |
Correct |
14 ms |
4484 KB |
Output is correct |
89 |
Correct |
213 ms |
565144 KB |
Output is correct |
90 |
Correct |
185 ms |
505944 KB |
Output is correct |
91 |
Correct |
264 ms |
562652 KB |
Output is correct |
92 |
Correct |
189 ms |
524480 KB |
Output is correct |
93 |
Correct |
193 ms |
530004 KB |
Output is correct |
94 |
Correct |
313 ms |
538192 KB |
Output is correct |
95 |
Correct |
271 ms |
551760 KB |
Output is correct |
96 |
Correct |
278 ms |
513400 KB |
Output is correct |
97 |
Correct |
251 ms |
549920 KB |
Output is correct |
98 |
Correct |
193 ms |
542268 KB |
Output is correct |
99 |
Correct |
205 ms |
565328 KB |
Output is correct |
100 |
Correct |
116 ms |
306308 KB |
Output is correct |
101 |
Correct |
19 ms |
24412 KB |
Output is correct |
102 |
Correct |
345 ms |
7768 KB |
Output is correct |
103 |
Correct |
710 ms |
22096 KB |
Output is correct |
104 |
Runtime error |
47 ms |
8492 KB |
Execution killed with signal 11 |
105 |
Halted |
0 ms |
0 KB |
- |