# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166534 | ToniB | Prosjek (COCI14_prosjek) | C++14 | 14 ms | 400 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int b[n] = {0};
for(int i = 0; i < n; ++i){
int bc;
cin >> bc;
b[i] = bc;
}
int a[n] = {0}, zbroj[n] = {0};
for(int i = 0; i < n; ++i){
zbroj[i] = b[i] * (i + 1);
}
for(int i = 0; i < n; ++i){
if(i == 0) a[i] = b[i];
if(i != 0) a[i] = b[i] * (i + 1) - zbroj[i - 1];
}
for(int i = 0; i < n; ++i){
cout << a[i] << " ";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |