标签:le j3 Two j2 j1 牛客 2021 include define
链接:https://ac.nowcoder.com/acm/contest/11256/H
来源:牛客网
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 262144K,其他语言524288K
Special Judge, 64bit IO Format: %lld
题目描述
Given n,mn,m_{}n,m, construct a matrix AA_{}A of size n×mn\times mn×m, whose entries are all either 0 or 1, and no three distinct entries Ai1,j1,Ai2,j2,Ai3,j3A_{i_1,j_1}, A_{i_2,j_2}, A_{i_3,j_3}Ai1,j1,Ai2,j2,Ai3,j3 satisfying that Ai1,j1=Ai2,j2=Ai3,j3,−1≤i1−i2=i2−i3≤1,−1≤j1−j2=j2−j3≤1A_{i_1,j_1} = A_{i_2,j_2} = A_{i_3,j_3}, -1\le i_1-i_2=i_2-i_3\le 1, -1\le j_1-j_2=j_2-j_3\le 1Ai1,j1=Ai2,j2=Ai3,j3,−1≤i1−i2=i2−i3≤1,−1≤j1−j2=j2−j3≤1. If multiple solutions exist, print any one of them. If no solution, print “-1” in one line.
输入描述:
Input only one line containing two integers n,m (1≤n,m≤1000)n, m~(1\le n,m \le 1000)n,m (1≤n,m≤1000).
输出描述:
If solutions exist, print nn_{}n lines each containing a 0101_{}01-string of length mm_{}m, denoting the matrix you construct. If no solution, print "-1" in one line.
示例1
输入
[复制](javascript:void(0)
标签:le,j3,Two,j2,j1,牛客,2021,include,define 来源: https://blog.csdn.net/Dueser/article/details/119451515
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。