QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#743536#9628. 骰子ntalking#AC ✓0ms3620kbC++17716b2024-11-13 19:26:032024-11-13 19:26:04

Judging History

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

  • [2024-11-13 19:26:04]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3620kb
  • [2024-11-13 19:26:03]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define ll long long
ll n, m;
void solve() {
	cin >> n >> m;
	ll row[] = {0, 6, 9, 10}, col[] = {0, 6, 8, 9};
	if((n >= 2 && m >=2) || (n == 1 && m == 1)) cout << 6 * n * m << endl;
	else if(n == 1) cout << m / 4 * 14 + row[m % 4] <<endl;
	else if(m == 1) cout << n / 4 * 14 + col[n % 4] << endl;
}
int main() {
#ifdef xrl
	freopen("in.txt", "r", stdin), freopen("out.txt", "w", stdout);
#endif
	FAST_IO;
	int _ = 1;
	//cin >> _;
	while(_ --) solve();
#ifdef xrl
	cout << "Time used = " << (double)(clock() * 1.0 / CLOCKS_PER_SEC) << "s";
#endif
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

987 654

output:

3872988

result:

ok single line: '3872988'