# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
701156 | rinho | Spiderman (COCI20_spiderman) | C++14 | 152 ms | 12400 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int n, k, a[1000000], ans[1000000], maxx = -1e9;
map<int, int> cnt;
void in(){
cin >> n >> k;
for(int i = 1; i <= n; i++) {
cin >> a[i];
cnt[a[i]]++;
maxx = max(maxx, a[i]);
}
}
void solve(){
for(auto i : cnt){
if(i.first <= k) continue;
for(int j = k; j <= maxx; j += i.first){
ans[j] += i.second;
}
}
for(int i = 1; i <= n; i++) cout << ans[a[i]] << ' ';
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
t = 1;
while(t--){
in();
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |