Submission #238771

#TimeUsernameProblemLanguageResultExecution timeMemory
238771iliaM평균 (COCI14_prosjek)C++17
50 / 50
5 ms384 KiB
#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 timeMemoryGrader output
Fetching results...