# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
825939 | vjudge1 | Dijamant (COCI22_dijamant) | C++14 | 2 ms | 4820 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 el '\n'
#define fi first
#define sc second
#define pii pair<int, int>
#define all(v) v.begin(), v.end()
using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
const int mod=1e9+7;
const int N=2e3+11;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
bool a[N][N];
int m, n;
bool ch(int x, int y)
{
return (x>=0 && y>=0);
}
int mi1, mi2, ma1, ma2, ans, cnt;
void dfs(int x, int y)
{
a[x][y]=1;
cnt++;
ma1=max(ma1, x+y);
mi1=min(mi1, x+y);
ma2=max(ma2, x-y);
mi2=min(mi1, x-y);
for(int i=0;i<4;i++) if(ch(x+dx[i], y+dy[i])) if(a[x+dx[i]][y+dy[i]]==0) dfs(x+dx[i], y+dy[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |