Task: | Peg |
Sender: | henrikaalto |
Submission time: | 2019-07-29 13:52:12 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | WRONG ANSWER | 0.01 s | details |
#6 | ACCEPTED | 0.01 s | details |
Code
#include<bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() using ii=long long; char v[15][15]; int main() { const int N = 7; for (int i = 1; i <= N; ++i) { for(int j = 1; j <= N; ++j) { cin >> v[i][j]; } } int r = 0; for (int i = 1; i <= N; ++i) { for (int j = 1; j <= N; ++j) { if (v[i][j] != 'o') continue; if (v[i + 2][j] == '.' && v[i + 1][j] == 'o') { ++r; } if (i > 2 && v[i - 2][j] == '.' && v[i - 1][j] == 'o') { ++r; } if (v[i][j + 2] == '.' && v[i][j + 1] == 'o') { ++r; } if (j > 2 && v[i][j - 2] == '.' && v[i][j - 1] == 'o') { ++r; } } } cout << r << "\n"; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
o.o
.o. o.ooo.o .oo.oo. o.ooo.o ... |
correct output |
---|
16 |
user output |
---|
13 |
Test 2
Verdict: WRONG ANSWER
input |
---|
...
o.o .ooooo. ..o.o.. .ooooo. ... |
correct output |
---|
8 |
user output |
---|
4 |
Test 3
Verdict: WRONG ANSWER
input |
---|
oo.
.oo .oo.oo. o.oo.oo oo.oo.o ... |
correct output |
---|
26 |
user output |
---|
21 |
Test 4
Verdict: ACCEPTED
input |
---|
...
..o ....... ....... ....... ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 5
Verdict: WRONG ANSWER
input |
---|
o.o
oo. o...o.. oo.o..o .oo.oo. ... |
correct output |
---|
13 |
user output |
---|
11 |
Test 6
Verdict: ACCEPTED
input |
---|
.oo
.oo oo.o.oo o...... oo.oo.o ... |
correct output |
---|
11 |
user output |
---|
11 |