Submission #471555

#TimeUsernameProblemLanguageResultExecution timeMemory
471555rainboySažetak (COCI17_sazetak)C11
64 / 160
24 ms10260 KiB
#include <stdio.h> #define N 5000000 int main() { static char marked[N]; int n, m, i, k, ans; scanf("%d%d", &n, &m); while (m--) { scanf("%d", &k); for (i = k; i < n; i += k) marked[i] = 1; } ans = 0; for (i = 0; i < n; i++) if (marked[i] && (i + 1 == n || marked[i + 1])) ans++; printf("%d\n", ans); return 0; }

Compilation message (stderr)

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