QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#809524#9628. 骰子Nana7#AC ✓1ms3668kbC++14667b2024-12-11 15:43:172024-12-11 15:43:24

Judging History

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

  • [2024-12-11 15:43:24]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3668kb
  • [2024-12-11 15:43:17]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#define I inline
#define int long long
using namespace std;
/* 
2
  630
  3029 2336 377 41 10 61
  3000
  20000 10000 0 0 0 0

*/
int n,m;

signed main()
{
	cin>>n>>m;
	if(n>=2&&m>=2) {
		cout<<m*n*6<<endl;
		return 0;
	}	
	if(n==1) {
		int x[4]={6,3,1,4},sm=14;
		int ans=m/4*sm;
		if(m%4>=1) ans+=x[0];
		if(m%4>=2) ans+=x[1];
		if(m%4>=3) ans+=x[2];
		cout<<ans<<endl;
		return 0;
	}
	if(m==1) {
		int x[4]={6,2,1,5},sm=14;
		int ans=m/4*sm;
		if(m%4>=1) ans+=x[0];
		if(m%4>=2) ans+=x[1];
		if(m%4>=3) ans+=x[2];
		cout<<ans<<endl;
		return 0;
	}
 }  

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3608kb

input:

2 2

output:

24

result:

ok single line: '24'

Test #2:

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

input:

1000 1000

output:

6000000

result:

ok single line: '6000000'

Test #3:

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

input:

987 654

output:

3872988

result:

ok single line: '3872988'