# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1027456 |
2024-07-19T06:42:10 Z |
김은성(#10950) |
Telegraph (JOI16_telegraph) |
C++17 |
|
47 ms |
16644 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 0x3ffffffffffffff;
bool ch[100009];
int a[100009], c[100009];
vector<int> route;
vector<int> graph[100009];
ll cyc[100009];
ll sum[100009], mx[100009], mx2[100009];
void findcycle(int v){
// printf("v=%d\n", v);
route.push_back(v);
if(ch[v]){
int i;
for(i=0; i<route.size(); i++){
if(route[i] == v)
break;
}
for(; i+1<route.size(); i++){
cyc[route[i+1]] = c[route[i]];
}
return;
}
ch[v] = 1;
findcycle(a[v]);
}
void dfs(int v){
if(ch[v])
return;
route.push_back(v);
ch[v]=1;
for(int i=0; i<graph[v].size(); i++)
dfs(graph[v][i]);
}
int main(){
int n, i, comp = 0;
scanf("%d", &n);
srand(time(NULL));
int b[12] = {0, 5,7,4,10,9,6,2,5,6,7};
for(i=1; i<=n; i++){
scanf("%d %d", &a[i], &c[i]);
/*while(1){
int x = b[i];
a[i] = x;
break;
}
c[i] = rand() % 10 + 1;
//printf("%d %d\n", a[i], c[i]);*/
graph[i].push_back(a[i]);
graph[a[i]].push_back(i);
if(c[i] > mx[a[i]]){
mx2[a[i]] = mx[a[i]];
mx[a[i]] = c[i];
}
else if(c[i] > mx2[a[i]]){
mx2[a[i]] = c[i];
}
sum[a[i]] += c[i];
}
/*vector<int> perm;
ll tans = INF;
for(i=1; i<=n; i++)
perm.push_back(i);
do{
ll now = 0;
for(i=0; i<n; i++){
int x = perm[i], y = perm[(i+1)%n];
if(a[x] != y)
now += c[x];
}
tans = min(now, tans);
} while(next_permutation(perm.begin(), perm.end()));
printf("%lld\n", tans);*/
for(i=1; i<=n; i++){
route.clear();
findcycle(i);
}
ll ans = 0;
memset(ch, 0, sizeof(ch));
for(i=1; i<=n; i++){
if(!ch[i]){
comp++;
route.clear();
dfs(i);
int j;
ll temp = 0, mn = INF;
bool flag=0;
for(j=0; j<route.size(); j++){
//printf("cyc=%d\n", cyc[route[j]]);
if(cyc[route[j]])
mn = min(mn, cyc[route[j]]);
if(!mx2[route[j]])
continue;
temp += sum[route[j]] - mx[route[j]];
//printf("sum=%lld mx=%lld\n", sum[route[j]], mx[route[j]]);
if(cyc[route[j]] && mx[route[j]] && cyc[route[j]] != mx[route[j]])
flag = 1;
if(cyc[route[j]])
mn = min(mn, mx[route[j]] - mx2[route[j]]);
}
//printf("i=%d temp=%lld mn=%lld\n", i, temp, mn);
if(!flag)
temp += mn;
ans += temp;
}
}
if(comp==1){
for(i=1; i<=n; i++){
if(!cyc[i])
break;
}
if(i==n+1){
ans=0;
}
}
printf("%lld\n", ans);
return 0;
}
Compilation message
telegraph.cpp: In function 'void findcycle(int)':
telegraph.cpp:16:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
16 | for(i=0; i<route.size(); i++){
| ~^~~~~~~~~~~~~
telegraph.cpp:20:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
20 | for(; i+1<route.size(); i++){
| ~~~^~~~~~~~~~~~~
telegraph.cpp: In function 'void dfs(int)':
telegraph.cpp:33:19: 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<graph[v].size(); i++)
| ~^~~~~~~~~~~~~~~~
telegraph.cpp: In function 'int main()':
telegraph.cpp:90:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
90 | for(j=0; j<route.size(); j++){
| ~^~~~~~~~~~~~~
telegraph.cpp:40:9: warning: unused variable 'b' [-Wunused-variable]
40 | int b[12] = {0, 5,7,4,10,9,6,2,5,6,7};
| ^
telegraph.cpp:38:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
38 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
telegraph.cpp:42:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
42 | scanf("%d %d", &a[i], &c[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4588 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
2 ms |
4548 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
2920 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
2696 KB |
Output is correct |
16 |
Correct |
1 ms |
4696 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
2876 KB |
Output is correct |
19 |
Correct |
1 ms |
2908 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
2908 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
3676 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
2 ms |
4536 KB |
Output is correct |
28 |
Correct |
1 ms |
2908 KB |
Output is correct |
29 |
Correct |
1 ms |
3676 KB |
Output is correct |
30 |
Correct |
1 ms |
2908 KB |
Output is correct |
31 |
Correct |
1 ms |
2908 KB |
Output is correct |
32 |
Correct |
2 ms |
2908 KB |
Output is correct |
33 |
Correct |
1 ms |
4444 KB |
Output is correct |
34 |
Correct |
1 ms |
3676 KB |
Output is correct |
35 |
Correct |
1 ms |
3676 KB |
Output is correct |
36 |
Correct |
1 ms |
2908 KB |
Output is correct |
37 |
Correct |
1 ms |
2908 KB |
Output is correct |
38 |
Correct |
1 ms |
3644 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4548 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
3676 KB |
Output is correct |
45 |
Correct |
2 ms |
3676 KB |
Output is correct |
46 |
Correct |
2 ms |
3676 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4588 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
2 ms |
4548 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
2920 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
2696 KB |
Output is correct |
16 |
Correct |
1 ms |
4696 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
2876 KB |
Output is correct |
19 |
Correct |
1 ms |
2908 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
2908 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
3676 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
2 ms |
4536 KB |
Output is correct |
28 |
Correct |
1 ms |
2908 KB |
Output is correct |
29 |
Correct |
1 ms |
3676 KB |
Output is correct |
30 |
Correct |
1 ms |
2908 KB |
Output is correct |
31 |
Correct |
1 ms |
2908 KB |
Output is correct |
32 |
Correct |
2 ms |
2908 KB |
Output is correct |
33 |
Correct |
1 ms |
4444 KB |
Output is correct |
34 |
Correct |
1 ms |
3676 KB |
Output is correct |
35 |
Correct |
1 ms |
3676 KB |
Output is correct |
36 |
Correct |
1 ms |
2908 KB |
Output is correct |
37 |
Correct |
1 ms |
2908 KB |
Output is correct |
38 |
Correct |
1 ms |
3644 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4548 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
3676 KB |
Output is correct |
45 |
Correct |
2 ms |
3676 KB |
Output is correct |
46 |
Correct |
2 ms |
3676 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4444 KB |
Output is correct |
49 |
Correct |
1 ms |
4548 KB |
Output is correct |
50 |
Correct |
1 ms |
4548 KB |
Output is correct |
51 |
Correct |
1 ms |
3672 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
3676 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4444 KB |
Output is correct |
56 |
Correct |
1 ms |
3676 KB |
Output is correct |
57 |
Correct |
1 ms |
4440 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
3676 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
1 ms |
4444 KB |
Output is correct |
64 |
Correct |
1 ms |
4444 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
1 ms |
3676 KB |
Output is correct |
67 |
Correct |
1 ms |
4444 KB |
Output is correct |
68 |
Correct |
1 ms |
4444 KB |
Output is correct |
69 |
Correct |
1 ms |
4508 KB |
Output is correct |
70 |
Correct |
1 ms |
4444 KB |
Output is correct |
71 |
Correct |
1 ms |
3652 KB |
Output is correct |
72 |
Correct |
1 ms |
4444 KB |
Output is correct |
73 |
Correct |
1 ms |
4444 KB |
Output is correct |
74 |
Correct |
1 ms |
3676 KB |
Output is correct |
75 |
Correct |
1 ms |
4444 KB |
Output is correct |
76 |
Correct |
1 ms |
3676 KB |
Output is correct |
77 |
Correct |
1 ms |
3676 KB |
Output is correct |
78 |
Correct |
1 ms |
3676 KB |
Output is correct |
79 |
Correct |
1 ms |
3676 KB |
Output is correct |
80 |
Correct |
1 ms |
4444 KB |
Output is correct |
81 |
Correct |
1 ms |
4444 KB |
Output is correct |
82 |
Correct |
1 ms |
3676 KB |
Output is correct |
83 |
Correct |
1 ms |
3676 KB |
Output is correct |
84 |
Correct |
1 ms |
4444 KB |
Output is correct |
85 |
Correct |
1 ms |
4444 KB |
Output is correct |
86 |
Correct |
1 ms |
3676 KB |
Output is correct |
87 |
Correct |
1 ms |
3676 KB |
Output is correct |
88 |
Correct |
1 ms |
4444 KB |
Output is correct |
89 |
Correct |
1 ms |
3676 KB |
Output is correct |
90 |
Correct |
1 ms |
3676 KB |
Output is correct |
91 |
Correct |
1 ms |
4444 KB |
Output is correct |
92 |
Correct |
1 ms |
4592 KB |
Output is correct |
93 |
Correct |
1 ms |
3676 KB |
Output is correct |
94 |
Correct |
1 ms |
4804 KB |
Output is correct |
95 |
Correct |
1 ms |
4444 KB |
Output is correct |
96 |
Correct |
1 ms |
4444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4588 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
2 ms |
4548 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
2920 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
2696 KB |
Output is correct |
16 |
Correct |
1 ms |
4696 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
2876 KB |
Output is correct |
19 |
Correct |
1 ms |
2908 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
2908 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
3676 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
2 ms |
4536 KB |
Output is correct |
28 |
Correct |
1 ms |
2908 KB |
Output is correct |
29 |
Correct |
1 ms |
3676 KB |
Output is correct |
30 |
Correct |
1 ms |
2908 KB |
Output is correct |
31 |
Correct |
1 ms |
2908 KB |
Output is correct |
32 |
Correct |
2 ms |
2908 KB |
Output is correct |
33 |
Correct |
1 ms |
4444 KB |
Output is correct |
34 |
Correct |
1 ms |
3676 KB |
Output is correct |
35 |
Correct |
1 ms |
3676 KB |
Output is correct |
36 |
Correct |
1 ms |
2908 KB |
Output is correct |
37 |
Correct |
1 ms |
2908 KB |
Output is correct |
38 |
Correct |
1 ms |
3644 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4548 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
3676 KB |
Output is correct |
45 |
Correct |
2 ms |
3676 KB |
Output is correct |
46 |
Correct |
2 ms |
3676 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4444 KB |
Output is correct |
49 |
Correct |
1 ms |
4548 KB |
Output is correct |
50 |
Correct |
1 ms |
4548 KB |
Output is correct |
51 |
Correct |
1 ms |
3672 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
3676 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4444 KB |
Output is correct |
56 |
Correct |
1 ms |
3676 KB |
Output is correct |
57 |
Correct |
1 ms |
4440 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
3676 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
1 ms |
4444 KB |
Output is correct |
64 |
Correct |
1 ms |
4444 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
1 ms |
3676 KB |
Output is correct |
67 |
Correct |
1 ms |
4444 KB |
Output is correct |
68 |
Correct |
1 ms |
4444 KB |
Output is correct |
69 |
Correct |
1 ms |
4508 KB |
Output is correct |
70 |
Correct |
1 ms |
4444 KB |
Output is correct |
71 |
Correct |
1 ms |
3652 KB |
Output is correct |
72 |
Correct |
1 ms |
4444 KB |
Output is correct |
73 |
Correct |
1 ms |
4444 KB |
Output is correct |
74 |
Correct |
1 ms |
3676 KB |
Output is correct |
75 |
Correct |
1 ms |
4444 KB |
Output is correct |
76 |
Correct |
1 ms |
3676 KB |
Output is correct |
77 |
Correct |
1 ms |
3676 KB |
Output is correct |
78 |
Correct |
1 ms |
3676 KB |
Output is correct |
79 |
Correct |
1 ms |
3676 KB |
Output is correct |
80 |
Correct |
1 ms |
4444 KB |
Output is correct |
81 |
Correct |
1 ms |
4444 KB |
Output is correct |
82 |
Correct |
1 ms |
3676 KB |
Output is correct |
83 |
Correct |
1 ms |
3676 KB |
Output is correct |
84 |
Correct |
1 ms |
4444 KB |
Output is correct |
85 |
Correct |
1 ms |
4444 KB |
Output is correct |
86 |
Correct |
1 ms |
3676 KB |
Output is correct |
87 |
Correct |
1 ms |
3676 KB |
Output is correct |
88 |
Correct |
1 ms |
4444 KB |
Output is correct |
89 |
Correct |
1 ms |
3676 KB |
Output is correct |
90 |
Correct |
1 ms |
3676 KB |
Output is correct |
91 |
Correct |
1 ms |
4444 KB |
Output is correct |
92 |
Correct |
1 ms |
4592 KB |
Output is correct |
93 |
Correct |
1 ms |
3676 KB |
Output is correct |
94 |
Correct |
1 ms |
4804 KB |
Output is correct |
95 |
Correct |
1 ms |
4444 KB |
Output is correct |
96 |
Correct |
1 ms |
4444 KB |
Output is correct |
97 |
Correct |
2 ms |
4184 KB |
Output is correct |
98 |
Correct |
2 ms |
3932 KB |
Output is correct |
99 |
Correct |
2 ms |
4700 KB |
Output is correct |
100 |
Correct |
2 ms |
3816 KB |
Output is correct |
101 |
Correct |
2 ms |
4700 KB |
Output is correct |
102 |
Correct |
2 ms |
3932 KB |
Output is correct |
103 |
Correct |
3 ms |
3932 KB |
Output is correct |
104 |
Correct |
2 ms |
4756 KB |
Output is correct |
105 |
Correct |
2 ms |
3932 KB |
Output is correct |
106 |
Correct |
2 ms |
4084 KB |
Output is correct |
107 |
Correct |
2 ms |
3912 KB |
Output is correct |
108 |
Correct |
2 ms |
4700 KB |
Output is correct |
109 |
Correct |
2 ms |
3932 KB |
Output is correct |
110 |
Correct |
2 ms |
3812 KB |
Output is correct |
111 |
Correct |
2 ms |
4700 KB |
Output is correct |
112 |
Correct |
2 ms |
4700 KB |
Output is correct |
113 |
Correct |
2 ms |
4700 KB |
Output is correct |
114 |
Correct |
2 ms |
4700 KB |
Output is correct |
115 |
Correct |
2 ms |
4700 KB |
Output is correct |
116 |
Correct |
2 ms |
3676 KB |
Output is correct |
117 |
Correct |
2 ms |
3676 KB |
Output is correct |
118 |
Correct |
2 ms |
4700 KB |
Output is correct |
119 |
Correct |
2 ms |
3932 KB |
Output is correct |
120 |
Correct |
2 ms |
4700 KB |
Output is correct |
121 |
Correct |
2 ms |
4700 KB |
Output is correct |
122 |
Correct |
2 ms |
3768 KB |
Output is correct |
123 |
Correct |
2 ms |
4556 KB |
Output is correct |
124 |
Correct |
2 ms |
4696 KB |
Output is correct |
125 |
Correct |
1 ms |
4700 KB |
Output is correct |
126 |
Correct |
3 ms |
3676 KB |
Output is correct |
127 |
Correct |
2 ms |
4696 KB |
Output is correct |
128 |
Correct |
2 ms |
4700 KB |
Output is correct |
129 |
Correct |
3 ms |
3928 KB |
Output is correct |
130 |
Correct |
2 ms |
4728 KB |
Output is correct |
131 |
Correct |
2 ms |
4700 KB |
Output is correct |
132 |
Correct |
2 ms |
4684 KB |
Output is correct |
133 |
Correct |
2 ms |
4696 KB |
Output is correct |
134 |
Correct |
2 ms |
4700 KB |
Output is correct |
135 |
Correct |
2 ms |
4700 KB |
Output is correct |
136 |
Correct |
2 ms |
3672 KB |
Output is correct |
137 |
Correct |
2 ms |
3672 KB |
Output is correct |
138 |
Correct |
1 ms |
4444 KB |
Output is correct |
139 |
Correct |
1 ms |
4444 KB |
Output is correct |
140 |
Correct |
1 ms |
4440 KB |
Output is correct |
141 |
Correct |
2 ms |
4700 KB |
Output is correct |
142 |
Correct |
1 ms |
4536 KB |
Output is correct |
143 |
Correct |
1 ms |
4700 KB |
Output is correct |
144 |
Correct |
2 ms |
3676 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
1 ms |
4588 KB |
Output is correct |
4 |
Correct |
1 ms |
4444 KB |
Output is correct |
5 |
Correct |
1 ms |
4444 KB |
Output is correct |
6 |
Correct |
2 ms |
4548 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
2920 KB |
Output is correct |
11 |
Correct |
1 ms |
4444 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
14 |
Correct |
1 ms |
4444 KB |
Output is correct |
15 |
Correct |
1 ms |
2696 KB |
Output is correct |
16 |
Correct |
1 ms |
4696 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
2876 KB |
Output is correct |
19 |
Correct |
1 ms |
2908 KB |
Output is correct |
20 |
Correct |
1 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4444 KB |
Output is correct |
22 |
Correct |
1 ms |
4444 KB |
Output is correct |
23 |
Correct |
1 ms |
2908 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
1 ms |
3676 KB |
Output is correct |
26 |
Correct |
1 ms |
4440 KB |
Output is correct |
27 |
Correct |
2 ms |
4536 KB |
Output is correct |
28 |
Correct |
1 ms |
2908 KB |
Output is correct |
29 |
Correct |
1 ms |
3676 KB |
Output is correct |
30 |
Correct |
1 ms |
2908 KB |
Output is correct |
31 |
Correct |
1 ms |
2908 KB |
Output is correct |
32 |
Correct |
2 ms |
2908 KB |
Output is correct |
33 |
Correct |
1 ms |
4444 KB |
Output is correct |
34 |
Correct |
1 ms |
3676 KB |
Output is correct |
35 |
Correct |
1 ms |
3676 KB |
Output is correct |
36 |
Correct |
1 ms |
2908 KB |
Output is correct |
37 |
Correct |
1 ms |
2908 KB |
Output is correct |
38 |
Correct |
1 ms |
3644 KB |
Output is correct |
39 |
Correct |
1 ms |
4440 KB |
Output is correct |
40 |
Correct |
1 ms |
4548 KB |
Output is correct |
41 |
Correct |
1 ms |
4444 KB |
Output is correct |
42 |
Correct |
1 ms |
4444 KB |
Output is correct |
43 |
Correct |
1 ms |
4444 KB |
Output is correct |
44 |
Correct |
1 ms |
3676 KB |
Output is correct |
45 |
Correct |
2 ms |
3676 KB |
Output is correct |
46 |
Correct |
2 ms |
3676 KB |
Output is correct |
47 |
Correct |
1 ms |
4444 KB |
Output is correct |
48 |
Correct |
1 ms |
4444 KB |
Output is correct |
49 |
Correct |
1 ms |
4548 KB |
Output is correct |
50 |
Correct |
1 ms |
4548 KB |
Output is correct |
51 |
Correct |
1 ms |
3672 KB |
Output is correct |
52 |
Correct |
1 ms |
4444 KB |
Output is correct |
53 |
Correct |
1 ms |
3676 KB |
Output is correct |
54 |
Correct |
1 ms |
4444 KB |
Output is correct |
55 |
Correct |
1 ms |
4444 KB |
Output is correct |
56 |
Correct |
1 ms |
3676 KB |
Output is correct |
57 |
Correct |
1 ms |
4440 KB |
Output is correct |
58 |
Correct |
1 ms |
4444 KB |
Output is correct |
59 |
Correct |
1 ms |
4444 KB |
Output is correct |
60 |
Correct |
1 ms |
3676 KB |
Output is correct |
61 |
Correct |
1 ms |
4444 KB |
Output is correct |
62 |
Correct |
1 ms |
4444 KB |
Output is correct |
63 |
Correct |
1 ms |
4444 KB |
Output is correct |
64 |
Correct |
1 ms |
4444 KB |
Output is correct |
65 |
Correct |
1 ms |
4444 KB |
Output is correct |
66 |
Correct |
1 ms |
3676 KB |
Output is correct |
67 |
Correct |
1 ms |
4444 KB |
Output is correct |
68 |
Correct |
1 ms |
4444 KB |
Output is correct |
69 |
Correct |
1 ms |
4508 KB |
Output is correct |
70 |
Correct |
1 ms |
4444 KB |
Output is correct |
71 |
Correct |
1 ms |
3652 KB |
Output is correct |
72 |
Correct |
1 ms |
4444 KB |
Output is correct |
73 |
Correct |
1 ms |
4444 KB |
Output is correct |
74 |
Correct |
1 ms |
3676 KB |
Output is correct |
75 |
Correct |
1 ms |
4444 KB |
Output is correct |
76 |
Correct |
1 ms |
3676 KB |
Output is correct |
77 |
Correct |
1 ms |
3676 KB |
Output is correct |
78 |
Correct |
1 ms |
3676 KB |
Output is correct |
79 |
Correct |
1 ms |
3676 KB |
Output is correct |
80 |
Correct |
1 ms |
4444 KB |
Output is correct |
81 |
Correct |
1 ms |
4444 KB |
Output is correct |
82 |
Correct |
1 ms |
3676 KB |
Output is correct |
83 |
Correct |
1 ms |
3676 KB |
Output is correct |
84 |
Correct |
1 ms |
4444 KB |
Output is correct |
85 |
Correct |
1 ms |
4444 KB |
Output is correct |
86 |
Correct |
1 ms |
3676 KB |
Output is correct |
87 |
Correct |
1 ms |
3676 KB |
Output is correct |
88 |
Correct |
1 ms |
4444 KB |
Output is correct |
89 |
Correct |
1 ms |
3676 KB |
Output is correct |
90 |
Correct |
1 ms |
3676 KB |
Output is correct |
91 |
Correct |
1 ms |
4444 KB |
Output is correct |
92 |
Correct |
1 ms |
4592 KB |
Output is correct |
93 |
Correct |
1 ms |
3676 KB |
Output is correct |
94 |
Correct |
1 ms |
4804 KB |
Output is correct |
95 |
Correct |
1 ms |
4444 KB |
Output is correct |
96 |
Correct |
1 ms |
4444 KB |
Output is correct |
97 |
Correct |
2 ms |
4184 KB |
Output is correct |
98 |
Correct |
2 ms |
3932 KB |
Output is correct |
99 |
Correct |
2 ms |
4700 KB |
Output is correct |
100 |
Correct |
2 ms |
3816 KB |
Output is correct |
101 |
Correct |
2 ms |
4700 KB |
Output is correct |
102 |
Correct |
2 ms |
3932 KB |
Output is correct |
103 |
Correct |
3 ms |
3932 KB |
Output is correct |
104 |
Correct |
2 ms |
4756 KB |
Output is correct |
105 |
Correct |
2 ms |
3932 KB |
Output is correct |
106 |
Correct |
2 ms |
4084 KB |
Output is correct |
107 |
Correct |
2 ms |
3912 KB |
Output is correct |
108 |
Correct |
2 ms |
4700 KB |
Output is correct |
109 |
Correct |
2 ms |
3932 KB |
Output is correct |
110 |
Correct |
2 ms |
3812 KB |
Output is correct |
111 |
Correct |
2 ms |
4700 KB |
Output is correct |
112 |
Correct |
2 ms |
4700 KB |
Output is correct |
113 |
Correct |
2 ms |
4700 KB |
Output is correct |
114 |
Correct |
2 ms |
4700 KB |
Output is correct |
115 |
Correct |
2 ms |
4700 KB |
Output is correct |
116 |
Correct |
2 ms |
3676 KB |
Output is correct |
117 |
Correct |
2 ms |
3676 KB |
Output is correct |
118 |
Correct |
2 ms |
4700 KB |
Output is correct |
119 |
Correct |
2 ms |
3932 KB |
Output is correct |
120 |
Correct |
2 ms |
4700 KB |
Output is correct |
121 |
Correct |
2 ms |
4700 KB |
Output is correct |
122 |
Correct |
2 ms |
3768 KB |
Output is correct |
123 |
Correct |
2 ms |
4556 KB |
Output is correct |
124 |
Correct |
2 ms |
4696 KB |
Output is correct |
125 |
Correct |
1 ms |
4700 KB |
Output is correct |
126 |
Correct |
3 ms |
3676 KB |
Output is correct |
127 |
Correct |
2 ms |
4696 KB |
Output is correct |
128 |
Correct |
2 ms |
4700 KB |
Output is correct |
129 |
Correct |
3 ms |
3928 KB |
Output is correct |
130 |
Correct |
2 ms |
4728 KB |
Output is correct |
131 |
Correct |
2 ms |
4700 KB |
Output is correct |
132 |
Correct |
2 ms |
4684 KB |
Output is correct |
133 |
Correct |
2 ms |
4696 KB |
Output is correct |
134 |
Correct |
2 ms |
4700 KB |
Output is correct |
135 |
Correct |
2 ms |
4700 KB |
Output is correct |
136 |
Correct |
2 ms |
3672 KB |
Output is correct |
137 |
Correct |
2 ms |
3672 KB |
Output is correct |
138 |
Correct |
1 ms |
4444 KB |
Output is correct |
139 |
Correct |
1 ms |
4444 KB |
Output is correct |
140 |
Correct |
1 ms |
4440 KB |
Output is correct |
141 |
Correct |
2 ms |
4700 KB |
Output is correct |
142 |
Correct |
1 ms |
4536 KB |
Output is correct |
143 |
Correct |
1 ms |
4700 KB |
Output is correct |
144 |
Correct |
2 ms |
3676 KB |
Output is correct |
145 |
Correct |
35 ms |
11992 KB |
Output is correct |
146 |
Correct |
37 ms |
11996 KB |
Output is correct |
147 |
Correct |
31 ms |
11984 KB |
Output is correct |
148 |
Correct |
37 ms |
11856 KB |
Output is correct |
149 |
Correct |
36 ms |
11868 KB |
Output is correct |
150 |
Correct |
47 ms |
16644 KB |
Output is correct |
151 |
Correct |
39 ms |
16592 KB |
Output is correct |
152 |
Correct |
39 ms |
16592 KB |
Output is correct |
153 |
Correct |
38 ms |
16596 KB |
Output is correct |
154 |
Correct |
39 ms |
16596 KB |
Output is correct |
155 |
Correct |
46 ms |
14288 KB |
Output is correct |
156 |
Correct |
32 ms |
14300 KB |
Output is correct |
157 |
Correct |
38 ms |
14212 KB |
Output is correct |
158 |
Correct |
34 ms |
14296 KB |
Output is correct |
159 |
Correct |
38 ms |
14292 KB |
Output is correct |
160 |
Correct |
41 ms |
14076 KB |
Output is correct |
161 |
Correct |
36 ms |
14116 KB |
Output is correct |
162 |
Correct |
32 ms |
13436 KB |
Output is correct |
163 |
Correct |
31 ms |
13380 KB |
Output is correct |
164 |
Correct |
28 ms |
11276 KB |
Output is correct |
165 |
Correct |
29 ms |
11376 KB |
Output is correct |
166 |
Correct |
37 ms |
14040 KB |
Output is correct |
167 |
Correct |
36 ms |
14044 KB |
Output is correct |
168 |
Correct |
29 ms |
10844 KB |
Output is correct |
169 |
Correct |
28 ms |
11276 KB |
Output is correct |
170 |
Correct |
33 ms |
11020 KB |
Output is correct |
171 |
Correct |
32 ms |
11012 KB |
Output is correct |
172 |
Correct |
31 ms |
11224 KB |
Output is correct |
173 |
Correct |
30 ms |
11220 KB |
Output is correct |
174 |
Correct |
30 ms |
11392 KB |
Output is correct |
175 |
Correct |
29 ms |
11228 KB |
Output is correct |
176 |
Correct |
29 ms |
11120 KB |
Output is correct |
177 |
Correct |
33 ms |
15824 KB |
Output is correct |
178 |
Correct |
32 ms |
15744 KB |
Output is correct |
179 |
Correct |
35 ms |
15700 KB |
Output is correct |
180 |
Correct |
42 ms |
15784 KB |
Output is correct |
181 |
Correct |
23 ms |
10216 KB |
Output is correct |
182 |
Correct |
22 ms |
9416 KB |
Output is correct |
183 |
Correct |
37 ms |
11460 KB |
Output is correct |
184 |
Correct |
34 ms |
11348 KB |
Output is correct |
185 |
Correct |
26 ms |
9052 KB |
Output is correct |
186 |
Correct |
17 ms |
8328 KB |
Output is correct |
187 |
Correct |
9 ms |
5468 KB |
Output is correct |
188 |
Correct |
35 ms |
11824 KB |
Output is correct |
189 |
Correct |
29 ms |
10064 KB |
Output is correct |
190 |
Correct |
24 ms |
10624 KB |
Output is correct |
191 |
Correct |
14 ms |
7260 KB |
Output is correct |
192 |
Correct |
4 ms |
3676 KB |
Output is correct |