Cody

Problem 547. Create One Large Eye of size N x N Quickly?

Solution 455074

Submitted on 15 Jun 2014 by rifat
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
%% tic; N=10^6; x=rand(1,N); y=Aye(N); assert(numel(y)==N*N) assert(isequal(x*y,x)) assert(toc<2)

ans = (1,1) 1 (2,2) 1 (3,3) 1 (4,4) 1 (5,5) 1 (6,6) 1 (7,7) 1 (8,8) 1 (9,9) 1 (10,10) 1 (11,11) 1 (12,12) 1 (13,13) 1 (14,14) 1 (15,15) 1 (16,16) 1 (17,17) 1 (18,18) 1 (19,19) 1 (20,20) 1 (21,21) 1 (22,22) 1 (23,23) 1 (24,24) 1 (25,25) 1 (26,26) 1 (27,27) 1 (28,28) 1 (29,29) 1 (30,30) 1 (31,31) 1 (32,32) 1 (33,33) 1 (34,34) 1 (35,35) 1 (36,36) 1 (37,37) 1 (38,38) 1 (39,39) 1 (40,40) 1 (41,41) 1 (42,42) 1 (43,43) 1 (44,44) 1 (45,45) 1 (46,46) 1 (47,47) 1 (48,48) 1 (49,49) 1 (50,50) 1 (51,51) 1 (52,52) 1 (53,53) 1 (54,54) 1 (55,55) 1 (56,56) 1 (57,57) 1 (58,58) 1 (59,59) 1 (60,60) 1 (61,61) 1 (62,62) 1 (63,63) 1 (64,64) 1 (65,65) 1 (66,66) 1 (67,67) 1 (68,68) 1 (69,69) 1 (70,70) 1 (71,71) 1 (72,72) 1 (73,73) 1 (74,74) 1 (75,75) 1 (76,76) 1 (77,77) 1 (78,78) 1 (79,79) 1 (80,80) 1 (81,81) 1 (82,82) 1 (83,83) 1 (84,84) 1 (85,85) 1 (86,86) 1 (87,87) 1 (88,88) 1 (89,89) 1 (90,90) 1 (91,91) 1 (92,92) 1 (93,93) 1 (94,94) 1 (95,95) 1 (96,96) 1 (97,97) 1 (98,98) 1 (99,99) 1 (100,100) 1 (101,101) 1 (102,102) 1 (103,103) 1 (104,104) 1 (105,105) 1 (106,106) 1 (107,107) 1 (108,108) 1 (109,109) 1 (110,110) 1 (111,111) 1 (112,112) 1 (113,113) 1 (114,114) 1 (115,115) 1 (116,116) 1 (117,117) 1 (118,118) 1 (119,119) 1 (120,120) 1 (121,121) 1 (122,122) 1 (123,123) 1 (124,124) 1 (125,125) 1 (126,126) 1 (127,127) 1 (128,128) 1 (129,129) 1 (130,130) 1 (131,131) 1 (132,132) 1 (133,133) 1 (134,134) 1 (135,135) 1 (136,136) 1 (137,137) 1 (138,138) 1 (139,139) 1 (140,140) 1 (141,141) 1 (142,142) 1 (143,143) 1 (144,144) 1 (145,145) 1 (146,146) 1 (147,147) 1 (148,148) 1 (149,149) 1 (150,150) 1 (151,151) 1 (152,152) 1 (153,153) 1 (154,154) 1 (155,155) 1 (156,156) 1 (157,157) 1 (158,158) 1 (159,159) 1 (160,160) 1 (161,161) 1 (162,162) 1 (163,163) 1 (164,164) 1 (165,165) 1 (166,166) 1 (167,167) 1 (168,168) 1 (169,169) 1 (170,170) 1 (171,171) 1 (172,172) 1 (173,173) 1 (174,174) 1 (175,175) 1 (176,176) 1 (177,177) 1 (178,178) 1 (179,179) 1 (180,180) 1 (181,181) 1 (182,182) 1 (183,183) 1 (184,184) 1 (185,185) 1 (186,186) 1 (187,187) 1 (188,188) 1 (189,189) 1 (190,190) 1 (191,191) 1 (192,192) 1 (193,193) 1 (194,194) 1 (195,195) 1 (196,196) 1 (197,197) 1 (198,198) 1 (199,199) 1 (200,200) 1 (201,201) 1 (202,202) 1 (203,203) 1 (204,204) 1 (205,205) 1 (206,206) 1 (207,207) 1 (208,208) 1 ...