{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eTonyfang是一个聪明的学生。老师正在教他和其他学生“包搜”游戏。\u003cbr\u003e老师画了一个n*n的矩阵,每个格子里填了零或一,他想判断是否存在一个四个角都填了1的矩形。\u003cbr\u003e他写了下面的伪代码,并声称它在$O(n^2)$内运行:\u003cbr\u003e\u003cbr\u003e\u003cpre\u003elet count be a 2d array filled with 0s\u003cbr\u003eiterate through all 1s in the matrix:\u003cbr\u003e suppose this 1 lies in grid(x,y)\u003cbr\u003e iterate every row r:\u003cbr\u003e if grid(r,y)\u003d1:\u003cbr\u003e ++count[min(r,x)][max(r,x)]\u003cbr\u003e if count[min(r,x)][max(r,x)]\u0026gt;1:\u003cbr\u003e claim there is a rectangle satisfying the condition\u003cbr\u003eclaim there isn\u0027t any rectangle satisfying the condition\u003c/pre\u003e\u003cbr\u003e\u003cbr\u003e作为一个聪明的学生,Tonyfang发现复杂度显然是错误的。但他懒得生成数据,所以现在轮到你了。\u003cbr\u003e请使用一个n*n的矩阵,其中填满了零或一,但没有任何四个角都填了1的矩形。\u003cbr\u003e你构造的矩阵应满足$1 \\leq n \\leq 2000$,并且1的数量不少于85000。\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"无。"}},{"title":"输出","value":{"format":"HTML","content":"第一行应该是一个正整数n,其中$1 \\leq n \\leq 2000$。\u003cbr\u003e\u003cbr\u003e接下来的n行,每行包含一个长度为n的只由零和一组成的字符串。\u003cbr\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e(nothing here)\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n010\r\n000\r\n000\r\n(obviously it\u0027s not a correct output, it\u0027s just used for showing output format)\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}