# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
544619 | pancankes | Tracks in the Snow (BOI13_tracks) | C++17 | 574 ms | 223892 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
using namespace std;
#define int long long
const int MAXN=1e5;
// very smart solution using 0/1 BFS
// answer is just the maxinum shortest path from the top left cell
// where the weight from each adjacent cell is:
// 1 when going from different animals
// 0 when going to same animal
int n, m, dist[4000][4000], ans = 1;
// instead of storing in a grid, can speed up code by storing in vector of strings!
string snow[4000];
// standard floodfill things to include, speeds up implementation
int dx[4]{1, -1, 0, 0}, dy[4]{0, 0, 1, -1};
bool inside(int x, int y) {
// since we dont care if snow[x][y] is a '.', since paths must be connected
return (x > -1 && x < n && y > -1 && y < m && snow[x][y] != '.');
}
void setIO(string name="") {
ios_base::sync_with_stdio(0); cin.tie(0);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |