You are viewing a single comment's thread. Return to all comments →
I used the fact that m and n are integers to do this approach:
cout<<((n+1)/2)*((m+1)/2);
If n is even, then it will round down (Example: n=4; n+1==5; (n+1)/2==2*.5*; Since it is an integer, the .5 is removed. (n+1)/2==2)
If n is odd, then it simply acts as though it were a slightly larger graph with an even number of rows.
Seems like cookies are disabled on this browser, please enable them to open this website
Army Game
You are viewing a single comment's thread. Return to all comments →
I used the fact that m and n are integers to do this approach:
If n is even, then it will round down (Example: n=4; n+1==5; (n+1)/2==2*.5*; Since it is an integer, the .5 is removed. (n+1)/2==2)
If n is odd, then it simply acts as though it were a slightly larger graph with an even number of rows.