QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#809524 | #9628. 骰子 | Nana7# | AC ✓ | 1ms | 3668kb | C++14 | 667b | 2024-12-11 15:43:17 | 2024-12-11 15:43:24 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#define I inline
#define int long long
using namespace std;
/*
2
630
3029 2336 377 41 10 61
3000
20000 10000 0 0 0 0
*/
int n,m;
signed main()
{
cin>>n>>m;
if(n>=2&&m>=2) {
cout<<m*n*6<<endl;
return 0;
}
if(n==1) {
int x[4]={6,3,1,4},sm=14;
int ans=m/4*sm;
if(m%4>=1) ans+=x[0];
if(m%4>=2) ans+=x[1];
if(m%4>=3) ans+=x[2];
cout<<ans<<endl;
return 0;
}
if(m==1) {
int x[4]={6,2,1,5},sm=14;
int ans=m/4*sm;
if(m%4>=1) ans+=x[0];
if(m%4>=2) ans+=x[1];
if(m%4>=3) ans+=x[2];
cout<<ans<<endl;
return 0;
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3608kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'