#include "closing.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
// <|°_°|>
// M. Broccoli & JeanBombeur
const int MAX_NODES = 2e5;
struct event {
long long cost;
int node, id;
};
vector <pair <int, long long>> Adj[MAX_NODES];
long long Dist[2][MAX_NODES];
bool Taken[2][MAX_NODES];
vector <int> Path;
priority_queue <event> Greedy;
bool operator<(event a, event b) {
return a.cost > b.cost;
}
bool Dfs(int id, int node, int parent = -1, int target = -1) {
for (pair <int, long long> dest : Adj[node])
{
if (dest.first != parent)
{
Dist[id][dest.first] = Dist[id][node] + dest.second;
if (Dfs(id, dest.first, node, target))
target = node;
}
}
if (node == target)
Path.push_back(node);
return node == target;
}
int RunSmart(int answer, long long maxSum) {
long long last = 0;
long long sum = 0;
while (!Greedy.empty())
{
auto [cost, node, id] = Greedy.top();
Greedy.pop();
if (id == 2)
{
if (Taken[0][node] || Taken[1][node])
continue;
cost <<= 1;
if (sum + cost <= maxSum)
{
sum += cost;
answer += 2;
Taken[0][node] = Taken[1][node] = 1;
}
else if (sum - last + cost <= maxSum)
{
answer ++;
break;
}
}
else
{
if (Taken[id][node])
continue;
if ((sum += cost) > maxSum)
break;
Taken[id][node] = 1;
answer ++;
if (!Taken[id ^ 1][node])
Greedy.push({Dist[id ^ 1][node] - Dist[id][node], node, id ^ 1});
last = cost;
}
}
return answer;
}
int max_score(int nbNodes, int start1, int start2, long long maxSum,
vector <int> Left, vector <int> Right, vector <int> Weight) {
maxSum <<= 1;
Path.clear();
for (int i = 0; i < nbNodes; i ++)
Adj[i].clear();
for (int i = 0; i < nbNodes - 1; i ++)
{
Adj[Left[i]].emplace_back(Right[i], Weight[i] << 1);
Adj[Right[i]].emplace_back(Left[i], Weight[i] << 1);
}
for (int id = 0; id < 2; id ++)
{
fill_n(Dist[id], nbNodes, 0LL);
fill_n(Taken[id], nbNodes, 0);
if (!id)
Dfs(id, start1);
else
Dfs(id, start2, -1, start1);
}
int answer = 0;
long long sum = 0;
int greed = 0;
vector <long long> mini;
for (int i = 0; i < nbNodes; i ++)
{
mini.push_back(Dist[0][i]);
mini.push_back(Dist[1][i]);
}
sort(mini.begin(), mini.end());
for (long long a : mini)
if ((sum += a) <= maxSum)
greed ++;
while (!Greedy.empty())
Greedy.pop();
sum = 0;
for (int a : Path)
{
int id = Dist[0][a] > Dist[1][a];
sum += Dist[id][a];
answer ++;
Taken[id][a] = 1;
Greedy.push({Dist[id ^ 1][a] - Dist[id][a], a, id ^ 1});
}
if (sum > maxSum)
return greed;
for (int i = 0; i < nbNodes; i ++)
{
int id = Dist[0][i] > Dist[1][i];
Greedy.push({Dist[id][i], i, id});
Greedy.push({Dist[id ^ 1][i] / 2, i, 2});
}
return max(greed, RunSmart(answer, maxSum - sum));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
123 ms |
35900 KB |
Output is correct |
2 |
Correct |
129 ms |
45688 KB |
Output is correct |
3 |
Correct |
67 ms |
10068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
7516 KB |
Output is correct |
2 |
Correct |
2 ms |
7564 KB |
Output is correct |
3 |
Correct |
2 ms |
7516 KB |
Output is correct |
4 |
Correct |
1 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
2 ms |
7516 KB |
Output is correct |
7 |
Correct |
1 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
2 ms |
7512 KB |
Output is correct |
10 |
Correct |
2 ms |
7516 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
7516 KB |
Output is correct |
2 |
Correct |
2 ms |
7564 KB |
Output is correct |
3 |
Correct |
2 ms |
7516 KB |
Output is correct |
4 |
Correct |
1 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
2 ms |
7516 KB |
Output is correct |
7 |
Correct |
1 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
2 ms |
7512 KB |
Output is correct |
10 |
Correct |
2 ms |
7516 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
1 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
2 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
2 ms |
7592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
7516 KB |
Output is correct |
2 |
Correct |
2 ms |
7564 KB |
Output is correct |
3 |
Correct |
2 ms |
7516 KB |
Output is correct |
4 |
Correct |
1 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
2 ms |
7516 KB |
Output is correct |
7 |
Correct |
1 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
2 ms |
7512 KB |
Output is correct |
10 |
Correct |
2 ms |
7516 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
1 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
2 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
2 ms |
7592 KB |
Output is correct |
25 |
Correct |
3 ms |
7516 KB |
Output is correct |
26 |
Correct |
3 ms |
8284 KB |
Output is correct |
27 |
Correct |
3 ms |
8028 KB |
Output is correct |
28 |
Correct |
3 ms |
8408 KB |
Output is correct |
29 |
Correct |
3 ms |
8284 KB |
Output is correct |
30 |
Correct |
2 ms |
8028 KB |
Output is correct |
31 |
Correct |
3 ms |
8284 KB |
Output is correct |
32 |
Correct |
3 ms |
8284 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
2 |
Correct |
1 ms |
7516 KB |
Output is correct |
3 |
Correct |
2 ms |
7564 KB |
Output is correct |
4 |
Correct |
2 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
1 ms |
7516 KB |
Output is correct |
7 |
Correct |
2 ms |
7516 KB |
Output is correct |
8 |
Correct |
2 ms |
7516 KB |
Output is correct |
9 |
Correct |
2 ms |
7516 KB |
Output is correct |
10 |
Correct |
2 ms |
7512 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
1 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
1 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
2 ms |
7516 KB |
Output is correct |
17 |
Correct |
2 ms |
7520 KB |
Output is correct |
18 |
Correct |
2 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
1 ms |
7516 KB |
Output is correct |
21 |
Correct |
1 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
1 ms |
7516 KB |
Output is correct |
24 |
Correct |
1 ms |
7516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
2 |
Correct |
1 ms |
7516 KB |
Output is correct |
3 |
Correct |
2 ms |
7564 KB |
Output is correct |
4 |
Correct |
2 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
1 ms |
7516 KB |
Output is correct |
7 |
Correct |
2 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
1 ms |
7516 KB |
Output is correct |
10 |
Correct |
2 ms |
7512 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
2 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
1 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7512 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
1 ms |
7516 KB |
Output is correct |
25 |
Correct |
2 ms |
7516 KB |
Output is correct |
26 |
Correct |
1 ms |
7516 KB |
Output is correct |
27 |
Correct |
2 ms |
7516 KB |
Output is correct |
28 |
Correct |
2 ms |
7516 KB |
Output is correct |
29 |
Correct |
2 ms |
7520 KB |
Output is correct |
30 |
Correct |
2 ms |
7516 KB |
Output is correct |
31 |
Correct |
2 ms |
7516 KB |
Output is correct |
32 |
Correct |
1 ms |
7516 KB |
Output is correct |
33 |
Correct |
1 ms |
7516 KB |
Output is correct |
34 |
Correct |
2 ms |
7516 KB |
Output is correct |
35 |
Correct |
1 ms |
7516 KB |
Output is correct |
36 |
Correct |
1 ms |
7516 KB |
Output is correct |
37 |
Correct |
2 ms |
7516 KB |
Output is correct |
38 |
Correct |
2 ms |
7512 KB |
Output is correct |
39 |
Correct |
2 ms |
7516 KB |
Output is correct |
40 |
Correct |
2 ms |
7444 KB |
Output is correct |
41 |
Correct |
1 ms |
7768 KB |
Output is correct |
42 |
Correct |
2 ms |
7516 KB |
Output is correct |
43 |
Correct |
1 ms |
7768 KB |
Output is correct |
44 |
Correct |
1 ms |
7516 KB |
Output is correct |
45 |
Correct |
2 ms |
7516 KB |
Output is correct |
46 |
Correct |
2 ms |
7768 KB |
Output is correct |
47 |
Correct |
1 ms |
7516 KB |
Output is correct |
48 |
Correct |
2 ms |
7516 KB |
Output is correct |
49 |
Correct |
2 ms |
7512 KB |
Output is correct |
50 |
Correct |
2 ms |
7700 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
2 |
Correct |
1 ms |
7516 KB |
Output is correct |
3 |
Correct |
2 ms |
7564 KB |
Output is correct |
4 |
Correct |
2 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
1 ms |
7516 KB |
Output is correct |
7 |
Correct |
2 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
1 ms |
7516 KB |
Output is correct |
10 |
Correct |
2 ms |
7512 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
2 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
1 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
2 ms |
7516 KB |
Output is correct |
25 |
Correct |
2 ms |
7592 KB |
Output is correct |
26 |
Correct |
2 ms |
7516 KB |
Output is correct |
27 |
Correct |
2 ms |
7516 KB |
Output is correct |
28 |
Correct |
2 ms |
7516 KB |
Output is correct |
29 |
Correct |
2 ms |
7512 KB |
Output is correct |
30 |
Correct |
2 ms |
7516 KB |
Output is correct |
31 |
Correct |
1 ms |
7516 KB |
Output is correct |
32 |
Correct |
2 ms |
7516 KB |
Output is correct |
33 |
Correct |
1 ms |
7516 KB |
Output is correct |
34 |
Correct |
2 ms |
7516 KB |
Output is correct |
35 |
Correct |
2 ms |
7516 KB |
Output is correct |
36 |
Correct |
2 ms |
7520 KB |
Output is correct |
37 |
Correct |
2 ms |
7516 KB |
Output is correct |
38 |
Correct |
2 ms |
7516 KB |
Output is correct |
39 |
Correct |
1 ms |
7516 KB |
Output is correct |
40 |
Correct |
1 ms |
7516 KB |
Output is correct |
41 |
Correct |
2 ms |
7516 KB |
Output is correct |
42 |
Correct |
1 ms |
7516 KB |
Output is correct |
43 |
Correct |
1 ms |
7516 KB |
Output is correct |
44 |
Correct |
2 ms |
7516 KB |
Output is correct |
45 |
Correct |
2 ms |
7512 KB |
Output is correct |
46 |
Correct |
2 ms |
7516 KB |
Output is correct |
47 |
Correct |
2 ms |
7444 KB |
Output is correct |
48 |
Correct |
1 ms |
7768 KB |
Output is correct |
49 |
Correct |
2 ms |
7516 KB |
Output is correct |
50 |
Correct |
1 ms |
7768 KB |
Output is correct |
51 |
Correct |
1 ms |
7516 KB |
Output is correct |
52 |
Correct |
2 ms |
7516 KB |
Output is correct |
53 |
Correct |
2 ms |
7768 KB |
Output is correct |
54 |
Correct |
1 ms |
7516 KB |
Output is correct |
55 |
Correct |
2 ms |
7516 KB |
Output is correct |
56 |
Correct |
2 ms |
7512 KB |
Output is correct |
57 |
Correct |
2 ms |
7700 KB |
Output is correct |
58 |
Correct |
2 ms |
7516 KB |
Output is correct |
59 |
Correct |
2 ms |
7516 KB |
Output is correct |
60 |
Correct |
2 ms |
7516 KB |
Output is correct |
61 |
Correct |
2 ms |
7516 KB |
Output is correct |
62 |
Correct |
2 ms |
7592 KB |
Output is correct |
63 |
Correct |
2 ms |
7768 KB |
Output is correct |
64 |
Correct |
2 ms |
7516 KB |
Output is correct |
65 |
Correct |
2 ms |
7516 KB |
Output is correct |
66 |
Correct |
2 ms |
7768 KB |
Output is correct |
67 |
Correct |
2 ms |
7516 KB |
Output is correct |
68 |
Correct |
2 ms |
7772 KB |
Output is correct |
69 |
Correct |
2 ms |
7772 KB |
Output is correct |
70 |
Correct |
2 ms |
7516 KB |
Output is correct |
71 |
Correct |
2 ms |
7512 KB |
Output is correct |
72 |
Correct |
2 ms |
7516 KB |
Output is correct |
73 |
Correct |
2 ms |
7516 KB |
Output is correct |
74 |
Correct |
2 ms |
7516 KB |
Output is correct |
75 |
Correct |
2 ms |
7516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
2 |
Correct |
1 ms |
7516 KB |
Output is correct |
3 |
Correct |
2 ms |
7564 KB |
Output is correct |
4 |
Correct |
2 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
1 ms |
7516 KB |
Output is correct |
7 |
Correct |
2 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
1 ms |
7516 KB |
Output is correct |
10 |
Correct |
2 ms |
7512 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
2 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
1 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
2 ms |
7516 KB |
Output is correct |
25 |
Correct |
2 ms |
7592 KB |
Output is correct |
26 |
Correct |
3 ms |
7516 KB |
Output is correct |
27 |
Correct |
3 ms |
8284 KB |
Output is correct |
28 |
Correct |
3 ms |
8028 KB |
Output is correct |
29 |
Correct |
3 ms |
8408 KB |
Output is correct |
30 |
Correct |
3 ms |
8284 KB |
Output is correct |
31 |
Correct |
2 ms |
8028 KB |
Output is correct |
32 |
Correct |
3 ms |
8284 KB |
Output is correct |
33 |
Correct |
3 ms |
8284 KB |
Output is correct |
34 |
Correct |
2 ms |
7516 KB |
Output is correct |
35 |
Correct |
2 ms |
7516 KB |
Output is correct |
36 |
Correct |
2 ms |
7516 KB |
Output is correct |
37 |
Correct |
2 ms |
7512 KB |
Output is correct |
38 |
Correct |
2 ms |
7516 KB |
Output is correct |
39 |
Correct |
1 ms |
7516 KB |
Output is correct |
40 |
Correct |
2 ms |
7516 KB |
Output is correct |
41 |
Correct |
1 ms |
7516 KB |
Output is correct |
42 |
Correct |
2 ms |
7516 KB |
Output is correct |
43 |
Correct |
2 ms |
7516 KB |
Output is correct |
44 |
Correct |
2 ms |
7520 KB |
Output is correct |
45 |
Correct |
2 ms |
7516 KB |
Output is correct |
46 |
Correct |
2 ms |
7516 KB |
Output is correct |
47 |
Correct |
1 ms |
7516 KB |
Output is correct |
48 |
Correct |
1 ms |
7516 KB |
Output is correct |
49 |
Correct |
2 ms |
7516 KB |
Output is correct |
50 |
Correct |
1 ms |
7516 KB |
Output is correct |
51 |
Correct |
1 ms |
7516 KB |
Output is correct |
52 |
Correct |
2 ms |
7516 KB |
Output is correct |
53 |
Correct |
2 ms |
7512 KB |
Output is correct |
54 |
Correct |
2 ms |
7516 KB |
Output is correct |
55 |
Correct |
2 ms |
7444 KB |
Output is correct |
56 |
Correct |
1 ms |
7768 KB |
Output is correct |
57 |
Correct |
2 ms |
7516 KB |
Output is correct |
58 |
Correct |
1 ms |
7768 KB |
Output is correct |
59 |
Correct |
1 ms |
7516 KB |
Output is correct |
60 |
Correct |
2 ms |
7516 KB |
Output is correct |
61 |
Correct |
2 ms |
7768 KB |
Output is correct |
62 |
Correct |
1 ms |
7516 KB |
Output is correct |
63 |
Correct |
2 ms |
7516 KB |
Output is correct |
64 |
Correct |
2 ms |
7512 KB |
Output is correct |
65 |
Correct |
2 ms |
7700 KB |
Output is correct |
66 |
Correct |
2 ms |
7516 KB |
Output is correct |
67 |
Correct |
2 ms |
7516 KB |
Output is correct |
68 |
Correct |
2 ms |
7516 KB |
Output is correct |
69 |
Correct |
2 ms |
7516 KB |
Output is correct |
70 |
Correct |
2 ms |
7592 KB |
Output is correct |
71 |
Correct |
2 ms |
7768 KB |
Output is correct |
72 |
Correct |
2 ms |
7516 KB |
Output is correct |
73 |
Correct |
2 ms |
7516 KB |
Output is correct |
74 |
Correct |
2 ms |
7768 KB |
Output is correct |
75 |
Correct |
2 ms |
7516 KB |
Output is correct |
76 |
Correct |
2 ms |
7772 KB |
Output is correct |
77 |
Correct |
2 ms |
7772 KB |
Output is correct |
78 |
Correct |
2 ms |
7516 KB |
Output is correct |
79 |
Correct |
2 ms |
7512 KB |
Output is correct |
80 |
Correct |
2 ms |
7516 KB |
Output is correct |
81 |
Correct |
2 ms |
7516 KB |
Output is correct |
82 |
Correct |
2 ms |
7516 KB |
Output is correct |
83 |
Correct |
2 ms |
7516 KB |
Output is correct |
84 |
Correct |
3 ms |
7516 KB |
Output is correct |
85 |
Correct |
3 ms |
7640 KB |
Output is correct |
86 |
Correct |
3 ms |
7516 KB |
Output is correct |
87 |
Correct |
3 ms |
7516 KB |
Output is correct |
88 |
Correct |
4 ms |
7512 KB |
Output is correct |
89 |
Correct |
3 ms |
8028 KB |
Output is correct |
90 |
Correct |
3 ms |
8196 KB |
Output is correct |
91 |
Correct |
3 ms |
8028 KB |
Output is correct |
92 |
Correct |
4 ms |
8028 KB |
Output is correct |
93 |
Correct |
4 ms |
8028 KB |
Output is correct |
94 |
Correct |
3 ms |
8284 KB |
Output is correct |
95 |
Correct |
3 ms |
8540 KB |
Output is correct |
96 |
Correct |
4 ms |
8028 KB |
Output is correct |
97 |
Correct |
4 ms |
8284 KB |
Output is correct |
98 |
Correct |
3 ms |
8024 KB |
Output is correct |
99 |
Correct |
3 ms |
8280 KB |
Output is correct |
100 |
Correct |
3 ms |
8028 KB |
Output is correct |
101 |
Correct |
3 ms |
7772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
7516 KB |
Output is correct |
2 |
Correct |
1 ms |
7516 KB |
Output is correct |
3 |
Correct |
2 ms |
7564 KB |
Output is correct |
4 |
Correct |
2 ms |
7516 KB |
Output is correct |
5 |
Correct |
1 ms |
7516 KB |
Output is correct |
6 |
Correct |
1 ms |
7516 KB |
Output is correct |
7 |
Correct |
2 ms |
7516 KB |
Output is correct |
8 |
Correct |
1 ms |
7516 KB |
Output is correct |
9 |
Correct |
1 ms |
7516 KB |
Output is correct |
10 |
Correct |
2 ms |
7512 KB |
Output is correct |
11 |
Correct |
2 ms |
7516 KB |
Output is correct |
12 |
Correct |
2 ms |
7516 KB |
Output is correct |
13 |
Correct |
2 ms |
7516 KB |
Output is correct |
14 |
Correct |
2 ms |
7516 KB |
Output is correct |
15 |
Correct |
2 ms |
7516 KB |
Output is correct |
16 |
Correct |
2 ms |
7516 KB |
Output is correct |
17 |
Correct |
1 ms |
7516 KB |
Output is correct |
18 |
Correct |
1 ms |
7516 KB |
Output is correct |
19 |
Correct |
2 ms |
7516 KB |
Output is correct |
20 |
Correct |
2 ms |
7516 KB |
Output is correct |
21 |
Correct |
2 ms |
7516 KB |
Output is correct |
22 |
Correct |
2 ms |
7516 KB |
Output is correct |
23 |
Correct |
2 ms |
7516 KB |
Output is correct |
24 |
Correct |
2 ms |
7516 KB |
Output is correct |
25 |
Correct |
2 ms |
7592 KB |
Output is correct |
26 |
Correct |
3 ms |
7516 KB |
Output is correct |
27 |
Correct |
3 ms |
8284 KB |
Output is correct |
28 |
Correct |
3 ms |
8028 KB |
Output is correct |
29 |
Correct |
3 ms |
8408 KB |
Output is correct |
30 |
Correct |
3 ms |
8284 KB |
Output is correct |
31 |
Correct |
2 ms |
8028 KB |
Output is correct |
32 |
Correct |
3 ms |
8284 KB |
Output is correct |
33 |
Correct |
3 ms |
8284 KB |
Output is correct |
34 |
Correct |
2 ms |
7516 KB |
Output is correct |
35 |
Correct |
2 ms |
7516 KB |
Output is correct |
36 |
Correct |
2 ms |
7516 KB |
Output is correct |
37 |
Correct |
2 ms |
7512 KB |
Output is correct |
38 |
Correct |
2 ms |
7516 KB |
Output is correct |
39 |
Correct |
1 ms |
7516 KB |
Output is correct |
40 |
Correct |
2 ms |
7516 KB |
Output is correct |
41 |
Correct |
1 ms |
7516 KB |
Output is correct |
42 |
Correct |
2 ms |
7516 KB |
Output is correct |
43 |
Correct |
2 ms |
7516 KB |
Output is correct |
44 |
Correct |
2 ms |
7520 KB |
Output is correct |
45 |
Correct |
2 ms |
7516 KB |
Output is correct |
46 |
Correct |
2 ms |
7516 KB |
Output is correct |
47 |
Correct |
1 ms |
7516 KB |
Output is correct |
48 |
Correct |
1 ms |
7516 KB |
Output is correct |
49 |
Correct |
2 ms |
7516 KB |
Output is correct |
50 |
Correct |
1 ms |
7516 KB |
Output is correct |
51 |
Correct |
1 ms |
7516 KB |
Output is correct |
52 |
Correct |
2 ms |
7516 KB |
Output is correct |
53 |
Correct |
2 ms |
7512 KB |
Output is correct |
54 |
Correct |
2 ms |
7516 KB |
Output is correct |
55 |
Correct |
2 ms |
7444 KB |
Output is correct |
56 |
Correct |
1 ms |
7768 KB |
Output is correct |
57 |
Correct |
2 ms |
7516 KB |
Output is correct |
58 |
Correct |
1 ms |
7768 KB |
Output is correct |
59 |
Correct |
1 ms |
7516 KB |
Output is correct |
60 |
Correct |
2 ms |
7516 KB |
Output is correct |
61 |
Correct |
2 ms |
7768 KB |
Output is correct |
62 |
Correct |
1 ms |
7516 KB |
Output is correct |
63 |
Correct |
2 ms |
7516 KB |
Output is correct |
64 |
Correct |
2 ms |
7512 KB |
Output is correct |
65 |
Correct |
2 ms |
7700 KB |
Output is correct |
66 |
Correct |
2 ms |
7516 KB |
Output is correct |
67 |
Correct |
2 ms |
7516 KB |
Output is correct |
68 |
Correct |
2 ms |
7516 KB |
Output is correct |
69 |
Correct |
2 ms |
7516 KB |
Output is correct |
70 |
Correct |
2 ms |
7592 KB |
Output is correct |
71 |
Correct |
2 ms |
7768 KB |
Output is correct |
72 |
Correct |
2 ms |
7516 KB |
Output is correct |
73 |
Correct |
2 ms |
7516 KB |
Output is correct |
74 |
Correct |
2 ms |
7768 KB |
Output is correct |
75 |
Correct |
2 ms |
7516 KB |
Output is correct |
76 |
Correct |
2 ms |
7772 KB |
Output is correct |
77 |
Correct |
2 ms |
7772 KB |
Output is correct |
78 |
Correct |
2 ms |
7516 KB |
Output is correct |
79 |
Correct |
2 ms |
7512 KB |
Output is correct |
80 |
Correct |
2 ms |
7516 KB |
Output is correct |
81 |
Correct |
2 ms |
7516 KB |
Output is correct |
82 |
Correct |
2 ms |
7516 KB |
Output is correct |
83 |
Correct |
2 ms |
7516 KB |
Output is correct |
84 |
Correct |
3 ms |
7516 KB |
Output is correct |
85 |
Correct |
3 ms |
7640 KB |
Output is correct |
86 |
Correct |
3 ms |
7516 KB |
Output is correct |
87 |
Correct |
3 ms |
7516 KB |
Output is correct |
88 |
Correct |
4 ms |
7512 KB |
Output is correct |
89 |
Correct |
3 ms |
8028 KB |
Output is correct |
90 |
Correct |
3 ms |
8196 KB |
Output is correct |
91 |
Correct |
3 ms |
8028 KB |
Output is correct |
92 |
Correct |
4 ms |
8028 KB |
Output is correct |
93 |
Correct |
4 ms |
8028 KB |
Output is correct |
94 |
Correct |
3 ms |
8284 KB |
Output is correct |
95 |
Correct |
3 ms |
8540 KB |
Output is correct |
96 |
Correct |
4 ms |
8028 KB |
Output is correct |
97 |
Correct |
4 ms |
8284 KB |
Output is correct |
98 |
Correct |
3 ms |
8024 KB |
Output is correct |
99 |
Correct |
3 ms |
8280 KB |
Output is correct |
100 |
Correct |
3 ms |
8028 KB |
Output is correct |
101 |
Correct |
3 ms |
7772 KB |
Output is correct |
102 |
Correct |
75 ms |
12748 KB |
Output is correct |
103 |
Correct |
90 ms |
12684 KB |
Output is correct |
104 |
Correct |
201 ms |
50344 KB |
Output is correct |
105 |
Correct |
96 ms |
14768 KB |
Output is correct |
106 |
Correct |
108 ms |
14300 KB |
Output is correct |
107 |
Correct |
99 ms |
36480 KB |
Output is correct |
108 |
Correct |
101 ms |
35768 KB |
Output is correct |
109 |
Correct |
92 ms |
50400 KB |
Output is correct |
110 |
Correct |
167 ms |
39996 KB |
Output is correct |
111 |
Correct |
123 ms |
46664 KB |
Output is correct |
112 |
Correct |
167 ms |
39556 KB |
Output is correct |
113 |
Correct |
122 ms |
32960 KB |
Output is correct |
114 |
Correct |
121 ms |
39404 KB |
Output is correct |
115 |
Correct |
144 ms |
63700 KB |
Output is correct |
116 |
Correct |
153 ms |
45880 KB |
Output is correct |
117 |
Correct |
150 ms |
39080 KB |
Output is correct |
118 |
Correct |
167 ms |
39292 KB |
Output is correct |
119 |
Correct |
103 ms |
17888 KB |
Output is correct |
120 |
Correct |
73 ms |
12112 KB |
Output is correct |