|
|
вернуться в форумWA #7 The 7th test case is: 2 5 1 And my program outputs 348. I've tried to brute-force, and I got the same result. Did I misunderstand the problem? What should be the output for this test case? Re: WA #7 Ok, the answer is 780, but I don't know why. Re: WA #7 Ok, I'm stupid. Here's a function that checks if a matrix respects the Lunar Condition. bool lunar_check() { for(int i = 0; i != N-1;++i) { int count = 0; for(int j = 0; j != M;++j) { count += (matrix[j][i]==0&&matrix[j][i+1]==1); } if(count>K) return false; } return true; } I hope that nobody else's have problems reading the statement. ;-; |
|
|