This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |