Submission #147550

# Submission time Handle Problem Language Result Execution time Memory
147550 2019-08-30T02:28:22 Z imsifile Chessboard Nonogram (FXCUP4_nonogram) C++17
100 / 100
7 ms 640 KB
#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

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 time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 512 KB Output is correct
6 Correct 6 ms 384 KB Output is correct
7 Correct 6 ms 384 KB Output is correct
8 Correct 7 ms 384 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 6 ms 512 KB Output is correct
11 Correct 5 ms 512 KB Output is correct
12 Correct 6 ms 640 KB Output is correct
13 Correct 6 ms 640 KB Output is correct
14 Correct 6 ms 640 KB Output is correct
15 Correct 7 ms 512 KB Output is correct