# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1003607 | julian | Dijamant (COCI22_dijamant) | C++98 | 237 ms | 238160 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>
using namespace std;
typedef long long ll;
// #include<bits/extc++.h>
//__gnu_pbds
bool arr[2005][2005];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int n, m;
bool inbound(int x, int y) {
return (x >= 0 && y >= 0);
}
int xpymax, xpymin, xmymax, xmymin;
int cnt = 0;
void dfs(int x, int y) {
arr[x][y] = 1;
cnt++;
xpymax = max(xpymax, x + y);
xpymin = min(xpymin, x + y);
xmymax = max(xmymax, x - y);
xmymin = min(xmymin, x - y);
for (int i = 0; i < 4; i++) {
if (inbound(x + dx[i], y + dy[i])) {
if (arr[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... |