QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#302782#5038. CityYcfhnndWA 0ms3584kbC++20638b2024-01-11 12:46:202024-01-11 12:46:21

Judging History

你现在查看的是最新测评结果

  • [2024-01-11 12:46:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-01-11 12:46:20]
  • 提交

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;
}

详细

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'