Submission #543960

# Submission time Handle Problem Language Result Execution time Memory
543960 2022-03-31T17:20:38 Z AlperenT Spiderman (COCI20_spiderman) C++17
56 / 70
135 ms 19212 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 + 5;

long long n, k, arr[N], cnt[N], ans[N];

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);

    cin >> n >> k;

    for(int i = 1; i <= n; i++){
        cin >> arr[i];
        cnt[arr[i]]++;
    }

    for(int i = k + 1; i < N; i++){
        for(int j = k; j < N; j += i){
            ans[j] += cnt[i];
        }
    }

    for(int i = 1; i <= n; i++) cout << ans[arr[i]] << " ";
}
# Verdict Execution time Memory Grader output
1 Correct 53 ms 11124 KB Output is correct
2 Correct 45 ms 9892 KB Output is correct
3 Correct 64 ms 12328 KB Output is correct
4 Correct 100 ms 14468 KB Output is correct
5 Incorrect 75 ms 16876 KB Output isn't correct
6 Incorrect 102 ms 19212 KB Output isn't correct
7 Correct 62 ms 16876 KB Output is correct
8 Correct 72 ms 16908 KB Output is correct
9 Correct 135 ms 19012 KB Output is correct
10 Correct 98 ms 18968 KB Output is correct