제출 #202370

#제출 시각아이디문제언어결과실행 시간메모리
202370EmmanuelACSpiderman (COCI20_spiderman)C++14
70 / 70
703 ms8260 KiB
#include <bits/stdc++.h>

	using namespace std;

#define ll long long
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n; i>=0; i--)
#define FOREACH(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define st first
#define fi first
#define nd second
#define se second
#define vi vector<int>
#define vii vector< vi >
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define endl "\n"

int N, K;
int Arr[300000];
int Ocur[1000100];

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> N >> K;
	REP(i, N){
		cin >> Arr[i];
		if(Arr[i] > K){
			for(int s = K; s <= 1000100; s+=Arr[i])
				Ocur[s]++;
		}
	}

	REP(i, N){
		cout << Ocur[Arr[i]] - (K == 0 ? 1 : 0) << " ";
	}
	cout << "\n";
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...