Cody

Problem 44658. Kurosu solver

Solution 1589335

Submitted on 22 Jul 2018 by J. S. Kowontan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
filetext = fileread('kurosusolver.m'); assert(isempty(strfind(filetext,'eval'))) assert(isempty(strfind(filetext,'echo'))) assert(isempty(strfind(filetext,'switch')))

2   Pass
b0 = zeros(6); b1 = kurosusolver(b0); assert(isempty(b1))

3   Pass
b0 = [-1 -1 -1 0 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

4   Pass
b0 = [ 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 0 -1 -1 -1 -1]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

5   Pass
b0 = [-1 -1 0 -1 0 0 -1 -1 -1 1 -1 1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

6   Pass
b0 = [1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

7   Pass
b0 = [1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1]; b1 = kurosusolver(b0); assert(isempty(b1))

8   Pass
b0 = [0 1 0 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 1]; b1 = kurosusolver(b0); assert(isempty(b1))