Submission #439778

# Submission time Handle Problem Language Result Execution time Memory
439778 2021-06-30T19:12:15 Z rainboy Tarifa (COCI16_tarifa) C
50 / 50
1 ms 204 KB
#include <stdio.h>

int main() {
	int n, ans;

	scanf("%d%d", &ans, &n), ans *= (n + 1);
	while (n--) {
		int x;

		scanf("%d", &x);
		ans -= x;
	}
	printf("%d\n", ans);
	return 0;
}

Compilation message

tarifa.c: In function 'main':
tarifa.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d%d", &ans, &n), ans *= (n + 1);
      |  ^~~~~~~~~~~~~~~~~~~~~~~
tarifa.c:10:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   scanf("%d", &x);
      |   ^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 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 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct