# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
241443 | NONAME | Sažetak (COCI17_sazetak) | C++14 | 24 ms | 5120 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 <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
bool mk[5 * int(1e6) + 10];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _LOCAL
freopen("in", "r", stdin);
freopen("out", "w", stdout);
#endif // _LOCAL
int n, m;
cin >> n >> m;
mk[n] = 1;
for (int i = 0; i < m; ++i) {
int x;
cin >> x;
for (int j = x; j <= n; j += x)
mk[j] = 1;
}
int ans = 0;
for (int i = 1; i < n; ++i)
ans += (mk[i] && mk[i + 1]);
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |