Submission #147843

# Submission time Handle Problem Language Result Execution time Memory
147843 2019-08-31T00:31:26 Z Lovely Trick(#3691, xdoju) Chessboard Nonogram (FXCUP4_nonogram) C++17
100 / 100
8 ms 640 KB
#include "nonogram.h"
using namespace std;

vector<vector<int>> SolveNonogram(int N, int M, vector<vector<int>> Rclue, vector<vector<int>> Cclue) {
  vector<vector<int>> ans(N, vector<int>(M));

  {
    int idx = 0;
    for(int x : Cclue[0]){
      for(; x--; ) ans[idx++][0] = 1;
      idx++;
    }
  }

  for(int i = 0; i < N; i++){
    int idx = ans[i][0] == 1 ? 0 : 1;

    for(int x : Rclue[i]){
      for(; x--; ) ans[i][idx++] = 1;
      idx++;
    }
  }

  return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 472 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 472 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 6 ms 384 KB Output is correct
8 Correct 6 ms 408 KB Output is correct
9 Correct 8 ms 408 KB Output is correct
10 Correct 6 ms 640 KB Output is correct
11 Correct 6 ms 512 KB Output is correct
12 Correct 7 ms 512 KB Output is correct
13 Correct 7 ms 512 KB Output is correct
14 Correct 6 ms 512 KB Output is correct
15 Correct 6 ms 600 KB Output is correct