QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#755246 | #9628. 骰子 | rdcamelot | AC ✓ | 0ms | 3688kb | C++20 | 609b | 2024-11-16 16:50:55 | 2024-11-16 16:50:55 |
Judging History
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;
}
详细
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'