QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#302782 | #5038. City | Ycfhnnd | WA | 0ms | 3584kb | C++20 | 638b | 2024-01-11 12:46:20 | 2024-01-11 12:46:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
int n, m;
cin >> n >> m;
i64 ans = 0;
for (int i = 2;i <= n;i += 2){
ans += (m + 1) * (n - i + 1);
}
for (int i = 2;i <= m;i += 2){
ans += (n + 1) * (m - i + 1);
}
int t = 0;
for (int i = 2;i <= n && i <= m;i += 2){
t += (m - i + 1) * (n - i + 1);
}
cout << ans + 2 * t << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
2 3
output:
14
result:
ok 1 number(s): "14"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3584kb
input:
252 139
output:
5431370
result:
wrong answer 1st numbers differ - expected: '156806790', found: '5431370'