Submission #147699

#TimeUsernameProblemLanguageResultExecution timeMemory
147699gina (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
8 ms640 KiB
#include "nonogram.h" #include <bits/stdc++.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); for(int i = 0; i < N; i++) ans[i].resize(M, 0); int t = 0; for(auto a : Rclue[0]) { for(int i = 0; i < a; i++) ans[0][t + i] = 1; t += a + 1; } for(int i = 0; i < M; i++) { int t = 1 - ans[0][i]; for(auto a : Cclue[i]) { for(int j = 0; j < a; j++) ans[t + j][i] = 1; t += a + 1; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...