QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#741599 | #9628. 骰子 | oqmsac | AC ✓ | 0ms | 3684kb | C++23 | 1020b | 2024-11-13 14:44:36 | 2024-11-13 14:44:39 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<ll,ll>
using namespace std;
#pragma GCC optimize(3)
#define N 600005
#define M 998244353
ll a[205];
ll mp(ll x,ll p)
{
ll ans=1,base=x;
for(int i=0;(1ll<<i)<=p;i++)
{
if((1ll<<i)&p)
{
ans*=base;
ans%=M;
}
base*=base;
base%=M;
}
return ans;
}
ll x[4]={6,3,1,4};
ll y[4]={6,2,1,5};
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll a,b,ans=0;
cin>>a>>b;
if(a>=2&&b>=2)
{
cout<<a*b*6;
return 0;
}
if(a==1)
{
for(int i=0;i<b;i++)
{
ans+=x[i];
}
}
else
{
for(int i=0;i<a;i++)
{
ans+=y[i];
}
}
cout<<ans;
return 0;
}
//1 0 0 0 0 0 0 0 2
// 99 88 77 66 55 44 33 22 11
// 100 90 80 70 60 50 40 30 20
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'