# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
796174 |
2023-07-28T07:22:16 Z |
이성호(#10070) |
Security Guard (JOI23_guard) |
C++17 |
|
116 ms |
9940 KB |
#include <iostream>
#include <vector>
using namespace std;
vector<int> adj[200005];
int S[200005];
int N, M, Q;
int main()
{
cin >> N >> M >> Q;
int cnt[2] = {};
for (int i = 1; i <= N; i++) {
cin >> S[i];
cnt[S[i]-1]++;
}
int t;
for (int i = 0; i < 2 * N - 2; i++) cin >> t;
int ans = (N - 1) + max(cnt[1] - 1, 0);
if (S[1] == 1 && cnt[1]) ans++;
if (S[N] == 1 && cnt[1]) ans++;
cout << ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
107 ms |
5716 KB |
Output is correct |
3 |
Correct |
106 ms |
5752 KB |
Output is correct |
4 |
Correct |
116 ms |
5752 KB |
Output is correct |
5 |
Correct |
108 ms |
5680 KB |
Output is correct |
6 |
Correct |
113 ms |
5708 KB |
Output is correct |
7 |
Correct |
107 ms |
5716 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
107 ms |
5716 KB |
Output is correct |
3 |
Correct |
106 ms |
5752 KB |
Output is correct |
4 |
Correct |
116 ms |
5752 KB |
Output is correct |
5 |
Correct |
108 ms |
5680 KB |
Output is correct |
6 |
Correct |
113 ms |
5708 KB |
Output is correct |
7 |
Correct |
107 ms |
5716 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
107 ms |
5716 KB |
Output is correct |
3 |
Correct |
106 ms |
5752 KB |
Output is correct |
4 |
Correct |
116 ms |
5752 KB |
Output is correct |
5 |
Correct |
108 ms |
5680 KB |
Output is correct |
6 |
Correct |
113 ms |
5708 KB |
Output is correct |
7 |
Correct |
107 ms |
5716 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
107 ms |
5716 KB |
Output is correct |
3 |
Correct |
106 ms |
5752 KB |
Output is correct |
4 |
Correct |
116 ms |
5752 KB |
Output is correct |
5 |
Correct |
108 ms |
5680 KB |
Output is correct |
6 |
Correct |
113 ms |
5708 KB |
Output is correct |
7 |
Correct |
107 ms |
5716 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4948 KB |
Output is correct |
2 |
Correct |
107 ms |
5716 KB |
Output is correct |
3 |
Correct |
106 ms |
5752 KB |
Output is correct |
4 |
Correct |
116 ms |
5752 KB |
Output is correct |
5 |
Correct |
108 ms |
5680 KB |
Output is correct |
6 |
Correct |
113 ms |
5708 KB |
Output is correct |
7 |
Correct |
107 ms |
5716 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Runtime error |
6 ms |
9940 KB |
Execution killed with signal 6 |
10 |
Halted |
0 ms |
0 KB |
- |