# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
471555 | rainboy | Sažetak (COCI17_sazetak) | C11 | 24 ms | 10260 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |