Submission #147784

#TimeUsernameProblemLanguageResultExecution timeMemory
147784Dog River (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
7 ms640 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>> ans(N, vector<int>(M)); for(int i=0;i<N;i++) { for(int j=0;j<M;j++) { if((i+j)%2 == 0) ans[i][j] = 1; } } for(int i=0;i<N;i+=2) { int pos = 0; for(int x : Rclue[i]) { while(x) { ans[i][pos] = 1; pos++; x--; } pos++; } } for(int i=0;i<M;i+=2) { int pos = 0; for(int x : Cclue[i]) { while(x) { ans[pos][i] = 1; pos++; x--; } pos++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...