QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#300505 | #5038. City | Saanteye# | WA | 0ms | 3632kb | C++17 | 944b | 2024-01-08 13:22:21 | 2024-01-08 13:22:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
typedef pair<int, int> PII;
const int L = 1000000001;
//#define p first
//#define d second
void solve(){
int n, m; cin >> n >> m;
int ans = 0;
int cur = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m;j++){
int x = i * 2, y = j * 2;
if(x > n || y > m) continue;
ans += (n - x + 1) * (m - y + 1) * 2ll;
}
}
for (int i = 1; i * 2 <= n; i++) {
cur += n - i;
}
ans += cur * (m + 1);
//cout << cur * (m + 1) << '\n';
cur = 0;
for (int i = 1; i * 2 <= m; i++) {
cur += m - i;
}
ans += cur * (n + 1);
// cout << cur * (n + 1) << '\n';
cout << ans;
}
signed main(){
ios::sync_with_stdio(false);cin.tie(0);
int _ = 1;
// cin >> _;
while(_--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3504kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
2 3
output:
14
result:
ok 1 number(s): "14"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3552kb
input:
252 139
output:
158502828
result:
wrong answer 1st numbers differ - expected: '156806790', found: '158502828'