Submission #937536

# Submission time Handle Problem Language Result Execution time Memory
937536 2024-03-04T08:06:26 Z sleepntsheep Prosjek (COCI14_prosjek) C
50 / 50
1 ms 360 KB
#include<stdio.h>
int n;long long a[101],b[101],sa;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i)scanf("%lld",b+i);
    sa=a[1]=b[1];printf("%lld ",a[1]);
    for(int i=2;i<=n;++i){
        a[i]=b[i]*1ll*i-sa;
        sa+=a[i];
        printf("%lld ",a[i]);
    }
}

Compilation message

prosjek.c: In function 'main':
prosjek.c:4:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    4 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~
prosjek.c:5:26: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |     for(int i=1;i<=n;++i)scanf("%lld",b+i);
      |                          ^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 360 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct