QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
詳細信息
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'