标签:ted red nsis enter and ane ++ sam des
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 373 Accepted Submission(s): 104
Special Judge
let count be a 2d array filled with 0s
iterate through all 1s in the matrix:
suppose this 1 lies in grid(x,y)
iterate every row r:
if grid(r,y)=1:
++count[min(r,x)][max(r,x)]
if count[min(r,x)][max(r,x)]>1:
claim there is a rectangle satisfying the condition
claim there isn‘t any rectangle satisfying the condition
这题是真的强,不晓得大佬是怎么想出来的.
1 #include <iostream> 2 #include <cstring> 3 #include <stdio.h> 4 #include <algorithm> 5 using namespace std; 6 int ans[3000][3000]; 7 int n=47; 8 int main(){ 9 for(int i=0;i<n;i++){ 10 for(int j=0;j<n;j++){ 11 int tmp=j; 12 for(int k=0;k<n;k++){ 13 if(k!=0)tmp+=i; 14 tmp%=n; 15 ans[k*n+tmp][i*n+j]=1; 16 } 17 } 18 } 19 cout<<2000<<endl; 20 for(int i=0;i<2000;i++){ 21 for(int j=0;j<2000;j++){ 22 cout<<ans[i][j]; 23 } 24 cout<<endl; 25 } 26 return 0; 27 }
标签:ted red nsis enter and ane ++ sam des
原文地址:https://www.cnblogs.com/zllwxm123/p/9369136.html