Submission #147699

# Submission time Handle Problem Language Result Execution time Memory
147699 2019-08-30T12:27:05 Z gina(#3662, imyujin) Chessboard Nonogram (FXCUP4_nonogram) C++17
100 / 100
8 ms 640 KB
#include "nonogram.h"
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> SolveNonogram(int N, int M, vector<vector<int>> Rclue, vector<vector<int>> Cclue) {
	vector<vector<int>> ans(N);
	for(int i = 0; i < N; i++) ans[i].resize(M, 0);
	int t = 0;
	for(auto a : Rclue[0]) {
		for(int i = 0; i < a; i++) ans[0][t + i] = 1;
		t += a + 1;
	}
	for(int i = 0; i < M; i++) {
		int t = 1 - ans[0][i];
		for(auto a : Cclue[i]) {
			for(int j = 0; j < a; j++) ans[t + j][i] = 1;
			t += a + 1;
		}
	}
	return ans;
}
# 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 512 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 384 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 512 KB Output is correct
4 Correct 6 ms 512 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 5 ms 512 KB Output is correct
7 Correct 6 ms 384 KB Output is correct
8 Correct 6 ms 512 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 6 ms 540 KB Output is correct
11 Correct 8 ms 512 KB Output is correct
12 Correct 6 ms 640 KB Output is correct
13 Correct 6 ms 512 KB Output is correct
14 Correct 6 ms 512 KB Output is correct
15 Correct 7 ms 640 KB Output is correct