QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#737782 | #9628. 骰子 | koishii | AC ✓ | 0ms | 3640kb | C++17 | 619b | 2024-11-12 16:51:13 | 2024-11-12 16:51:14 |
Judging History
answer
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false),cin.tie(0)//,cout.tie(0)
int T = 1; using ll = long long; using ff = double;
using pii = std::pair<int,int>;
const int INF = 0x3f3f3f3f;const int mod = 1e9+7;
using namespace std;
ll d1[] = {1,3,6,4};
ll d2[] = {1,2,6,5};
void sol(){
ll n,m;cin >> n >> m;
ll ans = 0;
if(n == 1){
for(int i = 0;i < m;i++){
ans += d1[i%4];
}
}
else if(m == 1){
for(int i = 0;i < n;i++){
ans += d2[i%4];
}
}
else ans += n*m*6;
cout << ans;
}
int main() {
fastio;
//cin >> T;
while(T--){ sol(); }
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
2 2
output:
24
result:
ok single line: '24'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
1000 1000
output:
6000000
result:
ok single line: '6000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
987 654
output:
3872988
result:
ok single line: '3872988'