社区讨论

96分,求助

B3954[GESP202403 二级] 乘法问题参与者 2已保存回复 3

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
3 条
当前快照
1 份
快照标识符
@lvfbm5u6
此快照首次捕获于
2024/04/25 22:10
2 年前
此快照最后确认于
2024/04/26 14:26
2 年前
查看原帖
CPP
#include <bits/stdc++.h>
using namespace std;
#define wrap() printf("\n")
#define print(x) printf("%lld",x);
typedef long long int ll;
typedef int inter;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef unsigned __int128 uint128;	
const int E = 1e6+10;
const int S = 1e7+10;
const int U = 1<<30;
const int T = 1e4*2+10;
const int F = 65540;//F = 65535 + 5
const int Q = 1010;
const long long Y = 1LL<<60LL;	
const int maxp = 1e5 + 10;

int x;
long long ans=1;

int main()
{
	cin >> x;
	for(;x--;)
	{
		long long y;
		cin >> y;
		if(ans > (long long)1e6) 
		{
			ans = -1;
		}else
		{
			ans *= y;
		}
	}
	if(ans == -1 || ans > (long long)1e6) printf(">1000000");
	else print(ans);
}
#undef wrap
#undef print

回复

3 条回复,欢迎继续交流。

正在加载回复...