QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#755246#9628. 骰子rdcamelotAC ✓0ms3688kbC++20609b2024-11-16 16:50:552024-11-16 16:50:55

Judging History

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

  • [2024-11-16 16:50:55]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3688kb
  • [2024-11-16 16:50:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64=long long;
using u64=unsigned long long;
#define ll long long
const int inf=1e9;
const ll inff=1e18;
using i128=__int128;

void solve(){
    int n,m;
    cin>>n>>m;
    int a[]={6,9,10,14};
    int b[]={6,8,9,14};
    if(n==1){
        cout<<m/4*14+a[m%4-1]<<'\n';
        return;
    }
    if(m==1){
        cout<<n/4*14+b[n%4-1]<<'\n';
        return;
    }
    cout<<m*n*6<<'\n';
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int t=1;
    // cin>>t; 
    while(t--){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

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

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

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

input:

987 654

output:

3872988

result:

ok single line: '3872988'