Submission #1682163


Source Code Expand

Copy
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

ll N, M;
char S[100][100];

int main(void) {
  cin >> N >> M;
  REP(i, 0, N) REP(j, 0, M) cin >> S[i][j];

  char ans[100][100];
  REP(i, 0, N) REP(j, 0, M) {
    if(S[i][j] == '#') ans[i][j] = '#';
    else {
      ll cnt = 0;
      REP(k, -1, 2) REP(l, -1, 2) if(k != 0 || l != 0) {
        if(S[k][j] == '#') cnt++;
      }
      ans[i][j] = '0' + cnt;
    }
  }

  REP(i, 0, N) {
    REP(j, 0, M) cout << S[i][j];
    cout << endl;
  }
}

Submission Info

Submission Time
Task B - Minesweeper
User kshinya
Language C++14 (GCC 5.4.1)
Score 0
Code Size 599 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 0 / 200 sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB
subtask_1_1.txt 1 ms 256 KB
subtask_1_10.txt 1 ms 256 KB
subtask_1_11.txt 1 ms 256 KB
subtask_1_12.txt 1 ms 256 KB
subtask_1_2.txt 1 ms 256 KB
subtask_1_3.txt 1 ms 256 KB
subtask_1_4.txt 1 ms 256 KB
subtask_1_5.txt 1 ms 256 KB
subtask_1_6.txt 1 ms 256 KB
subtask_1_7.txt 1 ms 256 KB
subtask_1_8.txt 1 ms 256 KB
subtask_1_9.txt 1 ms 256 KB