QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#743536 | #9628. 骰子 | ntalking# | AC ✓ | 0ms | 3620kb | C++17 | 716b | 2024-11-13 19:26:03 | 2024-11-13 19:26:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define ll long long
ll n, m;
void solve() {
cin >> n >> m;
ll row[] = {0, 6, 9, 10}, col[] = {0, 6, 8, 9};
if((n >= 2 && m >=2) || (n == 1 && m == 1)) cout << 6 * n * m << endl;
else if(n == 1) cout << m / 4 * 14 + row[m % 4] <<endl;
else if(m == 1) cout << n / 4 * 14 + col[n % 4] << endl;
}
int main() {
#ifdef xrl
freopen("in.txt", "r", stdin), freopen("out.txt", "w", stdout);
#endif
FAST_IO;
int _ = 1;
//cin >> _;
while(_ --) solve();
#ifdef xrl
cout << "Time used = " << (double)(clock() * 1.0 / CLOCKS_PER_SEC) << "s";
#endif
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'