답안 #1115647

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1115647 2024-11-20T17:59:01 Z staszic_ojuz Dango Maker (JOI18_dango_maker) C++17
13 / 100
1 ms 508 KB
#include <bits/stdc++.h>
using namespace std;

vector<string> plansza;
int tab[3001][3001];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    string str;
    for(int i = 0; i <= m; i++){
        str += "#";
    }
    plansza.push_back(str);
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        plansza.push_back("#" + s + "#");
    }
    plansza.push_back(str);
    int64_t wyn = 0;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            if(plansza[i][j] == 'G'){
                if(plansza[i - 1][j] == 'R' && plansza[i + 1][j] == 'W'){
                    if(plansza[i][j - 1] == 'R' && plansza[i][j + 1] == 'W'){
                        tab[i][j] = 1;
                        plansza[i][j - 1] = '#';
                        plansza[i + 1][j] = '#';
                    }else{
                        tab[i][j] = 1;
                        plansza[i - 1][j] = '#';
                        plansza[i + 1][j] = '#';
                    }
                }else{
                    if(plansza[i][j - 1] == 'R' && plansza[i][j + 1] == 'W'){
                        tab[i][j] = 1;
                        plansza[i][j + 1] = '#';
                        plansza[i][j - 1] = '#';
                    }
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            wyn += tab[i][j];
        }
    }
    cout << wyn;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 508 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 508 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Incorrect 1 ms 336 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 508 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Incorrect 1 ms 336 KB Output isn't correct
21 Halted 0 ms 0 KB -