# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
151447 | dolphingarlic | Konj (COCI19_konj) | C++14 | 70 ms | 9592 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define sz(c) int(c.size())
#define rep(i,a,b) for (int i=a; i<(b); ++i)
#define per(i,a,b) for (int i=(b)-1; i>=(a); --i)
using namespace std;
using ll = long long;
enum { UP, RIGHT, DOWN, LEFT };
int const MAXX=330;
bool can[MAXX][MAXX][4];
bool was[MAXX][MAXX];
void flood(int x,int y) {
if (was[x][y]) return;
was[x][y]=true;
if (can[x][y][UP]) flood(x,y+1);
if (can[x][y][DOWN]) flood(x,y-1);
if (can[x][y][RIGHT]) flood(x+1,y);
if (can[x][y][LEFT]) flood(x-1,y);
}
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
cout<<fixed<<setprecision(10);
int n;
cin>>n;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |