이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "nonogram.h"
#include <bits/stdc++.h>
std::vector<std::vector<int>> SolveNonogram(int N, int M,
std::vector<std::vector<int>> Rclue, std::vector<std::vector<int>> Cclue) {
using namespace std;
int n = N;
int m = M;
auto rclue = Rclue;
auto cclue = Cclue;
vector<vector<int> > ans(n, vector<int>(m, 0));
for(int i = 0; i < n; i += 1){
for(int j = 0; j < m; j++){
if(((i + j) & 1) == 0) ans[i][j] = 1;
}
}
for(int i = 0; i < n; i += 2){
vector<int> clue = rclue[i];
int cur = 0;
for(int x : clue){
for(int j = 0; j < x; j++){
ans[i][cur] = 1;
cur += 1;
}
cur += 1;
}
assert(cur >= m);
}
for(int i = 0; i < m; i += 2){
vector<int> clue = cclue[i];
int cur = 0;
for(int x : clue){
for(int j = 0; j < x; j++){
ans[cur][i] = 1;
cur += 1;
}
cur += 1;
}
assert(cur >= n);
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |