0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 23:08:47 +00:00

#90. 【2019.10雅礼集训23日pmT1】Divisors

https://sjzezoj.com/submission/40960
This commit is contained in:
Baoshuo Ren 2021-10-21 22:42:45 +08:00 committed by Baoshuo Ren
parent 5699f161cf
commit 49f5d9c4f6
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

30
S2OJ/90/90.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
int n, m, a[205], sum[205];
map<int, int> b;
int main() {
cin >> n >> m;
for (int i = 1; i <= m; i++) {
cin >> a[i];
}
sum[0] = n;
for (int i = 1; i <= m; i++) {
for (int j = 1; j * j <= a[i] && j <= n; j++) {
if (a[i] % j == 0) {
sum[b[j]]--;
sum[++b[j]]++;
if (j * j != a[i] && a[i] / j <= n) {
sum[b[a[i] / j]]--;
sum[++b[a[i] / j]]++;
}
}
}
}
for (int i = 0; i <= m; i++) {
cout << sum[i] << endl;
}
return 0;
}