|  | 
|  | 
| back to board | it seems the real answer is something different of  acceptable answer Posted by mhg  3 Jul 2014 18:37hi,in the acceptable answer the answer of 5 4 is 7 but you can easily understand that the real answer is 6(you can test it by drawing a simple 5 4 table).
 
 here is a sample answer:
 
 #include <iostream>
 
 using namespace std;
 
 int main() {
 int unsigned long long N , M , turn = 0;
 cin >> N >> M;
 
 
 
 while( N > 2 && M > 2){
 turn += 4;
 N -= 2;
 M -= 2;
 }
 if (N == 2 && M > 1 || M == 2 && N > 1)  turn += 2;
 
 if (M == 1 && N > 1) turn += 1;
 cout << turn << endl;
 
 system ("PAUSE");
 return 0 ;
 
 }
Re: it seems the real answer is something different of  acceptable answer Nope...for 5 4 , answer is 7.For 4 5, answer is 6.
 
 Edited by author 05.07.2015 11:06
 
 Edited by author 05.07.2015 11:06
 | 
 | 
|