Submission #147550

#TimeUsernameProblemLanguageResultExecution timeMemory
147550imsifileChessboard Nonogram (FXCUP4_nonogram)C++17
100 / 100
7 ms640 KiB
#include "nonogram.h" using namespace std; int r1[111]; vector<vector<int>> SolveNonogram(int N, int M, vector<vector<int>> Rclue, vector<vector<int>> Cclue) { vector<vector<int>> ans; ans.resize(N); for(int i=0; i<N; i++) ans[i].resize(M,0); for(int i=0, x=0; i<Rclue[0].size(); i++){ for(int j=0; j<Rclue[0][i]; j++) r1[x++]=1; x++; } for(int j=0; j<M; j++){ for(int i=0, x=1-r1[j]; i<Cclue[j].size(); i++){ for(int t=0; t<Cclue[j][i]; t++) ans[x++][j]=1; x++; } } return ans; }

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