30分,7个RE咋回事?
查看原帖
30分,7个RE咋回事?
892470
DL_Lingkong楼主2023/5/12 18:45

30分,7个RE?

我的代码如下:

#include <iostream>
using namespace std;
typedef long long int LLI;
const int N = 2e8;
LLI s = 0,a[N] = {};
int n,num[114514] = {};
int main()
{
	ios_base::sync_with_stdio(false);
	cin >> n;
	for(int i = 1;i <= n;i++)
	{
		cin >> num[i];
		a[i] = a[i - 1] + num[i];
	}
	for(int i = 1;i <= n;i++)
	{
		s += num[i] * (a[n] - a[i]);
	}
	cout << s;
	return 0;
}

但是提交以后发现是30分,有7个RE,我检查了数组也没问题啊,那么RE是咋回事?

2023/5/12 18:45
加载中...