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>> r, std::vector<std::vector<int>> c) {
vector<vector<int> > a(n);
for(int i = 0;i < n;i++)
{
int k = 0,cn;
if(i % 2) reverse(r[i].begin(),r[i].end());
if(r[i].size() == 0) a[i].push_back(0);
for(int j : r[i])
{
for(cn = 0;cn < j;k++,cn++)
{
a[i].push_back(1);
}
if(k != m) a[i].push_back(0);
k++;
}
if(i % 2) reverse(a[i].begin(),a[i].end());
}
return a;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |