Submission #148041

#TimeUsernameProblemLanguageResultExecution timeMemory
148041. (#201)Chessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
6 ms640 KiB
#include "nonogram.h" using namespace std; vector<vector<int>> SolveNonogram(int N, int M, vector<vector<int>> Rclue, vector<vector<int>> Cclue) { vector<vector<int> > R; for(int i=0;i<N;i++) { vector<int> T; for(int j=0;j<M;j++) { T.push_back(0); } R.push_back(T); } for(int i=0,j=0;i<Cclue[0].size();i++) { for(int k=0;k<Cclue[0][i];k++) { R[j++][0] = 1; } j++; } for(int i=0;i<Rclue.size();i++) { int j = (R[i][0] ? 0 : 1); for(int k1=0;k1<Rclue[i].size();k1++) { for(int k2=0;k2<Rclue[i][k1];k2++) { R[i][j++] = 1; } j++; } } return R; }

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:13:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0,j=0;i<Cclue[0].size();i++) {
                  ~^~~~~~~~~~~~~~~~
nonogram.cpp:19:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<Rclue.size();i++) {
              ~^~~~~~~~~~~~~
nonogram.cpp:21:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int k1=0;k1<Rclue[i].size();k1++) {
                ~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...