AtCoder Beginner Contest 096

Submission #5443423

Source codeソースコード

#include<iostream>

using namespace std;

int H,W;
int main () {
    cin >> H >> W;
    for(int i=1; i<=H; i++)
        for(int j=1; j<=W; j++)
            cin >> tb[i][j];

    for(int i=1; i<=H; i++) {
        for(int j=1; j<=W; j++) {
            if( tb[i][j] == '#') {
                bool flag = false;
                for(int k=0; k<4; k++) {
                    int nx = j + dx[k];
                    int ny = i + dy[k];
                    if( tb[ny][nx] == '#' ) flag = true;
                }
                if(!flag) {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Submission

Task問題 C - Grid Repainting 2
User nameユーザ名 mlpj56d
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 725 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:20: error: ‘tb’ was not declared in this scope
cin >> tb[i][j];
^
./Main.cpp:14:17: error: ‘tb’ was not declared in this scope
if( tb[i][j] == '#') {
^
./Main.cpp:17:34: error: ‘dx’ was not declared in this scope
int nx = j + dx[k];
^
./Main.cpp:18:34: error: ‘dy’ was not declared in this scope
int ny = i + dy[k];
^

Test case