Submission #392817

# Submission time Handle Problem Language Result Execution time Memory
392817 2021-04-21T20:51:18 Z rainboy Prosjek (COCI14_prosjek) C
50 / 50
1 ms 280 KB
#include <stdio.h>

#define N	100

int main() {
	static long long aa[N];
	int n, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%lld", &aa[i]);
		aa[i] *= i + 1;
	}
	for (i = n - 1; i > 0; i--)
		aa[i] -= aa[i - 1];
	for (i = 0; i < n; i++)
		printf("%lld ", aa[i]);
	printf("\n");
	return 0;
}

Compilation message

prosjek.c: In function 'main':
prosjek.c:9:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    9 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
prosjek.c:11:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   11 |   scanf("%lld", &aa[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 280 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 276 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 208 KB Output is correct