# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
500263 | Mounir | Spiderman (COCI20_spiderman) | C++14 | 380 ms | 24772 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define pb push_back
#define pii pair<int, int>
#define chmin(x, v) x = min(x, v)
#define chmax(x, v) x = max(x, v)
#define x first
#define y second
#define int long long
using namespace std;
const int N = 2e6 + 1;
int nDiv[N];
signed main(){
int nVals, k; cin >> nVals >> k;
vector<int> vals(nVals);
map<int, int> occs;
for (int& val : vals){
cin >> val;
if (val > k)
occs[val]++;
}
for (auto paire : occs){
int val = paire.first, nOccs = paire.second;
for (int j = 0; j < N; j += val){
nDiv[j] += nOccs;
if (j == val && k == 0)
nDiv[j]--;
}
}
for (int val : vals){
if (val < k)
cout << 0 << " ";
else
cout << nDiv[val - k] << " ";
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |