Problem | Verdict | Lang | Time | Best | Rank | Submit Time |
---|---|---|---|---|---|---|
| discuss11231 - | Accepted | C++11 | 0.000 | 0.000 | 2576 | 53 secs ago |
Suggest:
- Number of the white right bottom of chessboard is the result
"Any embedded chessboard can be identified uniquely with its lower right corner.
If we count the number of valid lower-right-hand-corners, we thus have our solution."
(algorithmist.com)
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, m, c;
while(cin >> n >> m >> c && !(n==0 && m==0 && c==0)){
n-=7, m-=7;
cout<<(c ? (n*m+1)/2 : n*m/2)<<"\n";
}
}
No comments:
Post a Comment