QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#743996#9628. 骰子dmrmra#AC ✓0ms3632kbC++11831b2024-11-13 20:32:372024-11-13 20:32:38

Judging History

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

  • [2024-11-13 20:32:38]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3632kb
  • [2024-11-13 20:32:37]
  • 提交

answer

//
// Created by 16373 on 2024/11/13.
//
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353;
int a[10];

void solve(){
    int n,m;
    cin>>n>>m;
    if(n>1 && m>1){
        cout<<6*m*n;
        return;
    }
    if(n==1 && m==1){
        cout<<6;
        return;
    }
    int row[4]={0,6,9,10};
    int col[4]={0,6,8,9};
    if(n==1){
        int cnt=m/4,md=m%4;
        int res=cnt*14+row[md];
        cout<<res;
        return;
    }
    if(m==1){
        int cnt=n/4,md=n%4;
        int res=cnt*14+col[md];
        cout<<res;
    }

}
signed main(){
    ios::sync_with_stdio(0); cin.tie(0);
    int t=1;
//    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
//2
//630
//3029 2336 377 41 10 61
//3000
//20000 10000 0 0 0 0

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

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

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

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

input:

987 654

output:

3872988

result:

ok single line: '3872988'