QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302786#5038. CityYcfhnndWA 0ms3588kbC++20696b2024-01-11 12:51:432024-01-11 12:51:43

Judging History

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

  • [2024-01-11 12:51:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3588kb
  • [2024-01-11 12:51:43]
  • 提交

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 = 0;i <= n;i ++){
        for (int j = 0;j <= m;j ++){
            if (i == 0 || j == 0) continue;
            int x = i * 2, y = j * 2;
            if (x > n || y > m) continue;
            if (x == 0 || y == 0) ans += (n - x + 1) * (m - y + 1);
            else ans += 2LL * (n - x + 1) * (m - y + 1);
        }
    }
    cout << ans << "\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: 3520kb

input:

1 1

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3588kb

input:

2 3

output:

4

result:

wrong answer 1st numbers differ - expected: '14', found: '4'