QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#736757 | #9628. 骰子 | SSAABBEERR# | AC ✓ | 0ms | 3636kb | C++20 | 1.2kb | 2024-11-12 13:14:22 | 2024-11-12 13:14:22 |
Judging History
answer
#include<bits/stdc++.h>
#define lowbit(x) (x & (-x))
#define endl "\n"
#define ll long long
#define int long long
#define ull unsigned long long
#define fi first
#define se second
using namespace std;
#define pii pair<int, int>
#define rep(i, a, b) for(int i = a; i <= b; i ++ )
#define pre(i, a, b) for(int i = a; i >= b; i -- )
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
mt19937_64 rnd(time(0));
const int N = 1e6 + 10;
int n,m;
void solve()
{
cin>>n>>m;
if(n==1&&m==1){
cout<<"6\n";
}
else if(n==1){
int ans=0;
if(m%4==1)ans=6;
else if(m%4==2)ans=9;
else if(m%4==3)ans=10;
ans+=14*(m/4);
cout<<ans<<"\n";
}
else if(m==1){
int ans=0;
if(n%4==1)ans=6;
else if(n%4==2)ans=8;
else if(n%4==3)ans=9;
ans+=14*(n/4);
cout<<ans<<"\n";
}
else{
int ans=n*m*6;
cout<<ans<<"\n";
}
}
signed main()
{
// IOS;
int _;
_ = 1;
// cin >> _;
// scanf("%d", &_);
while(_ -- )
{
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3592kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'