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;
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>> v(N);
for(auto &i : v) i.resize(M);
for(int i=0; i<N; i++){
for(int j=0; j<M; j++){
v[i][j] = (i + j + 1) % 2;
}
}
int ptr = 0;
for(auto &i : Rclue[0]){
for(int j=ptr; j<ptr+i; j++) v[0][j] = 1;
ptr += i + 1;
}
for(int i=0; i<M; i++){
int ptr = 0;
if(!v[0][i]) ptr++;
for(auto &j : Cclue[i]){
for(int k=ptr; k<ptr+j; k++) v[k][i] = 1;
ptr += j + 1;
}
}
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |