# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
725388 |
2023-04-17T11:07:52 Z |
yeyso |
Dreaming (IOI13_dreaming) |
C++14 |
|
1000 ms |
17964 KB |
#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
cin.tie(NULL);
iostream::sync_with_stdio(false);
int n = N; int m = M; int l = L;
vector<vector<int>> adj(n, vector<int>());
vector<vector<int>> dma(n, vector<int>());
vector<int> a(A, A+m);
vector<int> b(B, B+m);
vector<int> t(T, T+m);
for(int i = 0; i < a.size(); i ++){
adj[a[i]].push_back(b[i]); adj[b[i]].push_back(a[i]);
dma[a[i]].push_back(t[i]); dma[b[i]].push_back(t[i]);
}
vector<int> components = {0};
queue<int> q0; q0.push(0);
vector<int> v(n, 0);
int node = 0;
while(!q0.empty()){
node = q0.front();
q0.pop();
if(!v[node]){
v[node] = 1;
for(int i = 0; i < adj[node].size(); i ++){
q0.push(adj[node][i]);
}
}
if(q0.empty()){
for(int i = 0; i < v.size(); i ++){
if(v[i] == 0){
components.push_back(i);
q0.push(i);
break;
}
}
}
}
queue<int> q;
vector<int> d0(n, INT_MAX / 2); vector<int> v0(n, 0);
vector<int> d(n, INT_MAX / 2); vector<int> visited(n, 0);
vector<pair<int, int>> prefix0; vector<pair<int, int>> prefix;
vector<int> maxsizes;
vector<int> parents(n, -1); vector<int> parents0(n, -1);
vector<int> centers;
for(int x = 0; x < components.size(); x ++){
prefix = prefix0;
int furtherest = 0; int dist = 0;
d = d0; visited = v0;
parents = parents0;
d[components[x]] = 0;
// Finds the furtherest node in the component
q.push(components[x]);
while(!q.empty()){
node = q.front();
q.pop();
if(!visited[node]){
visited[node] = 1;
for(int i = 0; i < adj[node].size(); i ++){
q.push(adj[node][i]);
d[adj[node][i]] = min(d[adj[node][i]], d[node] + dma[node][i]);
}
}
}
for(int i = 0; i < visited.size(); i ++){
if(visited[i]){
if(d[i] >= dist){
dist = d[i];
furtherest = i;
}
}
}
// Generate a prefix array of nodes from the furtherest
d = d0; visited = v0;
d[furtherest] = 0;
q.push(furtherest);
while(!q.empty()){
node = q.front();
q.pop();
if(!visited[node]){
visited[node] = 1;
for(int i = 0; i < adj[node].size(); i ++){
q.push(adj[node][i]);
d[adj[node][i]] = min(d[adj[node][i]], d[node] + dma[node][i]);
if(!visited[adj[node][i]]){
parents[adj[node][i]] = node;
}
}
}
}
furtherest = 0;
dist = 0;
for(int i = 0; i < visited.size(); i ++){
if(visited[i]){
if(d[i] >= dist){
dist = d[i];
furtherest = i;
}
}
}
node = furtherest;
dist = 0;
while(node > -1){
prefix.push_back({d[node], node});
node = parents[node];
}
//reverse(prefix.begin(), prefix.end());
int maxd = prefix[0].first;
int score = INT_MAX / 2;
int best = INT_MAX / 2;
int best_node = 0;
for(int i = 0; i < prefix.size(); i ++){
if(max(prefix[i].first, maxd - prefix[i].first) < best){
best = max(prefix[i].first, maxd - prefix[i].first);
best_node = prefix[i].second;
}
}
centers.push_back(best_node);
maxsizes.push_back(maxd);
}
int largest_diameter = 0;
int largest_component_center = 0;
for(int i = 0; i < maxsizes.size(); i ++){
if(maxsizes[i] > largest_diameter){
largest_diameter = maxsizes[i];
largest_component_center = centers[i];
}
}
for(int i = 0; i < centers.size(); i ++){
//cout << centers[i] << " ";
if(centers[i] != largest_component_center){
adj[centers[i]].push_back(largest_component_center);
adj[largest_component_center].push_back(centers[i]);
dma[centers[i]].push_back(l);
dma[largest_component_center].push_back(l);
}
}
//cout << "_ " << largest_component_center << " ";
q.push(0);
v = v0; d = d0;
d[0] = 0;
while(!q.empty()){
node = q.front();
q.pop();
if(!v[node]){
v[node] = 1;
for(int i = 0; i < adj[node].size(); i ++){
q.push(adj[node][i]);
d[adj[node][i]] = min(d[adj[node][i]], d[node] + dma[node][i]);
}
}
}
int dist = 0;
int furtherest = 0;
for(int i = 0; i < d.size(); i ++){
if(d[i] > dist){
dist = d[i];
furtherest = i;
}
//cout << v[i] << " ";
}
q.push(furtherest);
v = v0; d = d0;
d[furtherest] = 0;
while(!q.empty()){
node = q.front();
q.pop();
if(!v[node]){
v[node] = 1;
for(int i = 0; i < adj[node].size(); i ++){
q.push(adj[node][i]);
d[adj[node][i]] = min(d[adj[node][i]], d[node] + dma[node][i]);
}
}
}
dist = 0;
furtherest = 0;
for(int i = 0; i < d.size(); i ++){
dist = max(dist, d[i]);
}
return dist;
}
/*
g++ -DEVAL -static -O2 -o dreaming grader.cpp dreaming.cpp
12 10 2
0 8 4
8 2 2
2 7 4
5 11 3
5 1 7
1 3 1
1 9 5
10 6 3
2 6 2
10 4 2
12 8 2
0 8 4
8 2 2
2 7 4
5 11 3
5 1 7
1 3 1
1 9 5
10 6 3
*/
Compilation message
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:14:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | for(int i = 0; i < a.size(); i ++){
| ~~^~~~~~~~~~
dreaming.cpp:28:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
28 | for(int i = 0; i < adj[node].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:33:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for(int i = 0; i < v.size(); i ++){
| ~~^~~~~~~~~~
dreaming.cpp:49:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
49 | for(int x = 0; x < components.size(); x ++){
| ~~^~~~~~~~~~~~~~~~~~~
dreaming.cpp:62:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
62 | for(int i = 0; i < adj[node].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:70:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
70 | for(int i = 0; i < visited.size(); i ++){
| ~~^~~~~~~~~~~~~~~~
dreaming.cpp:87:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
87 | for(int i = 0; i < adj[node].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:99:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
99 | for(int i = 0; i < visited.size(); i ++){
| ~~^~~~~~~~~~~~~~~~
dreaming.cpp:118:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
118 | for(int i = 0; i < prefix.size(); i ++){
| ~~^~~~~~~~~~~~~~~
dreaming.cpp:115:13: warning: unused variable 'score' [-Wunused-variable]
115 | int score = INT_MAX / 2;
| ^~~~~
dreaming.cpp:129:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
129 | for(int i = 0; i < maxsizes.size(); i ++){
| ~~^~~~~~~~~~~~~~~~~
dreaming.cpp:136:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
136 | for(int i = 0; i < centers.size(); i ++){
| ~~^~~~~~~~~~~~~~~~
dreaming.cpp:155:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
155 | for(int i = 0; i < adj[node].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:163:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
163 | for(int i = 0; i < d.size(); i ++){
| ~~^~~~~~~~~~
dreaming.cpp:178:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
178 | for(int i = 0; i < adj[node].size(); i ++){
| ~~^~~~~~~~~~~~~~~~~~
dreaming.cpp:186:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
186 | for(int i = 0; i < d.size(); i ++){
| ~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
79 ms |
16460 KB |
Output is correct |
2 |
Correct |
82 ms |
16404 KB |
Output is correct |
3 |
Correct |
45 ms |
10848 KB |
Output is correct |
4 |
Correct |
9 ms |
2900 KB |
Output is correct |
5 |
Correct |
8 ms |
2132 KB |
Output is correct |
6 |
Correct |
17 ms |
4180 KB |
Output is correct |
7 |
Correct |
1 ms |
308 KB |
Output is correct |
8 |
Correct |
37 ms |
7464 KB |
Output is correct |
9 |
Correct |
56 ms |
9348 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
85 ms |
12600 KB |
Output is correct |
12 |
Correct |
108 ms |
14664 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
304 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
308 KB |
Output is correct |
11 |
Correct |
1 ms |
308 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
304 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
308 KB |
Output is correct |
17 |
Correct |
1 ms |
304 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
312 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
79 ms |
16460 KB |
Output is correct |
2 |
Correct |
82 ms |
16404 KB |
Output is correct |
3 |
Correct |
45 ms |
10848 KB |
Output is correct |
4 |
Correct |
9 ms |
2900 KB |
Output is correct |
5 |
Correct |
8 ms |
2132 KB |
Output is correct |
6 |
Correct |
17 ms |
4180 KB |
Output is correct |
7 |
Correct |
1 ms |
308 KB |
Output is correct |
8 |
Correct |
37 ms |
7464 KB |
Output is correct |
9 |
Correct |
56 ms |
9348 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
85 ms |
12600 KB |
Output is correct |
12 |
Correct |
108 ms |
14664 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
304 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
308 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
0 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
304 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
308 KB |
Output is correct |
30 |
Correct |
1 ms |
304 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
312 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
88 ms |
16456 KB |
Output is correct |
40 |
Correct |
86 ms |
16420 KB |
Output is correct |
41 |
Correct |
46 ms |
10952 KB |
Output is correct |
42 |
Correct |
9 ms |
2900 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
0 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
312 KB |
Output is correct |
47 |
Correct |
1 ms |
340 KB |
Output is correct |
48 |
Correct |
1 ms |
340 KB |
Output is correct |
49 |
Correct |
1 ms |
308 KB |
Output is correct |
50 |
Correct |
1 ms |
340 KB |
Output is correct |
51 |
Correct |
1 ms |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
304 KB |
Output is correct |
53 |
Correct |
1 ms |
340 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
1 ms |
340 KB |
Output is correct |
57 |
Correct |
176 ms |
16644 KB |
Output is correct |
58 |
Correct |
156 ms |
16716 KB |
Output is correct |
59 |
Correct |
150 ms |
16756 KB |
Output is correct |
60 |
Correct |
143 ms |
16748 KB |
Output is correct |
61 |
Correct |
161 ms |
16972 KB |
Output is correct |
62 |
Correct |
176 ms |
16972 KB |
Output is correct |
63 |
Correct |
142 ms |
16956 KB |
Output is correct |
64 |
Correct |
162 ms |
17116 KB |
Output is correct |
65 |
Correct |
167 ms |
16940 KB |
Output is correct |
66 |
Correct |
155 ms |
17016 KB |
Output is correct |
67 |
Correct |
161 ms |
16812 KB |
Output is correct |
68 |
Correct |
165 ms |
16716 KB |
Output is correct |
69 |
Correct |
160 ms |
16888 KB |
Output is correct |
70 |
Correct |
176 ms |
16864 KB |
Output is correct |
71 |
Correct |
0 ms |
212 KB |
Output is correct |
72 |
Correct |
3 ms |
852 KB |
Output is correct |
73 |
Correct |
3 ms |
736 KB |
Output is correct |
74 |
Correct |
3 ms |
852 KB |
Output is correct |
75 |
Correct |
2 ms |
852 KB |
Output is correct |
76 |
Correct |
3 ms |
852 KB |
Output is correct |
77 |
Correct |
3 ms |
852 KB |
Output is correct |
78 |
Correct |
3 ms |
852 KB |
Output is correct |
79 |
Correct |
3 ms |
852 KB |
Output is correct |
80 |
Correct |
171 ms |
16756 KB |
Output is correct |
81 |
Correct |
157 ms |
16728 KB |
Output is correct |
82 |
Correct |
163 ms |
16940 KB |
Output is correct |
83 |
Correct |
168 ms |
17004 KB |
Output is correct |
84 |
Correct |
2 ms |
724 KB |
Output is correct |
85 |
Correct |
2 ms |
724 KB |
Output is correct |
86 |
Correct |
2 ms |
724 KB |
Output is correct |
87 |
Correct |
2 ms |
724 KB |
Output is correct |
88 |
Correct |
2 ms |
724 KB |
Output is correct |
89 |
Correct |
3 ms |
724 KB |
Output is correct |
90 |
Correct |
2 ms |
724 KB |
Output is correct |
91 |
Correct |
3 ms |
852 KB |
Output is correct |
92 |
Correct |
3 ms |
724 KB |
Output is correct |
93 |
Correct |
2 ms |
724 KB |
Output is correct |
94 |
Correct |
1 ms |
340 KB |
Output is correct |
95 |
Correct |
0 ms |
340 KB |
Output is correct |
96 |
Correct |
0 ms |
340 KB |
Output is correct |
97 |
Correct |
1 ms |
340 KB |
Output is correct |
98 |
Correct |
1 ms |
340 KB |
Output is correct |
99 |
Correct |
1 ms |
340 KB |
Output is correct |
100 |
Correct |
1 ms |
340 KB |
Output is correct |
101 |
Correct |
1 ms |
340 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
1 ms |
340 KB |
Output is correct |
104 |
Correct |
8 ms |
2132 KB |
Output is correct |
105 |
Correct |
17 ms |
4168 KB |
Output is correct |
106 |
Correct |
1 ms |
340 KB |
Output is correct |
107 |
Correct |
38 ms |
7500 KB |
Output is correct |
108 |
Correct |
55 ms |
9300 KB |
Output is correct |
109 |
Correct |
1 ms |
340 KB |
Output is correct |
110 |
Correct |
91 ms |
12592 KB |
Output is correct |
111 |
Correct |
111 ms |
14704 KB |
Output is correct |
112 |
Correct |
1 ms |
468 KB |
Output is correct |
113 |
Correct |
171 ms |
17964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1071 ms |
10444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
304 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
308 KB |
Output is correct |
11 |
Correct |
1 ms |
308 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
304 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
308 KB |
Output is correct |
17 |
Correct |
1 ms |
304 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
312 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
2 ms |
468 KB |
Output is correct |
27 |
Correct |
4 ms |
596 KB |
Output is correct |
28 |
Correct |
7 ms |
852 KB |
Output is correct |
29 |
Correct |
2 ms |
468 KB |
Output is correct |
30 |
Correct |
4 ms |
696 KB |
Output is correct |
31 |
Correct |
7 ms |
852 KB |
Output is correct |
32 |
Correct |
2 ms |
468 KB |
Output is correct |
33 |
Correct |
4 ms |
596 KB |
Output is correct |
34 |
Correct |
6 ms |
852 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
340 KB |
Output is correct |
47 |
Correct |
1 ms |
340 KB |
Output is correct |
48 |
Correct |
1 ms |
340 KB |
Output is correct |
49 |
Correct |
1 ms |
340 KB |
Output is correct |
50 |
Correct |
1 ms |
340 KB |
Output is correct |
51 |
Correct |
1 ms |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
212 KB |
Output is correct |
54 |
Correct |
3 ms |
852 KB |
Output is correct |
55 |
Correct |
2 ms |
852 KB |
Output is correct |
56 |
Correct |
18 ms |
852 KB |
Output is correct |
57 |
Correct |
22 ms |
852 KB |
Output is correct |
58 |
Correct |
3 ms |
852 KB |
Output is correct |
59 |
Correct |
3 ms |
828 KB |
Output is correct |
60 |
Correct |
16 ms |
832 KB |
Output is correct |
61 |
Correct |
22 ms |
844 KB |
Output is correct |
62 |
Correct |
3 ms |
852 KB |
Output is correct |
63 |
Correct |
3 ms |
852 KB |
Output is correct |
64 |
Incorrect |
25 ms |
716 KB |
Output isn't correct |
65 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
79 ms |
16460 KB |
Output is correct |
2 |
Correct |
82 ms |
16404 KB |
Output is correct |
3 |
Correct |
45 ms |
10848 KB |
Output is correct |
4 |
Correct |
9 ms |
2900 KB |
Output is correct |
5 |
Correct |
8 ms |
2132 KB |
Output is correct |
6 |
Correct |
17 ms |
4180 KB |
Output is correct |
7 |
Correct |
1 ms |
308 KB |
Output is correct |
8 |
Correct |
37 ms |
7464 KB |
Output is correct |
9 |
Correct |
56 ms |
9348 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
85 ms |
12600 KB |
Output is correct |
12 |
Correct |
108 ms |
14664 KB |
Output is correct |
13 |
Correct |
1 ms |
468 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
304 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
308 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
0 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
304 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
308 KB |
Output is correct |
30 |
Correct |
1 ms |
304 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
312 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
88 ms |
16456 KB |
Output is correct |
40 |
Correct |
86 ms |
16420 KB |
Output is correct |
41 |
Correct |
46 ms |
10952 KB |
Output is correct |
42 |
Correct |
9 ms |
2900 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
0 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
312 KB |
Output is correct |
47 |
Correct |
1 ms |
340 KB |
Output is correct |
48 |
Correct |
1 ms |
340 KB |
Output is correct |
49 |
Correct |
1 ms |
308 KB |
Output is correct |
50 |
Correct |
1 ms |
340 KB |
Output is correct |
51 |
Correct |
1 ms |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
304 KB |
Output is correct |
53 |
Correct |
1 ms |
340 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
1 ms |
340 KB |
Output is correct |
57 |
Correct |
176 ms |
16644 KB |
Output is correct |
58 |
Correct |
156 ms |
16716 KB |
Output is correct |
59 |
Correct |
150 ms |
16756 KB |
Output is correct |
60 |
Correct |
143 ms |
16748 KB |
Output is correct |
61 |
Correct |
161 ms |
16972 KB |
Output is correct |
62 |
Correct |
176 ms |
16972 KB |
Output is correct |
63 |
Correct |
142 ms |
16956 KB |
Output is correct |
64 |
Correct |
162 ms |
17116 KB |
Output is correct |
65 |
Correct |
167 ms |
16940 KB |
Output is correct |
66 |
Correct |
155 ms |
17016 KB |
Output is correct |
67 |
Correct |
161 ms |
16812 KB |
Output is correct |
68 |
Correct |
165 ms |
16716 KB |
Output is correct |
69 |
Correct |
160 ms |
16888 KB |
Output is correct |
70 |
Correct |
176 ms |
16864 KB |
Output is correct |
71 |
Correct |
0 ms |
212 KB |
Output is correct |
72 |
Correct |
3 ms |
852 KB |
Output is correct |
73 |
Correct |
3 ms |
736 KB |
Output is correct |
74 |
Correct |
3 ms |
852 KB |
Output is correct |
75 |
Correct |
2 ms |
852 KB |
Output is correct |
76 |
Correct |
3 ms |
852 KB |
Output is correct |
77 |
Correct |
3 ms |
852 KB |
Output is correct |
78 |
Correct |
3 ms |
852 KB |
Output is correct |
79 |
Correct |
3 ms |
852 KB |
Output is correct |
80 |
Correct |
171 ms |
16756 KB |
Output is correct |
81 |
Correct |
157 ms |
16728 KB |
Output is correct |
82 |
Correct |
163 ms |
16940 KB |
Output is correct |
83 |
Correct |
168 ms |
17004 KB |
Output is correct |
84 |
Correct |
2 ms |
724 KB |
Output is correct |
85 |
Correct |
2 ms |
724 KB |
Output is correct |
86 |
Correct |
2 ms |
724 KB |
Output is correct |
87 |
Correct |
2 ms |
724 KB |
Output is correct |
88 |
Correct |
2 ms |
724 KB |
Output is correct |
89 |
Correct |
3 ms |
724 KB |
Output is correct |
90 |
Correct |
2 ms |
724 KB |
Output is correct |
91 |
Correct |
3 ms |
852 KB |
Output is correct |
92 |
Correct |
3 ms |
724 KB |
Output is correct |
93 |
Correct |
2 ms |
724 KB |
Output is correct |
94 |
Correct |
1 ms |
340 KB |
Output is correct |
95 |
Correct |
0 ms |
340 KB |
Output is correct |
96 |
Correct |
0 ms |
340 KB |
Output is correct |
97 |
Correct |
1 ms |
340 KB |
Output is correct |
98 |
Correct |
1 ms |
340 KB |
Output is correct |
99 |
Correct |
1 ms |
340 KB |
Output is correct |
100 |
Correct |
1 ms |
340 KB |
Output is correct |
101 |
Correct |
1 ms |
340 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
1 ms |
340 KB |
Output is correct |
104 |
Correct |
8 ms |
2132 KB |
Output is correct |
105 |
Correct |
17 ms |
4168 KB |
Output is correct |
106 |
Correct |
1 ms |
340 KB |
Output is correct |
107 |
Correct |
38 ms |
7500 KB |
Output is correct |
108 |
Correct |
55 ms |
9300 KB |
Output is correct |
109 |
Correct |
1 ms |
340 KB |
Output is correct |
110 |
Correct |
91 ms |
12592 KB |
Output is correct |
111 |
Correct |
111 ms |
14704 KB |
Output is correct |
112 |
Correct |
1 ms |
468 KB |
Output is correct |
113 |
Correct |
171 ms |
17964 KB |
Output is correct |
114 |
Execution timed out |
1071 ms |
10444 KB |
Time limit exceeded |
115 |
Halted |
0 ms |
0 KB |
- |