Submission #147651

#TimeUsernameProblemLanguageResultExecution timeMemory
147651준표짱짱vv (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
7 ms592 KiB
#include "nonogram.h" using namespace std; std::vector<std::vector<int>> SolveNonogram(int N, int M, std::vector<std::vector<int>> Rclue, std::vector<std::vector<int>> Cclue) { vector<vector<int>> ret(N, vector<int>(M)); for (int i = 0; i < N; i += 2) { int s = 0; for (int x : Rclue[i]) { for (int j = s; j < s + x; j++) ret[i][j] = 1; s += x + 1; } } for (int i = 0; i < M; i += 2) { int s = 0; for (int x : Cclue[i]) { for (int j = s; j < s + x; j++) ret[j][i] = 1; s += x + 1; } } for (int i = 1; i < N; i += 2) { int s = ret[i][0] ? 0 : 1; for (int x : Rclue[i]) { for (int j = s; j < s + x; j++) ret[i][j] = 1; s += x + 1; } } for (int i = 1; i < M; i += 2) { int s = ret[0][i] ? 0 : 1; for (int x : Cclue[i]) { for (int j = s; j < s + x; j++) ret[j][i] = 1; s += x + 1; } } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...