Submission #471722

#TimeUsernameProblemLanguageResultExecution timeMemory
471722rainboyRasvjeta (COCI17_rasvjeta)C11
50 / 50
1 ms280 KiB
#include <stdio.h> int main() { int n, m, k, x, x_, ans; scanf("%d%d%d", &n, &m, &k); x = -k, ans = 0; while (m--) { scanf("%d", &x_); ans += (x_ - x - 1) / (k * 2 + 1), x = x_; } x_ = n + 1 + k; ans += (x_ - x - 1) / (k * 2 + 1), x = x_; printf("%d\n", ans); return 0; }

Compilation message (stderr)

rasjveta.c: In function 'main':
rasjveta.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d%d%d", &n, &m, &k);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
rasjveta.c:9:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%d", &x_);
      |   ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...