# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70182 | 3zp | Dango Maker (JOI18_dango_maker) | C++14 | 155 ms | 141960 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 maxn 500009
using namespace std;
string s[3009];
int A[3009][3009];
int B[3009][3009];
int a[3009][3009];
int b[3009][3009];
int k, Bl, Wi;
vector<int> v[6000009];
int f[6000009];
void dfs(int x, int c){
f[x] = 1;
if(c == 1) Wi++;
else Bl++;
for(int i = 0; i < v[x].size(); i++)
if(!f[v[x][i]])dfs(v[x][i], 1 - c);
}
main(){
int n, m;
cin >> n >> m;
for(int i = 0; i < n; i++){
cin >> s[i];
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(j + 2 < m && s[i][j] == 'R'
&& s[i][j+1] == 'G'
&& s[i][j+2] == 'W')
A[i][j] = 1, a[i][j] = ++k;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |