Task: | Kamen |
Sender: | henrikaalto |
Submission time: | 2019-07-27 20:11:55 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | WRONG ANSWER | 0.01 s | details |
#5 | WRONG ANSWER | 0.01 s | details |
#6 | WRONG ANSWER | 0.01 s | details |
#7 | WRONG ANSWER | 0.04 s | details |
#8 | WRONG ANSWER | 0.07 s | details |
#9 | WRONG ANSWER | 0.09 s | details |
#10 | WRONG ANSWER | 0.11 s | details |
Code
#include <bits/stdc++.h> using namespace std; struct pos { int y, x; pos(int Y, int X) { y = Y; x = X; } }; #define N 30100 #define M 35 char board[N][M]; vector<pos> path[M]; int n, m; int empty(int y, int x) { return board[y][x] == '.'; } void gen(int y, int x, vector<pos> &vec) { vec.push_back(pos(y, x)); if (y == n || board[y + 1][x] == 'X') { return ; } if (empty(y + 1, x)) { gen(y + 1, x, vec); } else { if (empty(y, x - 1) && empty(y + 1, x - 1)) { gen(y + 1, x - 1, vec); } else if (empty(y, x + 1) && empty(y + 1, x + 1)) { gen(y + 1, x + 1, vec); } } } int main() { cin >> n >> m; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { cin >> board[i][j]; } } for (int j = 1; j <= m; ++j) { gen(1, j, path[j]); } int amt; cin >> amt; for (int it = 1; it <= amt; ++it) { int x; cin >> x; pos k = path[x].back(); board[k.y][k.x] = 'O'; path[x].pop_back(); k = path[x].back(); path[x].pop_back(); gen(k.y, k.x, path[x]); } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { cout << board[i][j]; } cout << "\n"; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
5 5
..... ..... ..X.. ..... ... |
correct output |
---|
.....
.OO.. OOX.. OO... OOOO. |
user output |
---|
..... .OO.. OOX.. OO... OOOO. |
Test 2
Verdict: WRONG ANSWER
input |
---|
6 20
.................... ..........X.X....... X...XX.............X ...XX..........X.... ... |
correct output |
---|
....................
O...O.....X.X......O X..OXX.........O...X ...XX..........X.... ......OO.O....O...O. ... |
user output |
---|
.................... O...O.....X.X......O X..OXX.........O...X ...XX..........X.... ...... ... Truncated |
Test 3
Verdict: WRONG ANSWER
input |
---|
10 10
.......... .......... .XX....X.. .......... ... |
correct output |
---|
..........
.OO....O.. .XX....X.. .......... .....O...O ... |
user output |
---|
.......... .OO....O.. .XX....X.. .......... .....O...O ... Truncated |
Test 4
Verdict: WRONG ANSWER
input |
---|
15 15
............... ............... ............... ............... ... |
correct output |
---|
...............
............... ............... ............... ......O........ ... |
user output |
---|
............... ............... ............... ............... ......O........ ... Truncated |
Test 5
Verdict: WRONG ANSWER
input |
---|
30 7
....... ....... ......X ....X.. ... |
correct output |
---|
.......
.OOO..O OOOOO.X OOOOX.. OXXXX.. ... |
user output |
---|
....... ...O..O ..OOO.X .OOOX.. .XXXX.. ... Truncated |
Test 6
Verdict: WRONG ANSWER
input |
---|
30 30
................................. |
correct output |
---|
................................. |
user output |
---|
.............................. ...........O.........O........ ...........X.........X.O...O ... Truncated |
Test 7
Verdict: WRONG ANSWER
input |
---|
30000 5
..... ..... ..... ..... ... |
correct output |
---|
.....
..... ..... ..... .O... ... |
user output |
---|
..... ..... ..... ..... .O... ... Truncated |
Test 8
Verdict: WRONG ANSWER
input |
---|
30000 13
............. ............. ...XX...XX... ............. ... |
correct output |
---|
.............
...OO...OO... ...XX...XX... O............ OO...OO...OO. ... |
user output |
---|
............. ...OO...OO... ...XX...XX... O............ OO...OO...OO. ... Truncated |
Test 9
Verdict: WRONG ANSWER
input |
---|
30000 21
..................... ..................... ..................... ..................... ... |
correct output |
---|
.....................
..................... ..................... ..................... ..................... ... |
user output |
---|
..................... ..................... ..................... ..................... .. ... Truncated |
Test 10
Verdict: WRONG ANSWER
input |
---|
30000 30
................................. |
correct output |
---|
................................. |
user output |
---|
.............................. .............................. ............................ ... Truncated |