# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148302 | mahmoudbadawy (#201) | Chessboard Nonogram (FXCUP4_nonogram) | C++17 | 6 ms | 512 KiB |
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,vector<int>(m,0));
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
v[i][j]=((i+j)%2==0?1:0);
for(int i=0;i<n;i+=2)
{
int cur=0;
for(int j=0;j<Rclue[i].size();j++)
{
//cout << i << ": " << Rclue[i][j] << endl;
int en=cur+Rclue[i][j];
for(;cur<en;cur++)
v[i][cur]=1;
cur++;
}
//cout << endl;
}
for(int i=0;i<m;i+=2)
{
int cur=0;
for(int j=0;j<Cclue[i].size();j++)
{
int en=cur+Cclue[i][j];
for(;cur<en;cur++)
v[cur][i]=1;
cur++;
}
}
return v;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |