# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151447 | dolphingarlic | Konj (COCI19_konj) | C++14 | 70 ms | 9592 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |