답안 #87795

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
87795 2018-12-02T15:08:44 Z asifthegreat 평균 (COCI14_prosjek) C++14
50 / 50
3 ms 860 KB
#include <bits/stdc++.h>
using namespace std;

long long ara[1000];
int n;

int main()
{
    scanf("%d",&n);
    long long num;
    long long sum = 0;
    for(int i = 1; i <= n;i++){
        scanf("%lld",&num);
        long long k = num*i;
        long long ans = k-sum;
        printf("%lld ",ans);
        sum = k;
    }puts("");
    return 0;
}

Compilation message

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:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld",&num);
         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 3 ms 596 KB Output is correct
4 Correct 3 ms 708 KB Output is correct
5 Correct 3 ms 860 KB Output is correct
6 Correct 2 ms 860 KB Output is correct
7 Correct 2 ms 860 KB Output is correct
8 Correct 3 ms 860 KB Output is correct
9 Correct 2 ms 860 KB Output is correct
10 Correct 2 ms 860 KB Output is correct