QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#739055 | #9628. 骰子 | lwl2005 | AC ✓ | 1ms | 3688kb | C++14 | 674b | 2024-11-12 20:43:34 | 2024-11-12 20:43:35 |
Judging History
answer
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int x[5],y[5],sum1[5],sum2[5];
sum1[0]=0,sum2[0]=0;
x[1]=6;
x[2]=3;
x[3]=1;
x[4]=4;
y[1]=6;
y[2]=2;
y[3]=1;
y[4]=5;
for(int i=1;i<=4;i++)
{
sum1[i]=sum1[i-1]+x[i];
sum2[i]=sum2[i-1]+y[i];
}
if(b==1)
{
int t=a/4;
int u=a%4;
int p=(6+3+1+4)*t+sum1[u];
cout<<p;
}
else if(a==1)
{
int t=b/4;
int u=b%4;
int p=(6+2+1+5)*t+sum2[u];
cout<<p;
}
else
{
cout<<a*b*6;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3688kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'