Submission #233743

#TimeUsernameProblemLanguageResultExecution timeMemory
233743DodgeBallManProsjek (COCI14_prosjek)C++14
50 / 50
5 ms384 KiB
#include <bits/stdc++.h> using namespace std; const int N = 110; int n, a[N], sum[N]; int main() { scanf("%d",&n); for( int i = 1 ; i <= n ; i++ ) scanf("%d",&a[i]); for( int i = 1 ; i <= n ; i++ ) { a[i] = a[i] * i - sum[i-1]; sum[i] = sum[i-1] + a[i]; } for( int i = 1 ; i <= n ; i++ ) printf("%d ",a[i]); return 0; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
prosjek.cpp:10:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for( int i = 1 ; i <= n ; i++ ) scanf("%d",&a[i]);
                                     ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...