Submission #206142

#TimeUsernameProblemLanguageResultExecution timeMemory
206142aloo123Prosjek (COCI14_prosjek)C++14
50 / 50
5 ms376 KiB
#include <bits/stdc++.h> #define ll long long #define ld long double #define f first #define s second #define mp make_pair #define pb push_back #define vll vector<ll> #define pll pair<ll,ll> using namespace std; const ll N = 2e5+5; const ll MOD = 1e9+7; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); ll n; cin >> n; ll a[n+1]; for(int i =1;i<=n;i++) cin >> a[i]; ll b[n+1]; b[1] = a[1]; ll sum = b[1]; for(int i =2;i<=n;i++){ // (sum + x)/i = a[i] // sum + x = a[i] * i // x = a[i] * i -sum b[i] = (a[i] * i) - sum; sum += b[i]; } for(int i=1;i<=n;i++) cout<<b[i]<<" ";cout<<endl; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:36:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(int i=1;i<=n;i++) cout<<b[i]<<" ";cout<<endl;
  ^~~
prosjek.cpp:36:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for(int i=1;i<=n;i++) cout<<b[i]<<" ";cout<<endl;
                                        ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...