CSES - Harjoituskisa 14.1.2018 - Results
Submission details
Task:Alitaulukot
Sender:SeveriK
Submission time:2018-01-14 20:01:03 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.04 s1details
#20.18 s2details

Code

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

typedef unsigned int uint;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define PI 3.1415926535897932384626433

int main()
{
	ull output = 0;
	ull n = 0, multiplier = 0;
	std::cin >> n;
	vector<ull> inputs;

	for (ull i = 0; i < n; i++)
	{
		ull a = 0;
		std::cin >> a;
		inputs.push_back(a);
	}

	for (ull i = 0; i < n; i++)
	{
		multiplier += powl(2, i);
	}
	multiplier /= n;
	for (ull i = 0; i < n; i++)
	{
		output += inputs[i] * multiplier;
	}

	output = output % 1000000007;

	std::cout << output << "\n";

	int w;
	std::cin >> w;

	return 0;
}

Test details

Test 1

Group: 1

Verdict:

input
100
72 66 50 11 3 15 68 45 79 11 9...

correct output
9437440

user output
0

Test 2

Group: 2

Verdict:

input
100000
483398076 227177515 705421329 ...

correct output
179178131

user output
0