Task: | Nautilus |
Sender: | a256 |
Submission time: | 2023-04-18 17:43:51 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 29 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 29 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#6 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#7 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#8 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#9 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
#10 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#11 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#12 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#13 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#14 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#15 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
#16 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#17 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#18 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#19 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#20 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#21 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#22 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#23 | RUNTIME ERROR | 0.01 s | 3 | details |
#24 | RUNTIME ERROR | 0.01 s | 3 | details |
#25 | TIME LIMIT EXCEEDED | -- | 3 | details |
#26 | TIME LIMIT EXCEEDED | -- | 3 | details |
#27 | TIME LIMIT EXCEEDED | -- | 3 | details |
#28 | RUNTIME ERROR | 0.01 s | 3 | details |
#29 | RUNTIME ERROR | 0.01 s | 3 | details |
#30 | RUNTIME ERROR | 0.01 s | 3 | details |
#31 | RUNTIME ERROR | 0.01 s | 3 | details |
#32 | TIME LIMIT EXCEEDED | -- | 3 | details |
#33 | RUNTIME ERROR | 0.01 s | 3 | details |
#34 | RUNTIME ERROR | 0.01 s | 3 | details |
#35 | RUNTIME ERROR | 0.01 s | 3 | details |
#36 | RUNTIME ERROR | 0.01 s | 3 | details |
#37 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
#include <bits/stdc++.h> using namespace std; int R,C,M,r,vo[1000][1000],f[500][500][100]; string s[100000],t; int käykö(int y,int x,int i){ if(f[y][x][i]) return false; if(s[y][x]=='#') return false; for(;i<(int)t.size();++i){ int c=t[i]; switch(c){ case 'N': --y; break; case 'S': ++y; break; case 'W': --x; break; case 'E': ++x; break; case '?': if(!käykö(y-1,x,i+1)&&!käykö(y+1,x,i+1)&&!käykö(y,x-1,i+1)&&!käykö(y,x+1,i+1)) return false; break; } if(x<0||x>=C) return false; if(y<0||y>=R) return false; if(s[y][x]=='#') return false; f[y][x][i]=1; } vo[y][x]=1; return true; } int main(){ cin>>R>>C>>M; for(int i=0;i<R;++i){ cin>>s[i]; } cin>>t; for(int y=0;y<R;++y){ for(int x=0;x<C;++x){ käykö(y,x,0); } } for(int y=0;y<R;++y){ for(int x=0;x<C;++x){ r+=vo[y][x]; } } cout<<r<<'\n'; }
Test details
Test 1
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
5 9 7 ...##.... ..#.##..# ..#....## .##...#.. ... |
correct output |
---|
22 |
user output |
---|
15 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 ................................. |
correct output |
---|
8272 |
user output |
---|
8272 |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 .#...#.#..#.....#.........#...... |
correct output |
---|
5 |
user output |
---|
5 |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 .#...##...#...##....##.#.##..#... |
correct output |
---|
1 |
user output |
---|
1 |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 ..#.#.#..###.#.#.##..########.... |
correct output |
---|
1 |
user output |
---|
1 |
Test 6
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
1 |
user output |
---|
1 |
Test 7
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 ##############################... |
correct output |
---|
1 |
user output |
---|
1 |
Test 8
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 100 ................................. |
correct output |
---|
9503 |
user output |
---|
(empty) |
Test 9
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 #..#.##..#....##...#.##.##..#.... |
correct output |
---|
495 |
user output |
---|
(empty) |
Test 10
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 #.#...######.#####.#.##...#.##... |
correct output |
---|
51 |
user output |
---|
(empty) |
Test 11
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
34 |
user output |
---|
(empty) |
Test 12
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 100 ##############################... |
correct output |
---|
19 |
user output |
---|
(empty) |
Test 13
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 ................................. |
correct output |
---|
9801 |
user output |
---|
(empty) |
Test 14
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 ..............#.................. |
correct output |
---|
7479 |
user output |
---|
(empty) |
Test 15
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 #.#.........###.#..#.#..####.#... |
correct output |
---|
5328 |
user output |
---|
(empty) |
Test 16
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
127 |
user output |
---|
(empty) |
Test 17
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 100 ##############################... |
correct output |
---|
19 |
user output |
---|
(empty) |
Test 18
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 ................................. |
correct output |
---|
10000 |
user output |
---|
(empty) |
Test 19
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 ..............#.................. |
correct output |
---|
8047 |
user output |
---|
(empty) |
Test 20
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 #.#...######.#####.#.##...#.##... |
correct output |
---|
3500 |
user output |
---|
(empty) |
Test 21
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
1228 |
user output |
---|
(empty) |
Test 22
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 100 ##############################... |
correct output |
---|
43 |
user output |
---|
(empty) |
Test 23
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 ................................. |
correct output |
---|
249493 |
user output |
---|
(empty) |
Test 24
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 #..#.##..#....##...#.##.##..#.... |
correct output |
---|
222 |
user output |
---|
(empty) |
Test 25
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 .#####....####..###...####.#.#... |
correct output |
---|
1268 |
user output |
---|
(empty) |
Test 26
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
805 |
user output |
---|
(empty) |
Test 27
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ##############################... |
correct output |
---|
349 |
user output |
---|
(empty) |
Test 28
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 ................................. |
correct output |
---|
249999 |
user output |
---|
(empty) |
Test 29
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 ..............#.................. |
correct output |
---|
197917 |
user output |
---|
(empty) |
Test 30
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 #.#.........###.#..#.#..####.#... |
correct output |
---|
79550 |
user output |
---|
(empty) |
Test 31
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
1221 |
user output |
---|
(empty) |
Test 32
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ##############################... |
correct output |
---|
1414 |
user output |
---|
(empty) |
Test 33
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 ................................. |
correct output |
---|
250000 |
user output |
---|
(empty) |
Test 34
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 ..............#.................. |
correct output |
---|
199752 |
user output |
---|
(empty) |
Test 35
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 .#####....####..###...####.#.#... |
correct output |
---|
87691 |
user output |
---|
(empty) |
Test 36
Group: 3
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
30998 |
user output |
---|
(empty) |
Test 37
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ##############################... |
correct output |
---|
1440 |
user output |
---|
(empty) |