#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
ll n;
const ll maxn = 3005;
vector<vector<ll>> edges[maxn];
ll dist1[maxn];
ll dist2[maxn];
ll dp[maxn][maxn*2];
vector<vector<ll>> dists;
void dfs(ll a, ll p, ll d, ll type){
if (type==1) dist1[a] = d;
else dist2[a] = d;
for (auto&i : edges[a]){
if (i[0] != p) dfs(i[0], a, d+i[1], type);
}
}
vector<ll> stacks;
set<ll> marked;
bool flag = false;
void dfs2(ll a, ll p, ll target){
if (flag) return;
stacks.push_back(a);
if (a==target) flag = true;
if (flag) return;
for (auto&i : edges[a]){
if (flag) return;
if (i[0]==p) continue;
dfs2(i[0], a, target);
if (flag) return;
}
if (flag) return;
stacks.pop_back();
}
int max_score(int N, int X, int Y, long long K,
std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
stacks.clear();
marked.clear();
flag = false;
n = N;
FOR(i,0,N+1) edges[i].clear(), dist1[i] = 0, dist2[i] = 0;
dists.clear();
FOR(i,0,N-1){
edges[U[i]].push_back({V[i], W[i]});
edges[V[i]].push_back({U[i], W[i]});
}
dfs(X, -1, 0, 1);
dfs(Y, -1, 0, 2);
dfs2(X,-1,Y);
for (auto&i : stacks) marked.insert(i);
vector<ll> idkman;
FOR(i,0,N){
idkman.push_back(dist1[i]);
idkman.push_back(dist2[i]);
}
sort(idkman.begin(), idkman.end());
ll cur = 0;
ll ans = 0;
ll k = K;
while (cur<idkman.size() && k-idkman[cur]>=0){
k-= idkman[cur];
ans++;
cur++;
}
FOR(i,0,N){
vector<ll> temp = {};
temp.push_back(min(dist1[i], dist2[i]));
temp.push_back(max(dist1[i], dist2[i]));
dists.push_back(temp);
}
FOR(i,0,N) FOR(j,0,2*N+1) dp[i][j] = 100000000000000000;
if (!marked.count(0)) dp[0][0] = 0;
dp[0][1] = dists[0][0];
dp[0][2] = dists[0][1];
FOR(i,1,N){
FOR(j,0,2*N+1){
ll temp = 100000000000000000;
if (j>=1) temp = min(temp, dp[i-1][j-1]+dists[i][0]);
if (j>=2) temp = min(temp, dp[i-1][j-2]+dists[i][1]);
if (!marked.count(i)) temp = min(temp, dp[i-1][j]);
dp[i][j] = temp;
}
}
FOR(j,0,2*N+1){
if (dp[N-1][j] <=K){
ans = max(ans, j);
}
}
return ans;
}
Compilation message
closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:82:15: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
82 | while (cur<idkman.size() && k-idkman[cur]>=0){
| ~~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
49 ms |
13672 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
0 ms |
516 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
0 ms |
516 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
1116 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
1 ms |
1116 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
6 ms |
6616 KB |
Output is correct |
20 |
Correct |
5 ms |
5724 KB |
Output is correct |
21 |
Correct |
13 ms |
6220 KB |
Output is correct |
22 |
Correct |
7 ms |
6492 KB |
Output is correct |
23 |
Correct |
7 ms |
6492 KB |
Output is correct |
24 |
Correct |
11 ms |
6488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
0 ms |
516 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
1116 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
1 ms |
1116 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
6 ms |
6616 KB |
Output is correct |
20 |
Correct |
5 ms |
5724 KB |
Output is correct |
21 |
Correct |
13 ms |
6220 KB |
Output is correct |
22 |
Correct |
7 ms |
6492 KB |
Output is correct |
23 |
Correct |
7 ms |
6492 KB |
Output is correct |
24 |
Correct |
11 ms |
6488 KB |
Output is correct |
25 |
Correct |
6 ms |
860 KB |
Output is correct |
26 |
Correct |
158 ms |
142348 KB |
Output is correct |
27 |
Correct |
108 ms |
132412 KB |
Output is correct |
28 |
Correct |
221 ms |
133460 KB |
Output is correct |
29 |
Correct |
256 ms |
138832 KB |
Output is correct |
30 |
Correct |
192 ms |
131772 KB |
Output is correct |
31 |
Correct |
251 ms |
142676 KB |
Output is correct |
32 |
Correct |
331 ms |
142656 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
516 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
604 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
0 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
0 ms |
600 KB |
Output is correct |
20 |
Correct |
0 ms |
600 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
22 |
Correct |
1 ms |
600 KB |
Output is correct |
23 |
Correct |
0 ms |
604 KB |
Output is correct |
24 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
0 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
1116 KB |
Output is correct |
15 |
Correct |
1 ms |
856 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
1116 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
516 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
604 KB |
Output is correct |
26 |
Correct |
1 ms |
604 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
0 ms |
604 KB |
Output is correct |
29 |
Correct |
1 ms |
600 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
0 ms |
600 KB |
Output is correct |
32 |
Correct |
0 ms |
600 KB |
Output is correct |
33 |
Correct |
0 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
600 KB |
Output is correct |
35 |
Correct |
0 ms |
604 KB |
Output is correct |
36 |
Correct |
0 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
0 ms |
604 KB |
Output is correct |
39 |
Correct |
1 ms |
1116 KB |
Output is correct |
40 |
Correct |
1 ms |
1028 KB |
Output is correct |
41 |
Correct |
1 ms |
1116 KB |
Output is correct |
42 |
Correct |
1 ms |
856 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
1 ms |
860 KB |
Output is correct |
45 |
Correct |
1 ms |
1116 KB |
Output is correct |
46 |
Correct |
1 ms |
872 KB |
Output is correct |
47 |
Correct |
1 ms |
1112 KB |
Output is correct |
48 |
Correct |
1 ms |
860 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
0 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
0 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
1116 KB |
Output is correct |
15 |
Correct |
1 ms |
856 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
1116 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
6 ms |
6616 KB |
Output is correct |
21 |
Correct |
5 ms |
5724 KB |
Output is correct |
22 |
Correct |
13 ms |
6220 KB |
Output is correct |
23 |
Correct |
7 ms |
6492 KB |
Output is correct |
24 |
Correct |
7 ms |
6492 KB |
Output is correct |
25 |
Correct |
11 ms |
6488 KB |
Output is correct |
26 |
Correct |
1 ms |
344 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
1 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
516 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
604 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
0 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
600 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
0 ms |
600 KB |
Output is correct |
39 |
Correct |
0 ms |
600 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
600 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
604 KB |
Output is correct |
46 |
Correct |
1 ms |
1116 KB |
Output is correct |
47 |
Correct |
1 ms |
1028 KB |
Output is correct |
48 |
Correct |
1 ms |
1116 KB |
Output is correct |
49 |
Correct |
1 ms |
856 KB |
Output is correct |
50 |
Correct |
1 ms |
860 KB |
Output is correct |
51 |
Correct |
1 ms |
860 KB |
Output is correct |
52 |
Correct |
1 ms |
1116 KB |
Output is correct |
53 |
Correct |
1 ms |
872 KB |
Output is correct |
54 |
Correct |
1 ms |
1112 KB |
Output is correct |
55 |
Correct |
1 ms |
860 KB |
Output is correct |
56 |
Correct |
1 ms |
604 KB |
Output is correct |
57 |
Correct |
0 ms |
600 KB |
Output is correct |
58 |
Correct |
1 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
864 KB |
Output is correct |
60 |
Correct |
2 ms |
1116 KB |
Output is correct |
61 |
Correct |
2 ms |
1368 KB |
Output is correct |
62 |
Correct |
4 ms |
1540 KB |
Output is correct |
63 |
Correct |
5 ms |
6492 KB |
Output is correct |
64 |
Correct |
8 ms |
5896 KB |
Output is correct |
65 |
Correct |
9 ms |
5468 KB |
Output is correct |
66 |
Correct |
5 ms |
5980 KB |
Output is correct |
67 |
Correct |
5 ms |
6492 KB |
Output is correct |
68 |
Correct |
7 ms |
5760 KB |
Output is correct |
69 |
Correct |
7 ms |
6492 KB |
Output is correct |
70 |
Correct |
12 ms |
5980 KB |
Output is correct |
71 |
Correct |
13 ms |
6116 KB |
Output is correct |
72 |
Correct |
5 ms |
6236 KB |
Output is correct |
73 |
Correct |
3 ms |
4444 KB |
Output is correct |
74 |
Correct |
4 ms |
4952 KB |
Output is correct |
75 |
Correct |
2 ms |
1112 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
0 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
1116 KB |
Output is correct |
15 |
Correct |
1 ms |
856 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
1116 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
6 ms |
6616 KB |
Output is correct |
21 |
Correct |
5 ms |
5724 KB |
Output is correct |
22 |
Correct |
13 ms |
6220 KB |
Output is correct |
23 |
Correct |
7 ms |
6492 KB |
Output is correct |
24 |
Correct |
7 ms |
6492 KB |
Output is correct |
25 |
Correct |
11 ms |
6488 KB |
Output is correct |
26 |
Correct |
6 ms |
860 KB |
Output is correct |
27 |
Correct |
158 ms |
142348 KB |
Output is correct |
28 |
Correct |
108 ms |
132412 KB |
Output is correct |
29 |
Correct |
221 ms |
133460 KB |
Output is correct |
30 |
Correct |
256 ms |
138832 KB |
Output is correct |
31 |
Correct |
192 ms |
131772 KB |
Output is correct |
32 |
Correct |
251 ms |
142676 KB |
Output is correct |
33 |
Correct |
331 ms |
142656 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
516 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
600 KB |
Output is correct |
45 |
Correct |
1 ms |
604 KB |
Output is correct |
46 |
Correct |
0 ms |
600 KB |
Output is correct |
47 |
Correct |
0 ms |
600 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
600 KB |
Output is correct |
50 |
Correct |
0 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
1 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
1028 KB |
Output is correct |
56 |
Correct |
1 ms |
1116 KB |
Output is correct |
57 |
Correct |
1 ms |
856 KB |
Output is correct |
58 |
Correct |
1 ms |
860 KB |
Output is correct |
59 |
Correct |
1 ms |
860 KB |
Output is correct |
60 |
Correct |
1 ms |
1116 KB |
Output is correct |
61 |
Correct |
1 ms |
872 KB |
Output is correct |
62 |
Correct |
1 ms |
1112 KB |
Output is correct |
63 |
Correct |
1 ms |
860 KB |
Output is correct |
64 |
Correct |
1 ms |
604 KB |
Output is correct |
65 |
Correct |
0 ms |
600 KB |
Output is correct |
66 |
Correct |
1 ms |
604 KB |
Output is correct |
67 |
Correct |
1 ms |
864 KB |
Output is correct |
68 |
Correct |
2 ms |
1116 KB |
Output is correct |
69 |
Correct |
2 ms |
1368 KB |
Output is correct |
70 |
Correct |
4 ms |
1540 KB |
Output is correct |
71 |
Correct |
5 ms |
6492 KB |
Output is correct |
72 |
Correct |
8 ms |
5896 KB |
Output is correct |
73 |
Correct |
9 ms |
5468 KB |
Output is correct |
74 |
Correct |
5 ms |
5980 KB |
Output is correct |
75 |
Correct |
5 ms |
6492 KB |
Output is correct |
76 |
Correct |
7 ms |
5760 KB |
Output is correct |
77 |
Correct |
7 ms |
6492 KB |
Output is correct |
78 |
Correct |
12 ms |
5980 KB |
Output is correct |
79 |
Correct |
13 ms |
6116 KB |
Output is correct |
80 |
Correct |
5 ms |
6236 KB |
Output is correct |
81 |
Correct |
3 ms |
4444 KB |
Output is correct |
82 |
Correct |
4 ms |
4952 KB |
Output is correct |
83 |
Correct |
2 ms |
1112 KB |
Output is correct |
84 |
Correct |
3 ms |
856 KB |
Output is correct |
85 |
Correct |
9 ms |
3008 KB |
Output is correct |
86 |
Correct |
5 ms |
1116 KB |
Output is correct |
87 |
Correct |
8 ms |
1608 KB |
Output is correct |
88 |
Correct |
9 ms |
1628 KB |
Output is correct |
89 |
Correct |
153 ms |
142164 KB |
Output is correct |
90 |
Correct |
145 ms |
127312 KB |
Output is correct |
91 |
Correct |
189 ms |
141648 KB |
Output is correct |
92 |
Correct |
115 ms |
131920 KB |
Output is correct |
93 |
Correct |
166 ms |
133416 KB |
Output is correct |
94 |
Correct |
260 ms |
135540 KB |
Output is correct |
95 |
Correct |
272 ms |
138960 KB |
Output is correct |
96 |
Correct |
197 ms |
129692 KB |
Output is correct |
97 |
Correct |
210 ms |
138608 KB |
Output is correct |
98 |
Correct |
186 ms |
136432 KB |
Output is correct |
99 |
Correct |
119 ms |
142416 KB |
Output is correct |
100 |
Correct |
69 ms |
77548 KB |
Output is correct |
101 |
Correct |
26 ms |
6488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
0 ms |
604 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
1116 KB |
Output is correct |
14 |
Correct |
1 ms |
1116 KB |
Output is correct |
15 |
Correct |
1 ms |
856 KB |
Output is correct |
16 |
Correct |
1 ms |
1116 KB |
Output is correct |
17 |
Correct |
1 ms |
1116 KB |
Output is correct |
18 |
Correct |
1 ms |
1116 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
6 ms |
6616 KB |
Output is correct |
21 |
Correct |
5 ms |
5724 KB |
Output is correct |
22 |
Correct |
13 ms |
6220 KB |
Output is correct |
23 |
Correct |
7 ms |
6492 KB |
Output is correct |
24 |
Correct |
7 ms |
6492 KB |
Output is correct |
25 |
Correct |
11 ms |
6488 KB |
Output is correct |
26 |
Correct |
6 ms |
860 KB |
Output is correct |
27 |
Correct |
158 ms |
142348 KB |
Output is correct |
28 |
Correct |
108 ms |
132412 KB |
Output is correct |
29 |
Correct |
221 ms |
133460 KB |
Output is correct |
30 |
Correct |
256 ms |
138832 KB |
Output is correct |
31 |
Correct |
192 ms |
131772 KB |
Output is correct |
32 |
Correct |
251 ms |
142676 KB |
Output is correct |
33 |
Correct |
331 ms |
142656 KB |
Output is correct |
34 |
Correct |
1 ms |
344 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
516 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
600 KB |
Output is correct |
45 |
Correct |
1 ms |
604 KB |
Output is correct |
46 |
Correct |
0 ms |
600 KB |
Output is correct |
47 |
Correct |
0 ms |
600 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
600 KB |
Output is correct |
50 |
Correct |
0 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
1 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
1028 KB |
Output is correct |
56 |
Correct |
1 ms |
1116 KB |
Output is correct |
57 |
Correct |
1 ms |
856 KB |
Output is correct |
58 |
Correct |
1 ms |
860 KB |
Output is correct |
59 |
Correct |
1 ms |
860 KB |
Output is correct |
60 |
Correct |
1 ms |
1116 KB |
Output is correct |
61 |
Correct |
1 ms |
872 KB |
Output is correct |
62 |
Correct |
1 ms |
1112 KB |
Output is correct |
63 |
Correct |
1 ms |
860 KB |
Output is correct |
64 |
Correct |
1 ms |
604 KB |
Output is correct |
65 |
Correct |
0 ms |
600 KB |
Output is correct |
66 |
Correct |
1 ms |
604 KB |
Output is correct |
67 |
Correct |
1 ms |
864 KB |
Output is correct |
68 |
Correct |
2 ms |
1116 KB |
Output is correct |
69 |
Correct |
2 ms |
1368 KB |
Output is correct |
70 |
Correct |
4 ms |
1540 KB |
Output is correct |
71 |
Correct |
5 ms |
6492 KB |
Output is correct |
72 |
Correct |
8 ms |
5896 KB |
Output is correct |
73 |
Correct |
9 ms |
5468 KB |
Output is correct |
74 |
Correct |
5 ms |
5980 KB |
Output is correct |
75 |
Correct |
5 ms |
6492 KB |
Output is correct |
76 |
Correct |
7 ms |
5760 KB |
Output is correct |
77 |
Correct |
7 ms |
6492 KB |
Output is correct |
78 |
Correct |
12 ms |
5980 KB |
Output is correct |
79 |
Correct |
13 ms |
6116 KB |
Output is correct |
80 |
Correct |
5 ms |
6236 KB |
Output is correct |
81 |
Correct |
3 ms |
4444 KB |
Output is correct |
82 |
Correct |
4 ms |
4952 KB |
Output is correct |
83 |
Correct |
2 ms |
1112 KB |
Output is correct |
84 |
Correct |
3 ms |
856 KB |
Output is correct |
85 |
Correct |
9 ms |
3008 KB |
Output is correct |
86 |
Correct |
5 ms |
1116 KB |
Output is correct |
87 |
Correct |
8 ms |
1608 KB |
Output is correct |
88 |
Correct |
9 ms |
1628 KB |
Output is correct |
89 |
Correct |
153 ms |
142164 KB |
Output is correct |
90 |
Correct |
145 ms |
127312 KB |
Output is correct |
91 |
Correct |
189 ms |
141648 KB |
Output is correct |
92 |
Correct |
115 ms |
131920 KB |
Output is correct |
93 |
Correct |
166 ms |
133416 KB |
Output is correct |
94 |
Correct |
260 ms |
135540 KB |
Output is correct |
95 |
Correct |
272 ms |
138960 KB |
Output is correct |
96 |
Correct |
197 ms |
129692 KB |
Output is correct |
97 |
Correct |
210 ms |
138608 KB |
Output is correct |
98 |
Correct |
186 ms |
136432 KB |
Output is correct |
99 |
Correct |
119 ms |
142416 KB |
Output is correct |
100 |
Correct |
69 ms |
77548 KB |
Output is correct |
101 |
Correct |
26 ms |
6488 KB |
Output is correct |
102 |
Correct |
310 ms |
6216 KB |
Output is correct |
103 |
Correct |
737 ms |
9812 KB |
Output is correct |
104 |
Runtime error |
44 ms |
13608 KB |
Execution killed with signal 11 |
105 |
Halted |
0 ms |
0 KB |
- |