Submission #60951018
Source Code Expand
Copy
#include <bits/stdc++.h>#include <iostream>#include <vector>#include <set>using namespace std;int main() {int H, W, X, Y;cin >> H >> W >> X >> Y;vector<string> grid(H);for (int i = 0; i < H; ++i) {cin >> grid[i];}string T;cin >> T;int dx[] = {-1, 1, 0, 0};int dy[] = {0, 0, -1, 1};char directions[] = {'U', 'D', 'L', 'R'};int x = X - 1;int y = Y - 1;set<pair<int, int>> visited_houses;
#include <bits/stdc++.h> #include <iostream> #include <vector> #include <set> using namespace std; int main() { int H, W, X, Y; cin >> H >> W >> X >> Y; vector<string> grid(H); for (int i = 0; i < H; ++i) { cin >> grid[i]; } string T; cin >> T; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; char directions[] = {'U', 'D', 'L', 'R'}; int x = X - 1; int y = Y - 1; set<pair<int, int>> visited_houses; for (char move : T) { int nx = x, ny = y; for (int i = 0; i < 4; ++i) { if (move == directions[i]) { nx = x + dx[i]; ny = y + dy[i]; break; } } if (grid[nx][ny] != '#') { x = nx; y = ny; if (grid[x][y] == '@') { visited_houses.insert({x, y}); } } } cout << x + 1 << " " << y + 1 << " " << visited_houses.size() << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Santa Claus 1 |
User | BagginWithBaggin |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 1029 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 3668 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | hand_01.txt, hand_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
hand_01.txt | AC | 1 ms | 3524 KB |
hand_02.txt | AC | 1 ms | 3520 KB |
random_01.txt | AC | 1 ms | 3552 KB |
random_02.txt | AC | 1 ms | 3668 KB |
random_03.txt | AC | 1 ms | 3524 KB |
random_04.txt | AC | 1 ms | 3492 KB |
random_05.txt | AC | 1 ms | 3548 KB |
random_06.txt | AC | 1 ms | 3376 KB |
random_07.txt | AC | 1 ms | 3492 KB |
random_08.txt | AC | 1 ms | 3484 KB |
random_09.txt | AC | 1 ms | 3568 KB |
random_10.txt | AC | 1 ms | 3508 KB |
random_11.txt | AC | 1 ms | 3460 KB |
random_12.txt | AC | 1 ms | 3560 KB |
random_13.txt | AC | 2 ms | 3632 KB |
sample_01.txt | AC | 1 ms | 3500 KB |
sample_02.txt | AC | 1 ms | 3476 KB |
sample_03.txt | AC | 1 ms | 3564 KB |