QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#234014 | #5038. City | CSU2023# | WA | 1ms | 3424kb | C++14 | 543b | 2023-11-01 12:56:32 | 2023-11-01 12:56:33 |
Judging History
answer
#include <bits/stdc++.h>
using std::ios;
using std::cin;
using std::cout;
typedef long long ll;
int n, m; ll ans = 0;
int main()
{
cin >> n >> m;
ll ans = 0;
for (int i = 2; i <= n; ++i)
for (int j = 2; j <= m; ++j)
if (std::__gcd(i, j) != 1)
ans += 2ll * (n + 1 - i) * (m + 1 - j);
for (int i = 2; i <= n; i += 2)
ans += 1ll * (m + 1) * (n + 1 - i);
for (int j = 2; j <= m; j += 2)
ans += 1ll * (n + 1) * (m + 1 - j);
cout << ans << '\n';
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3348kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3424kb
input:
2 3
output:
14
result:
ok 1 number(s): "14"
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3256kb
input:
252 139
output:
242491316
result:
wrong answer 1st numbers differ - expected: '156806790', found: '242491316'