제출 #769506

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7695062023-06-29 16:46:13EllinorTracks in the Snow (BOI13_tracks)C++14
75.94 / 100
2092 ms201524 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = (a); i < (b); i++)
typedef long long ll;
int H, W;
vector<string> grid;
vector<vector<ll>> visited; // bitset ?
priority_queue<vector<ll>> q;
void dfs(int hat, int wat, ll num)
{
if (visited[hat][wat]>0) return;
if (grid[hat][wat] == '.') return;
visited[hat][wat] = num;
char ch = grid[hat][wat];
if (hat + 1 < H) {
if (grid[hat + 1][wat] == ch) q.push({-num, hat + 1, wat});
else q.push({-(num + 1), hat + 1, wat});
}
if (wat + 1 < W) {
if (grid[hat][wat + 1] == ch) q.push({-num, hat, wat + 1});
else q.push({-(num + 1), hat, wat + 1});
}
if (hat - 1 >= 0) {
if (grid[hat - 1][wat] == ch) q.push({-num, hat - 1, wat});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...