QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#738211#9628. 骰子susanzhishen#AC ✓1ms3704kbC++20915b2024-11-12 18:16:072024-11-12 18:16:10

Judging History

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

  • [2024-11-12 18:16:10]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3704kb
  • [2024-11-12 18:16:07]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define double long double
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef long long ll;
typedef pair<int,int> PII;
const int N=3e5+10;
const int M=1e3+10;
int mod=1e9+7;
int a[N];

void solve(){
    int n,m;cin>>n>>m;
    if(n>1&&m>1) cout<<n*m*6<<"\n";
    else{
        if(n==1){
            int sp=m/4*14;
            if(m%4==1) sp+=3;
            else if(m%4==2) sp+=4;
            else if(m%4==3) sp+=8;
            cout<<sp<<"\n";
        }else{
            int sp=m/4*14;
            if(m%4==1) sp+=2;
            else if(m%4==2) sp+=1;
            else if(m%4==3) sp+=8;
            cout<<sp<<"\n";
        }
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int _;
    _=1;
    // cin>>_;
    while(_--){
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3672kb

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3704kb

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

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

input:

987 654

output:

3872988

result:

ok single line: '3872988'