QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#743996 | #9628. 骰子 | dmrmra# | AC ✓ | 0ms | 3632kb | C++11 | 831b | 2024-11-13 20:32:37 | 2024-11-13 20:32:38 |
Judging History
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
详细
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'