# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
735081 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// author: MisterReaper (Ahmet Alp Orakci)
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXH = 1e6 + 5;
#ifndef ONLINE_JUDGE
#include "debug.h"
#define OPEN freopen(".in", "r", stdin); freopen(".out", "w", stdout);
#define TIME cerr << "\n" << fixed << setprecision(2) << 1000.0 * clock() / CLOCKS_PER_SEC << " milliseconds ";
#else
#define debug(...) void(23)
#define OPEN void(0000)
#define TIME void(232323233)
#endif
int ans[MAXH];
void solve()
{
int n, k; cin >> n >> k;
int arr[n];
for(int &i : arr) cin >> i;
map <int, int> mp;
for(int i : arr) mp[i]++;
for(auto i : mp)
{
if(i.first <= k) continue;
for(int j = k; j < MAXH; j += i.first)
ans[j] += i.second;
if(k == 0) ans[i.first] -= i.second;
}
for(int i : arr) cout << ans[i] << " ";
return;
}
int32_t main()
{
OPEN;
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int t = 1; //cin >> t;
while(t--)
{
solve();
}
TIME;
return 0;
}