Submission #148302

#TimeUsernameProblemLanguageResultExecution timeMemory
148302mahmoudbadawy (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
6 ms512 KiB
#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)

nonogram.cpp: In function 'std::vector<std::vector<int> > SolveNonogram(int, int, std::vector<std::vector<int> >, std::vector<std::vector<int> >)':
nonogram.cpp:15:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<Rclue[i].size();j++)
               ~^~~~~~~~~~~~~~~~
nonogram.cpp:28:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<Cclue[i].size();j++)
               ~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...