답안 #20229

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20229 2016-05-02T04:45:17 Z leporem91 평균 (COCI14_prosjek) C++
50 / 50
2 ms 0 KB
#include <stdio.h>
#include <algorithm>
using namespace std;
#define MAXN 105

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

Compilation message

prosjek.cpp: In function 'int main()':
prosjek.cpp:9:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
prosjek.cpp:13:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   long long n; scanf("%lld", &n);
                                 ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 0 KB Output is correct
2 Correct 2 ms 0 KB Output is correct
3 Correct 1 ms 0 KB Output is correct
4 Correct 1 ms 0 KB Output is correct
5 Correct 1 ms 0 KB Output is correct
6 Correct 1 ms 0 KB Output is correct
7 Correct 1 ms 0 KB Output is correct
8 Correct 1 ms 0 KB Output is correct
9 Correct 1 ms 0 KB Output is correct
10 Correct 1 ms 0 KB Output is correct