Submission #148169

# Submission time Handle Problem Language Result Execution time Memory
148169 2019-08-31T16:30:26 Z ksun48(#3707, ksun48) Chessboard Nonogram (FXCUP4_nonogram) C++17
0 / 100
6 ms 512 KB
#include "nonogram.h"
#include <bits/stdc++.h>

std::vector<std::vector<int>> SolveNonogram(int N, int M, 
	std::vector<std::vector<int>> Rclue, std::vector<std::vector<int>> Cclue) {
	using namespace std;

	int n = N;
	int m = M;
	auto rclue = Rclue;
	auto cclue = Cclue;
	vector<vector<int> > ans(n, vector<int>(m, 0));
	for(int i = 0; i < n; i += 1){
		for(int j = 0; j < m; j++){
			if(((i + j) & 1) == 0) ans[i][j] = 1;
		}
	}
	for(int i = 0; i < n; i += 2){
		vector<int> clue = rclue[i];
		int cur = 0;
		for(int x : clue){
			for(int j = 0; j < x; j++){
				ans[i][cur] = 1;
				cur += 1;
			}
			cur += 1;
		}
		assert(cur == m + 1);
	}
	for(int i = 0; i < m; i += 2){
		vector<int> clue = cclue[i];
		int cur = 0;
		for(int x : clue){
			for(int j = 0; j < x; j++){
				ans[cur][i] = 1;
				cur += 1;
			}
			cur += 1;
		}
		assert(cur == n + 1);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -