Submission #77145

# Submission time Handle Problem Language Result Execution time Memory
77145 2018-09-22T19:43:37 Z kimmypracha Prosjek (COCI14_prosjek) C++17
50 / 50
2 ms 580 KB
#include <bits/stdc++.h>
  using namespace std;
    long long A[200] , B[200];
    int main(){
        int n;
        scanf("%d",&n);
        for(int i = 1 ; i <= n ; ++i){
            scanf("%lld",&B[i]);
        }
        long long Sum = 0;
        for(int i = 1 ; i<= n; ++i){
                A[i] = B[i]*i - Sum;
                Sum = B[i]*i;
                printf("%lld ",A[i]);
        }
    }

Compilation message

prosjek.cpp: In function 'int main()':
prosjek.cpp:6:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&n);
         ~~~~~^~~~~~~~~
prosjek.cpp:8:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%lld",&B[i]);
             ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 1 ms 484 KB Output is correct
4 Correct 2 ms 484 KB Output is correct
5 Correct 2 ms 484 KB Output is correct
6 Correct 2 ms 496 KB Output is correct
7 Correct 2 ms 496 KB Output is correct
8 Correct 2 ms 496 KB Output is correct
9 Correct 2 ms 496 KB Output is correct
10 Correct 2 ms 580 KB Output is correct