# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1145479 | fabijan_cikac | Maze (JOI23_ho_t3) | C++20 | 724 ms | 352088 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
signed main(){
int dx[] = {-1, 1, 0, 0, -1, 1, -1, 1}; int dy[] = {0, 0, -1, 1, -1, 1, 1, -1};
int n, r, c; cin >> r >> c >> n;
int sr, sc; cin >> sr >> sc; sr--;sc--;
int gr, gc; cin >> gr >> gc; gr--;gc--;
vector<string> board(r);
for(auto &s : board) cin >> s;
vector<vector<int>> mark(r, vector<int>(c, 0));
queue<pair<int,int>> todo;
vector<pair<int,int>> funny;
auto good = [&](pair<int,int>p){
return p.ff>=0&&p.ss>=0&&p.ff< r&&p.ss<c;
};
auto ad = [&](pair<int,int> p){
if(mark[p.ff][p.ss]) return;
if(board[p.ff][p.ss]=='#'){
funny.push_back(p);
return;
}
mark[p.ff][p.ss] = 1;
for(int d = 0; d < 4; d++){
auto t = p; t.ff+=dx[d]; t.ss+=dy[d];
if(good(t)) todo.push(t);
}
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |