Cody

Problem 46833. Roots, Bloody Roots: part 1/2

Solution 3267838

Submitted on 18 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
filetext = fileread('visComplexPlane.m'); assert(isempty(strfind(filetext, 'eval')), 'eval is forbidden.'); assert(isempty(strfind(filetext, 'regexp')), 'regexp is forbidden.'); assert(isempty(strfind(filetext, 'str2num')), 'str2num is forbidden.'); assert(isempty(strfind(filetext, '!')), 'Shell commands are forbidden.'); assert(isempty(strfind(filetext, 'mlock')), 'mlock is forbidden.'); assert(isempty(strfind(filetext, 'munlock')), 'munlock is forbidden.'); assert(isempty(strfind(filetext, 'fopen')), 'fopen is forbidden.');

2   Fail
m = 500; n = 500; J = visComplexPlane(m,n); y_correct = [25 166 212 32 32 242 196 9 240 14 196 74 21 239 79 166 192 155 87 14 90 203 196 123 106 103 228 231 133 176 133 16 121 220 125 188 164 128 53 118 3 38 18 99 144 255 171 204 104 9 125 233 196 129 18 113 142 72 7 251 36 178 60 100]; assert(all(uint8(py.hashlib.sha512(py.str(mat2str(J(:))).encode('utf-8')).digest()) == y_correct));

Assertion failed.

3   Fail
m = 251; n = 501; J = visComplexPlane(m,n); y_correct = [187 126 253 159 247 242 249 25 213 223 27 57 35 39 110 223 166 247 82 101 71 12 193 15 251 152 215 87 39 71 245 94 66 73 135 243 163 56 168 217 198 201 20 19 255 247 100 139 72 201 30 85 234 182 238 233 137 161 206 156 86 45 71 171]; assert(all(uint8(py.hashlib.sha512(py.str(mat2str(J(:))).encode('utf-8')).digest()) == y_correct));

Assertion failed.

4   Fail
m = 750; n = 503; J = visComplexPlane(m,n); y_correct = [83 99 239 135 129 205 10 212 2 78 245 228 122 186 117 122 39 246 53 200 68 153 227 131 222 205 146 174 216 106 200 116 100 39 179 255 244 175 226 38 246 215 98 181 228 63 118 196 176 151 192 27 150 223 123 183 2 89 219 78 215 214 125 145]; assert(all(uint8(py.hashlib.sha512(py.str(mat2str(J(:))).encode('utf-8')).digest()) == y_correct));

Assertion failed.

5   Fail
m = 501; n = 250; J = visComplexPlane(m,n); y_correct = [82 133 222 186 239 236 118 153 188 94 116 95 105 194 37 121 52 33 230 224 181 136 182 185 124 112 24 77 148 212 113 178 164 22 80 252 117 188 26 178 66 195 83 52 159 22 205 207 210 220 12 199 110 145 121 39 101 110 2 51 117 40 93 113]; assert(all(uint8(py.hashlib.sha512(py.str(mat2str(J(:))).encode('utf-8')).digest()) == y_correct));

Assertion failed.

Suggested Problems

More from this Author5

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!