QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#743705#9628. 骰子wanggl#AC ✓0ms3636kbC++17619b2024-11-13 19:51:042024-11-13 19:51:10

Judging History

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

  • [2024-11-13 19:51:10]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3636kb
  • [2024-11-13 19:51:04]
  • 提交

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'