Submission #37660

#TimeUsernameProblemLanguageResultExecution timeMemory
37660szawinisSažetak (COCI17_sazetak)C++14
64 / 160
19 ms6896 KiB
#include <bits/stdc++.h> using namespace std; const int N = 5e6+1; int n, m, ans; bool mark[N]; int main() { scanf("%d %d", &n, &m); for(int i = 0, k; i < m; i++) { scanf("%d", &k); for(int j = k; j <= n; j += k) mark[j] = true; } mark[0] = mark[n] = true; for(int i = 1; i <= n; i++) ans += mark[i] && mark[i-1]; printf("%d", ans); }

Compilation message (stderr)

sazetak.cpp: In function 'int main()':
sazetak.cpp:8:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
                        ^
sazetak.cpp:10:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &k);
                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...