QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#736757#9628. 骰子SSAABBEERR#AC ✓0ms3636kbC++201.2kb2024-11-12 13:14:222024-11-12 13:14:22

Judging History

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

  • [2024-11-12 13:14:22]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3636kb
  • [2024-11-12 13:14:22]
  • 提交

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'