QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#743705 | #9628. 骰子 | wanggl# | AC ✓ | 0ms | 3636kb | C++17 | 619b | 2024-11-13 19:51:04 | 2024-11-13 19:51:10 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
int n, m;
std::cin >> n >> m;
int ans = 0;
if (n == 1) {
int score[] = {6, 3, 1, 4};
for (int j = 0; j < m; j++) {
ans += score[j % 4];
}
} else if (m == 1) {
int score[] = {6, 2, 1, 5};
for (int j = 0; j < n; j++) {
ans += score[j % 4];
}
} else {
ans = 6 * n * m;
}
std::cout << ans << '\n';
}
signed main(){
ios::sync_with_stdio(false);
int t = 1;
while (t--) solve();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'