# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
146586 | maruii | 물병 (JOI14_bottle) | C++14 | 1914 ms | 238916 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
#define ff first
#define ss second
char S[2005][2005];
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
pii vis[2005][2005]; // sc, dist
queue<pair<pii, int> > q; // x, y, sc
int maxDist;
pii upa[200005];
int rnk[200005];
int fnd(int x, int c) { return upa[x].ss > c ? x : fnd(upa[x].ff, c); }
void uni(int x, int y, int c) {
x = fnd(x, c), y = fnd(y, c);
if (x == y) return;
if (rnk[x] < rnk[y]) swap(x, y);
upa[y] = pii(x, c);
if (rnk[x] == rnk[y]) ++rnk[x];
maxDist = max(maxDist, c);
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int H, W, P, Q; cin >> H >> W >> P >> Q;
for (int i = 1; i <= H; ++i) cin >> S[i] + 1;
for (int i = 1; i <= P; ++i) {
int x, y; cin >> x >> y;
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |