# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1223326 | Nomio | Spiderman (COCI20_spiderman) | C++20 | 110 ms | 19252 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e6 + 2;
ll cnt[N], T[N];
ll a[N];
int main() {
ll n, m, r, x, y, i, j, ans, t;
cin >> n >> m;
for (i = 1; i <= n; i ++) {
cin >> a[i];
cnt[a[i]] ++;
}
for (i =m + 1; i <= 1e6; i ++) {
for (j = 0; j <= 1e6; j += i) {
T[j] += cnt[i];
}
}
for (i = 1; i<= n; i ++ ) {
r = a[i] - m;
cout << T[r] << " ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |