Submission #398712

# Submission time Handle Problem Language Result Execution time Memory
398712 2021-05-04T18:25:24 Z Alexandra Prosjek (COCI14_prosjek) C++14
50 / 50
1 ms 316 KB
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	vector<int> b;
	vector<int> a;

	cin >> n;
	for (int i=0; i<n; i++) {
		int c;
		cin >> c;
		b.push_back(c);
	}

	a.push_back(b[0]);
	int media=a[0];

	for (int nums=1; nums<n; nums++) {
		a.push_back(b[nums]*(nums+1)-media);
		media += a[nums];
	}

	for (int i=0; i<n; i++) {
		cout << a[i];
		if (i!=(n-1)) {
			cout << " ";
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 316 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 316 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct