제출 #924642

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9246422024-02-09 11:01:56thinknoexitDango Maker (JOI18_dango_maker)C++17
0 / 100
29 ms82716 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3000001;
int a[3030][3030];
int b[3030][3030];
char c[3030][3030];
int deg[N];
bool p[N], vis[N];
vector<int> adj[N];
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n, m;
cin >> n >> m;
int cnt = 0;
for (int i = 1;i <= n;i++) {
for (int j = 1;j <= m;j++) {
cin >> c[i][j];
if (i >= 3) {
if (c[i][j] == 'W' && c[i - 1][j] == 'G' && c[i - 2][j] == 'R') {
cnt++;
a[i][j] = a[i - 1][j] = a[i - 2][j] = cnt;
p[cnt] = 0;
}
}
if (j >= 3) {
if (c[i][j] == 'W' && c[i][j - 1] == 'G' && c[i][j - 2] == 'R') {
cnt++;
b[i][j] = b[i][j - 1] = b[i][j - 2] = cnt;
p[cnt] = 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...