Submission #166534

#TimeUsernameProblemLanguageResultExecution timeMemory
166534ToniBProsjek (COCI14_prosjek)C++14
50 / 50
14 ms400 KiB
#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 timeMemoryGrader output
Fetching results...