QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#736792#9628. 骰子rikka_lyly#AC ✓0ms3656kbC++201.1kb2024-11-12 13:25:202024-11-12 13:25:24

Judging History

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

  • [2024-11-12 13:25:24]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3656kb
  • [2024-11-12 13:25:20]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define int ll
void solve()
{
    int n,m;
    cin>>n>>m;
    if(n==1||m==1){
        if(n==1){
            int base=m/4*14;
            if(m%4==0){
                base+=0;
            }
            else if(m%4==1){
                base+=3;
            }
            else if(m%4==2){
                base+=5;
            }
            else{
                base+=9;
            }
            cout<<base<<'\n';
        }
        else{
            int base=m/4*14;
            if(n%4==0){
                base+=0;
            }
            else if(n%4==1){
                base+=3;
            }
            else if(n%4==2){
                base+=4;
            }
            else{
                base+=8;
            }
            cout<<base<<'\n';
        }

    }
    else{
        cout<<n*m*6<<'\n';
    }
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t=1;
    //cin >> t;
    while (t--)
    {
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

987 654

output:

3872988

result:

ok single line: '3872988'