# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
844308 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 155 ms | 10576 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> h(N);
map<int, int> cnt;
for (int i = 0;i < N; ++i) {
cin >> h[i];
cnt[h[i]] += 1;
}
int MAX_H = 1e6 + 37;
vector<int> div_cnt(MAX_H);
for (auto [i, num] : cnt) {
if (i <= K) {
continue;
}
for (int j = 0;i * j < MAX_H; ++j) {
div_cnt[i * j] += num;
}
}
for (int i = 0;i < N; ++i) {
if (h[i] - K < 0) {
cout << 0 << ' ';
continue;
}
cout << (div_cnt[h[i] - K] - (K == 0)) << ' ';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |