Task: | Nautilus |
Sender: | vgtcross |
Submission time: | 2023-04-18 14:32:05 +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.00 s | 2, 3 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#6 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#7 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#8 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#9 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#10 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#11 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#12 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#13 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#14 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#15 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#16 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#17 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#18 | ACCEPTED | 0.01 s | 2, 3 | details |
#19 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#20 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#21 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#22 | ACCEPTED | 0.00 s | 2, 3 | details |
#23 | TIME LIMIT EXCEEDED | -- | 3 | details |
#24 | WRONG ANSWER | 0.02 s | 3 | details |
#25 | WRONG ANSWER | 0.01 s | 3 | details |
#26 | WRONG ANSWER | 0.01 s | 3 | details |
#27 | WRONG ANSWER | 0.01 s | 3 | details |
#28 | TIME LIMIT EXCEEDED | -- | 3 | details |
#29 | WRONG ANSWER | 0.10 s | 3 | details |
#30 | WRONG ANSWER | 0.03 s | 3 | details |
#31 | WRONG ANSWER | 0.01 s | 3 | details |
#32 | WRONG ANSWER | 0.01 s | 3 | details |
#33 | TIME LIMIT EXCEEDED | -- | 3 | details |
#34 | TIME LIMIT EXCEEDED | -- | 3 | details |
#35 | TIME LIMIT EXCEEDED | -- | 3 | details |
#36 | TIME LIMIT EXCEEDED | -- | 3 | details |
#37 | ACCEPTED | 0.08 s | 3 | details |
Code
#include <bits/stdc++.h> #define fi first #define se second using namespace std; using ll = long long; using pii = pair<int, int>; void solve() { map<char, pii> mp; mp['N'] = {-1, 0}; mp['E'] = {0, 1}; mp['S'] = {1, 0}; mp['W'] = {0, -1}; int n, m, l; cin >> n >> m >> l; vector<string> g(n); for (int i = 0; i < n; ++i) { cin >> g[i]; } string s; cin >> s; int ans = 0; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { pii pos = {i, j}; if (g[i][j] == '#') continue; bool good = 1; for (char c: s) { pos.fi += mp[c].fi; pos.se += mp[c].se; if (pos.fi < 0 || pos.fi >= n || pos.se < 0 || pos.se >= m || g[pos.fi][pos.se] == '#') { good = 0; break; } } ans += good; } } cout << ans << '\n'; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }
Test details
Test 1
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
5 9 7 ...##.... ..#.##..# ..#....## .##...#.. ... |
correct output |
---|
22 |
user output |
---|
1 |
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: WRONG ANSWER
input |
---|
100 100 100 ................................. |
correct output |
---|
9503 |
user output |
---|
8277 |
Test 9
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 #..#.##..#....##...#.##.##..#.... |
correct output |
---|
495 |
user output |
---|
1 |
Test 10
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 #.#...######.#####.#.##...#.##... |
correct output |
---|
51 |
user output |
---|
0 |
Test 11
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
34 |
user output |
---|
0 |
Test 12
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 ##############################... |
correct output |
---|
19 |
user output |
---|
0 |
Test 13
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 ................................. |
correct output |
---|
9801 |
user output |
---|
8835 |
Test 14
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 ..............#.................. |
correct output |
---|
7479 |
user output |
---|
65 |
Test 15
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 #.#.........###.#..#.#..####.#... |
correct output |
---|
5328 |
user output |
---|
0 |
Test 16
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
127 |
user output |
---|
8 |
Test 17
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 ##############################... |
correct output |
---|
19 |
user output |
---|
0 |
Test 18
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 ................................. |
correct output |
---|
10000 |
user output |
---|
10000 |
Test 19
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 ..............#.................. |
correct output |
---|
8047 |
user output |
---|
8063 |
Test 20
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 #.#...######.#####.#.##...#.##... |
correct output |
---|
3500 |
user output |
---|
4062 |
Test 21
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 .#.#.###########..#.###.######... |
correct output |
---|
1228 |
user output |
---|
2054 |
Test 22
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 100 100 ##############################... |
correct output |
---|
43 |
user output |
---|
43 |
Test 23
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ................................. |
correct output |
---|
249493 |
user output |
---|
(empty) |
Test 24
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 #..#.##..#....##...#.##.##..#.... |
correct output |
---|
222 |
user output |
---|
0 |
Test 25
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 .#####....####..###...####.#.#... |
correct output |
---|
1268 |
user output |
---|
0 |
Test 26
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
805 |
user output |
---|
0 |
Test 27
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 ##############################... |
correct output |
---|
349 |
user output |
---|
0 |
Test 28
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ................................. |
correct output |
---|
249999 |
user output |
---|
(empty) |
Test 29
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 ..............#.................. |
correct output |
---|
197917 |
user output |
---|
0 |
Test 30
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 #.#.........###.#..#.#..####.#... |
correct output |
---|
79550 |
user output |
---|
0 |
Test 31
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
1221 |
user output |
---|
0 |
Test 32
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 500 5000 ##############################... |
correct output |
---|
1414 |
user output |
---|
0 |
Test 33
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ................................. |
correct output |
---|
250000 |
user output |
---|
(empty) |
Test 34
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 ..............#.................. |
correct output |
---|
199752 |
user output |
---|
(empty) |
Test 35
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 .#####....####..###...####.#.#... |
correct output |
---|
87691 |
user output |
---|
(empty) |
Test 36
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 500 5000 #.#####.##..#####.####..######... |
correct output |
---|
30998 |
user output |
---|
(empty) |
Test 37
Group: 3
Verdict: ACCEPTED
input |
---|
500 500 5000 ##############################... |
correct output |
---|
1440 |
user output |
---|
1440 |