# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
238771 | iliaM | 평균 (COCI14_prosjek) | C++17 | 5 ms | 384 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 <bits/stdc++.h>
using namespace std;
#ifndef HELLO_PEOPLE
#define cerr if(0) cout
#endif
using ll = long long;
using ld = long double;
#define reps(a, b, x, s) \
for (decay<decltype(b)>::type x = a; x < b; x += s)
#define pers(b, a, x, s) \
for (decay<decltype(b)>::type x = b; x >= a; x -= s)
#define rep(a, b, x) reps(a, b, x, 1)
#define per(b, a, x) pers(b, a, x, 1)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define X first
#define Y second
template<class C>
inline int constexpr __size(C c) { return c.size(); }
#define size __size
template<int D, class T>
struct vec : public vector<vec<D - 1, T>> {
template <class... Args>
vec(int n = 0, Args... a) :
vector<vec<D - 1, T>>(n, vec<D - 1, T>(a...)) {}
};
template<typename T>
struct vec<1, T> : public vector<T> {
vec(int n = 0, T const &val = T()) :
vector<T>(n, val) {}
};
// now start
ll const INF = 1e14;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> a(n);
rep (0, n, i) cin >> a[i];
ll sum = a[0];
vector<ll> b(n);
b[0] = a[0];
rep (1, n, i) {
b[i] = a[i] * (i + 1) - sum;
sum += b[i];
}
rep (0, n, i) cout << b[i] << ' ';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |