# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704228 | ancuber1031 | Dijamant (COCI22_dijamant) | C++14 | 280 ms | 66340 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;
#define int long long
#define endl '\n'
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
void paint(int x, int y, vector<vector<int> > &g) {
g[x][y] = 1;
for (int i = 0; i < 4; ++i) {
if (!g[x+dx[i]][y+dy[i]]) paint(x+dx[i],y+dy[i],g);
}
}
signed main() {
int n, m; cin>>n>>m;
vector<vector<int> > g(n+2,vector<int>(m+2,0)), pre(n+2,vector<int>(m+2,0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
char x; cin>>x;
g[i][j] = (x == '#');
}
}
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
pre[i][j] = pre[i][j-1]+g[i][j];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |