# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
522847 |
2022-02-06T03:52:57 Z |
KoD |
Sajam (COCI18_sajam) |
C++17 |
|
16 ms |
5108 KB |
#include <bits/stdc++.h>
using std::vector;
using std::array;
using std::pair;
using std::tuple;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int N, K;
std::cin >> N >> K;
vector<int> grid(N * N);
for (auto& x : grid) {
char c;
std::cin >> c;
x = (c == 'o');
}
const auto cell = [&](const int i, const int j) {
return i * N + j;
};
for (int i = 1; i < N; ++i) {
for (int j = 1; j < N; ++j) {
int sum = 0;
sum += grid[cell(i, j)];
sum += grid[cell(i, j - 1)];
sum += grid[cell(i - 1, j)];
sum += grid[cell(i - 1, j - 1)];
if (sum % 2 == 1) {
std::cout << "NE\n";
return 0;
}
}
}
std::cout << "DA\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
4 ms |
1092 KB |
Output is correct |
3 |
Correct |
5 ms |
1600 KB |
Output is correct |
4 |
Correct |
13 ms |
4300 KB |
Output is correct |
5 |
Correct |
5 ms |
1612 KB |
Output is correct |
6 |
Correct |
2 ms |
716 KB |
Output is correct |
7 |
Correct |
4 ms |
1484 KB |
Output is correct |
8 |
Correct |
12 ms |
4428 KB |
Output is correct |
9 |
Correct |
1 ms |
460 KB |
Output is correct |
10 |
Correct |
13 ms |
4556 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
3004 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
3916 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2328 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
5108 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |