Submission #147651

# Submission time Handle Problem Language Result Execution time Memory
147651 2019-08-30T11:05:08 Z 준표짱짱vv(#3644, spectaclehong) Chessboard Nonogram (FXCUP4_nonogram) C++17
100 / 100
7 ms 592 KB
#include "nonogram.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>> ret(N, vector<int>(M));
	for (int i = 0; i < N; i += 2) {
		int s = 0;
		for (int x : Rclue[i]) {
			for (int j = s; j < s + x; j++)
				ret[i][j] = 1;
			s += x + 1;
		}
	}
	for (int i = 0; i < M; i += 2) {
		int s = 0;
		for (int x : Cclue[i]) {
			for (int j = s; j < s + x; j++)
				ret[j][i] = 1;
			s += x + 1;
		}
	}

	for (int i = 1; i < N; i += 2) {
		int s = ret[i][0] ? 0 : 1;
		for (int x : Rclue[i]) {
			for (int j = s; j < s + x; j++)
				ret[i][j] = 1;
			s += x + 1;
		}
	}
	for (int i = 1; i < M; i += 2) {
		int s = ret[0][i] ? 0 : 1;
		for (int x : Cclue[i]) {
			for (int j = s; j < s + x; j++)
				ret[j][i] = 1;
			s += x + 1;
		}
	}
	return ret;
}

# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 472 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 472 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 6 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 6 ms 512 KB Output is correct
11 Correct 6 ms 512 KB Output is correct
12 Correct 7 ms 592 KB Output is correct
13 Correct 6 ms 536 KB Output is correct
14 Correct 5 ms 512 KB Output is correct
15 Correct 6 ms 512 KB Output is correct