QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#741599#9628. 骰子oqmsacAC ✓0ms3684kbC++231020b2024-11-13 14:44:362024-11-13 14:44:39

Judging History

你现在查看的是最新测评结果

  • [2024-11-13 14:44:39]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3684kb
  • [2024-11-13 14:44:36]
  • 提交

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

详细

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'