#include <bits/stdc++.h>
#include "closing.h"
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using ld = long double;
#define int ll
#define sz(x) ((int)(x).size())
using pii = pair<ll,ll>;
using tii = tuple<int,int,int>;
const int nmax = 3e3 + 5;
vector<pii> g[nmax];
vector<ll> dX, dY;
vector<int> occX;
vector<int> chain;
void dfs(int node, int f, vector<ll>& d, ll accum) {
d[node] = accum;
for(auto [x, c] : g[node])
if(x != f)
dfs(x, node, d, accum + c);
return;
}
void findchain(int node, int f, int Y) {
if(sz(chain) && chain.back() == Y) return;
chain.emplace_back(node);
for(auto [x, e] : g[node]) {
if(x == f) continue;
findchain(x, node, Y);
}
if(chain.back() == Y) return;
chain.pop_back();
}
int disjointed(int n, ll K, int X, int Y) {
priority_queue<pii, vector<pii>, greater<pii>> heap;
vector<int> occY(n, 0);
heap.emplace(0, Y);
heap.emplace(0, X);
int scorefromY = 0;
while(!heap.empty()) {
auto [C, node] = heap.top();
K -= C;
if(K < 0) break;
heap.pop();
occY[node] = 1;
scorefromY++;
for(auto [x, e] : g[node]) {
if(occY[x]) continue;
heap.emplace(C + e, x);
}
}
return scorefromY;
}
const ll inf = ((ll)1e18) + 5;
int X, Y;
namespace DP {
int foutu[nmax];
vector<ll> dp[nmax][2];
int dim[nmax][2];
void clear(int n) {
for(int i = 0; i < n; i++) {
dim[i][0] = dim[i][1] = 0;
dp[i][0].clear();
dp[i][1].clear();
foutu[i] = 0;
}
}
void convolute(vector<ll> a, vector<ll> b, vector<ll>& c) {
c.resize(max(sz(c), sz(a) + sz(b) - 1), inf);
//cerr << sz(a) << ' ' << sz(b) << ' ' << sz(c) << '\n';
for(int i = 0; i < sz(a); i++)
for(int j = 0; j < sz(b); j++)
c[i + j] = min(c[i + j], a[i] + b[j]);
return;
}
void getdp(int node, int f) { // vectori???
dp[node][0].resize(2, inf);
dp[node][1].resize(3, inf);
dp[node][0][1] = min(dX[node], dY[node]);
dp[node][1][2] = max(dX[node], dY[node]);
//cerr << node << '\n';
for(auto [x, e] : g[node]) {
if(x == f) continue;
getdp(x, node);
foutu[node] |= foutu[x];
}
for(auto [x, e] : g[node]) {
if(x == f) continue;
vector<ll> tmp;
if(!foutu[x])
tmp = dp[node][0];
convolute(dp[node][0], dp[x][0], tmp);
dp[node][0] = move(tmp);
tmp.clear();
if(!foutu[x])
tmp = dp[node][1];
convolute(dp[node][1], dp[x][1], tmp);
convolute(dp[node][1], dp[x][0], tmp);
dp[node][1] = move(tmp);
}
//cerr << node << ":\n";
//cerr << foutu[node] << '\n';
//for(auto x : dp[node][0]) cerr << x << ' '; cerr << '\n';
//for(auto x : dp[node][1]) cerr << x << ' '; cerr << '\n';
//cerr << "---\n";
foutu[node] = foutu[node] | (node == X || node == Y);
return;
}
int getRestraint(int n, int root, ll K) {
clear(n);
//cerr << "\t\t\t" << root << '\n';
getdp(root, root);
//cerr << "! " << sz(dp[root][1]) << '\n';
for(int i = sz(dp[root][1]) - 1; i >= 0; i--)
if(dp[root][1][i] <= K) return i;
return 0;
}
}
#undef int
int max_score(int n, int _X, int _Y, long long K,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
X = _X;
Y = _Y;
#define int ll
for(int i = 0; i < n; i++) g[i].clear();
chain.clear();
dX.clear();
dY.clear();
occX.clear();
for(int i = 0; i < n - 1; i++)
g[U[i]].emplace_back(V[i], W[i]),
g[V[i]].emplace_back(U[i], W[i]);
dX.resize(n);
dY.resize(n);
dfs(X, X, dX, 0);
dfs(Y, Y, dY, 0);
findchain(X, X, Y);
int maxscore = disjointed(n, K, X, Y);
int prv = X;
for(auto x : chain) {
if(dX[x] > dY[x]) { maxscore = max(maxscore, DP::getRestraint(n, prv, K)); break; }
prv = x;
}
prv = Y;
reverse(all(chain));
for(auto x : chain) {
if(dY[x] > dX[x]) { maxscore = max(maxscore, DP::getRestraint(n, prv, K)); break; }
prv = x;
}
return maxscore;
}
#undef int
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
47 ms |
10324 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
604 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
856 KB |
Output is correct |
8 |
Correct |
0 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 |
852 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
604 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
856 KB |
Output is correct |
8 |
Correct |
0 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 |
852 KB |
Output is correct |
12 |
Correct |
1 ms |
600 KB |
Output is correct |
13 |
Correct |
1 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 |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
4 ms |
2908 KB |
Output is correct |
20 |
Correct |
4 ms |
3552 KB |
Output is correct |
21 |
Correct |
3 ms |
2396 KB |
Output is correct |
22 |
Correct |
5 ms |
4188 KB |
Output is correct |
23 |
Correct |
5 ms |
2396 KB |
Output is correct |
24 |
Correct |
4 ms |
2396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
604 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
1 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
856 KB |
Output is correct |
8 |
Correct |
0 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 |
852 KB |
Output is correct |
12 |
Correct |
1 ms |
600 KB |
Output is correct |
13 |
Correct |
1 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 |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
4 ms |
2908 KB |
Output is correct |
20 |
Correct |
4 ms |
3552 KB |
Output is correct |
21 |
Correct |
3 ms |
2396 KB |
Output is correct |
22 |
Correct |
5 ms |
4188 KB |
Output is correct |
23 |
Correct |
5 ms |
2396 KB |
Output is correct |
24 |
Correct |
4 ms |
2396 KB |
Output is correct |
25 |
Correct |
4 ms |
604 KB |
Output is correct |
26 |
Correct |
112 ms |
69752 KB |
Output is correct |
27 |
Correct |
95 ms |
62296 KB |
Output is correct |
28 |
Correct |
106 ms |
55380 KB |
Output is correct |
29 |
Correct |
111 ms |
59516 KB |
Output is correct |
30 |
Correct |
91 ms |
57940 KB |
Output is correct |
31 |
Correct |
106 ms |
63064 KB |
Output is correct |
32 |
Correct |
103 ms |
63172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
0 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 |
600 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
0 ms |
600 KB |
Output is correct |
12 |
Correct |
1 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
600 KB |
Output is correct |
16 |
Correct |
0 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
604 KB |
Output is correct |
19 |
Correct |
0 ms |
604 KB |
Output is correct |
20 |
Correct |
0 ms |
604 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
22 |
Correct |
0 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
604 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 |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
600 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 |
856 KB |
Output is correct |
9 |
Correct |
0 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
852 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
0 ms |
604 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
1 ms |
600 KB |
Output is correct |
22 |
Correct |
1 ms |
600 KB |
Output is correct |
23 |
Correct |
0 ms |
600 KB |
Output is correct |
24 |
Correct |
1 ms |
604 KB |
Output is correct |
25 |
Correct |
1 ms |
604 KB |
Output is correct |
26 |
Correct |
0 ms |
600 KB |
Output is correct |
27 |
Correct |
1 ms |
600 KB |
Output is correct |
28 |
Correct |
0 ms |
604 KB |
Output is correct |
29 |
Correct |
0 ms |
604 KB |
Output is correct |
30 |
Correct |
0 ms |
604 KB |
Output is correct |
31 |
Correct |
0 ms |
604 KB |
Output is correct |
32 |
Correct |
0 ms |
604 KB |
Output is correct |
33 |
Correct |
0 ms |
604 KB |
Output is correct |
34 |
Correct |
0 ms |
600 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
0 ms |
604 KB |
Output is correct |
37 |
Correct |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
0 ms |
604 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
1 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 |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
600 KB |
Output is correct |
46 |
Correct |
1 ms |
604 KB |
Output is correct |
47 |
Correct |
1 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
752 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
600 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 |
856 KB |
Output is correct |
9 |
Correct |
0 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
852 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
4 ms |
2908 KB |
Output is correct |
21 |
Correct |
4 ms |
3552 KB |
Output is correct |
22 |
Correct |
3 ms |
2396 KB |
Output is correct |
23 |
Correct |
5 ms |
4188 KB |
Output is correct |
24 |
Correct |
5 ms |
2396 KB |
Output is correct |
25 |
Correct |
4 ms |
2396 KB |
Output is correct |
26 |
Correct |
0 ms |
604 KB |
Output is correct |
27 |
Correct |
1 ms |
604 KB |
Output is correct |
28 |
Correct |
1 ms |
600 KB |
Output is correct |
29 |
Correct |
1 ms |
600 KB |
Output is correct |
30 |
Correct |
0 ms |
600 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
1 ms |
604 KB |
Output is correct |
33 |
Correct |
0 ms |
600 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 |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
0 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
600 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
0 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
604 KB |
Output is correct |
46 |
Correct |
1 ms |
604 KB |
Output is correct |
47 |
Correct |
1 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
604 KB |
Output is correct |
52 |
Correct |
1 ms |
600 KB |
Output is correct |
53 |
Correct |
1 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
752 KB |
Output is correct |
56 |
Correct |
1 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
672 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
860 KB |
Output is correct |
61 |
Correct |
2 ms |
860 KB |
Output is correct |
62 |
Correct |
2 ms |
860 KB |
Output is correct |
63 |
Correct |
3 ms |
1116 KB |
Output is correct |
64 |
Correct |
3 ms |
1116 KB |
Output is correct |
65 |
Correct |
2 ms |
860 KB |
Output is correct |
66 |
Correct |
2 ms |
860 KB |
Output is correct |
67 |
Correct |
3 ms |
1152 KB |
Output is correct |
68 |
Correct |
3 ms |
2140 KB |
Output is correct |
69 |
Correct |
4 ms |
2396 KB |
Output is correct |
70 |
Correct |
3 ms |
1884 KB |
Output is correct |
71 |
Correct |
3 ms |
1884 KB |
Output is correct |
72 |
Correct |
2 ms |
860 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
3 ms |
860 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
600 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 |
856 KB |
Output is correct |
9 |
Correct |
0 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
852 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
4 ms |
2908 KB |
Output is correct |
21 |
Correct |
4 ms |
3552 KB |
Output is correct |
22 |
Correct |
3 ms |
2396 KB |
Output is correct |
23 |
Correct |
5 ms |
4188 KB |
Output is correct |
24 |
Correct |
5 ms |
2396 KB |
Output is correct |
25 |
Correct |
4 ms |
2396 KB |
Output is correct |
26 |
Correct |
4 ms |
604 KB |
Output is correct |
27 |
Correct |
112 ms |
69752 KB |
Output is correct |
28 |
Correct |
95 ms |
62296 KB |
Output is correct |
29 |
Correct |
106 ms |
55380 KB |
Output is correct |
30 |
Correct |
111 ms |
59516 KB |
Output is correct |
31 |
Correct |
91 ms |
57940 KB |
Output is correct |
32 |
Correct |
106 ms |
63064 KB |
Output is correct |
33 |
Correct |
103 ms |
63172 KB |
Output is correct |
34 |
Correct |
0 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
600 KB |
Output is correct |
37 |
Correct |
1 ms |
600 KB |
Output is correct |
38 |
Correct |
0 ms |
600 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
600 KB |
Output is correct |
42 |
Correct |
1 ms |
600 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
0 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
604 KB |
Output is correct |
46 |
Correct |
0 ms |
604 KB |
Output is correct |
47 |
Correct |
0 ms |
604 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
0 ms |
600 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
1 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
600 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
604 KB |
Output is correct |
63 |
Correct |
1 ms |
752 KB |
Output is correct |
64 |
Correct |
1 ms |
604 KB |
Output is correct |
65 |
Correct |
1 ms |
672 KB |
Output is correct |
66 |
Correct |
1 ms |
600 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
860 KB |
Output is correct |
69 |
Correct |
2 ms |
860 KB |
Output is correct |
70 |
Correct |
2 ms |
860 KB |
Output is correct |
71 |
Correct |
3 ms |
1116 KB |
Output is correct |
72 |
Correct |
3 ms |
1116 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
2 ms |
860 KB |
Output is correct |
75 |
Correct |
3 ms |
1152 KB |
Output is correct |
76 |
Correct |
3 ms |
2140 KB |
Output is correct |
77 |
Correct |
4 ms |
2396 KB |
Output is correct |
78 |
Correct |
3 ms |
1884 KB |
Output is correct |
79 |
Correct |
3 ms |
1884 KB |
Output is correct |
80 |
Correct |
2 ms |
860 KB |
Output is correct |
81 |
Correct |
2 ms |
860 KB |
Output is correct |
82 |
Correct |
3 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
4 ms |
604 KB |
Output is correct |
85 |
Correct |
8 ms |
860 KB |
Output is correct |
86 |
Correct |
5 ms |
860 KB |
Output is correct |
87 |
Correct |
8 ms |
1116 KB |
Output is correct |
88 |
Correct |
7 ms |
860 KB |
Output is correct |
89 |
Correct |
57 ms |
6788 KB |
Output is correct |
90 |
Correct |
53 ms |
6912 KB |
Output is correct |
91 |
Correct |
60 ms |
5772 KB |
Output is correct |
92 |
Correct |
54 ms |
8020 KB |
Output is correct |
93 |
Correct |
51 ms |
6996 KB |
Output is correct |
94 |
Correct |
98 ms |
48460 KB |
Output is correct |
95 |
Correct |
100 ms |
53092 KB |
Output is correct |
96 |
Correct |
76 ms |
36084 KB |
Output is correct |
97 |
Correct |
71 ms |
24408 KB |
Output is correct |
98 |
Correct |
49 ms |
2316 KB |
Output is correct |
99 |
Correct |
62 ms |
4072 KB |
Output is correct |
100 |
Correct |
31 ms |
2096 KB |
Output is correct |
101 |
Correct |
11 ms |
1116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
600 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 |
856 KB |
Output is correct |
9 |
Correct |
0 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
852 KB |
Output is correct |
13 |
Correct |
1 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
604 KB |
Output is correct |
15 |
Correct |
1 ms |
604 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
604 KB |
Output is correct |
20 |
Correct |
4 ms |
2908 KB |
Output is correct |
21 |
Correct |
4 ms |
3552 KB |
Output is correct |
22 |
Correct |
3 ms |
2396 KB |
Output is correct |
23 |
Correct |
5 ms |
4188 KB |
Output is correct |
24 |
Correct |
5 ms |
2396 KB |
Output is correct |
25 |
Correct |
4 ms |
2396 KB |
Output is correct |
26 |
Correct |
4 ms |
604 KB |
Output is correct |
27 |
Correct |
112 ms |
69752 KB |
Output is correct |
28 |
Correct |
95 ms |
62296 KB |
Output is correct |
29 |
Correct |
106 ms |
55380 KB |
Output is correct |
30 |
Correct |
111 ms |
59516 KB |
Output is correct |
31 |
Correct |
91 ms |
57940 KB |
Output is correct |
32 |
Correct |
106 ms |
63064 KB |
Output is correct |
33 |
Correct |
103 ms |
63172 KB |
Output is correct |
34 |
Correct |
0 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
600 KB |
Output is correct |
37 |
Correct |
1 ms |
600 KB |
Output is correct |
38 |
Correct |
0 ms |
600 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
600 KB |
Output is correct |
42 |
Correct |
1 ms |
600 KB |
Output is correct |
43 |
Correct |
0 ms |
604 KB |
Output is correct |
44 |
Correct |
0 ms |
604 KB |
Output is correct |
45 |
Correct |
0 ms |
604 KB |
Output is correct |
46 |
Correct |
0 ms |
604 KB |
Output is correct |
47 |
Correct |
0 ms |
604 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
0 ms |
600 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
1 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
600 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
604 KB |
Output is correct |
63 |
Correct |
1 ms |
752 KB |
Output is correct |
64 |
Correct |
1 ms |
604 KB |
Output is correct |
65 |
Correct |
1 ms |
672 KB |
Output is correct |
66 |
Correct |
1 ms |
600 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
860 KB |
Output is correct |
69 |
Correct |
2 ms |
860 KB |
Output is correct |
70 |
Correct |
2 ms |
860 KB |
Output is correct |
71 |
Correct |
3 ms |
1116 KB |
Output is correct |
72 |
Correct |
3 ms |
1116 KB |
Output is correct |
73 |
Correct |
2 ms |
860 KB |
Output is correct |
74 |
Correct |
2 ms |
860 KB |
Output is correct |
75 |
Correct |
3 ms |
1152 KB |
Output is correct |
76 |
Correct |
3 ms |
2140 KB |
Output is correct |
77 |
Correct |
4 ms |
2396 KB |
Output is correct |
78 |
Correct |
3 ms |
1884 KB |
Output is correct |
79 |
Correct |
3 ms |
1884 KB |
Output is correct |
80 |
Correct |
2 ms |
860 KB |
Output is correct |
81 |
Correct |
2 ms |
860 KB |
Output is correct |
82 |
Correct |
3 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
4 ms |
604 KB |
Output is correct |
85 |
Correct |
8 ms |
860 KB |
Output is correct |
86 |
Correct |
5 ms |
860 KB |
Output is correct |
87 |
Correct |
8 ms |
1116 KB |
Output is correct |
88 |
Correct |
7 ms |
860 KB |
Output is correct |
89 |
Correct |
57 ms |
6788 KB |
Output is correct |
90 |
Correct |
53 ms |
6912 KB |
Output is correct |
91 |
Correct |
60 ms |
5772 KB |
Output is correct |
92 |
Correct |
54 ms |
8020 KB |
Output is correct |
93 |
Correct |
51 ms |
6996 KB |
Output is correct |
94 |
Correct |
98 ms |
48460 KB |
Output is correct |
95 |
Correct |
100 ms |
53092 KB |
Output is correct |
96 |
Correct |
76 ms |
36084 KB |
Output is correct |
97 |
Correct |
71 ms |
24408 KB |
Output is correct |
98 |
Correct |
49 ms |
2316 KB |
Output is correct |
99 |
Correct |
62 ms |
4072 KB |
Output is correct |
100 |
Correct |
31 ms |
2096 KB |
Output is correct |
101 |
Correct |
11 ms |
1116 KB |
Output is correct |
102 |
Correct |
318 ms |
6008 KB |
Output is correct |
103 |
Correct |
648 ms |
6496 KB |
Output is correct |
104 |
Runtime error |
49 ms |
13904 KB |
Execution killed with signal 11 |
105 |
Halted |
0 ms |
0 KB |
- |