# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
844464 | vjudge1 | Spiderman (COCI20_spiderman) | C++17 | 780 ms | 6320 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lg2(x) (63 - __builtin_clzll(x))
#define db cerr << "BREAK\n"
#define fp(...) fprintf(stderr, __VA_ARGS__)
#define rs(a) a.resize(n)
#define hizli cin.tie(0);ios_base::sync_with_stdio(0)
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(a, b) for (int a = 0; a < b; a++)
#define af(x) for(auto&a:x)fp("%d ",a);fp("\n")
#define ff first
#define ss second
#define zekochain main
// clang-format on
template <typename... Args> void in(Args &&...args) {
(std::cin >> ... >> args);
}
const int N = 2e5 + 5, MOD = 1e9 + 7;
int zekochain() {
hizli;
int n, k;
cin >> n >> k;
vector<int> v(n);
vector<int> mark(1e6 + 1);
int mx = 0;
bool in = 0;
for (auto &a : v) {
cin >> a;
if (a == k) {
in = 1;
}
mx = max(mx, a);
}
mark[0] = n;
for (int i = 0; i < n; i++) {
if (v[i] < k) {
mark[0]--;
continue;
}
for (int j = v[i]; j <= mx - k + 2; j += v[i]) {
mark[j]++;
}
}
for (int i = 0; i < n; i++) {
int ans = 0;
if (v[i] < k) {
cout << ans << endl;
continue;
}
if (v[i] >= k) {
ans = mark[v[i] - k];
}
if (in && v[i] % k == 0) {
ans--;
}
cout << ans << " ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |