Submission #440572

# Submission time Handle Problem Language Result Execution time Memory
440572 2021-07-02T13:16:09 Z colossal_pepe Spiderman (COCI20_spiderman) C++17
35 / 70
71 ms 9096 KB
#include <iostream>
using namespace std;

int n, k, city[100005], cnt[1000005], divisors[1000005];


int main() {
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> city[i];
        cnt[city[i]] += 1;
    }
    for (int i = k + 1; i < 1000005; i++) {
        for (int j = 0; j < 1000005; j += i) {
            divisors[j] += cnt[i];
        }
    }
    for (int i = 0; i < n; i++) {
        cout << (city[i] >= k ? divisors[city[i] - k] : 0) << ' ';
    }
    cout << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 19 ms 6476 KB Output is correct
2 Correct 22 ms 5648 KB Output is correct
3 Correct 65 ms 7236 KB Output is correct
4 Incorrect 42 ms 6212 KB Output isn't correct
5 Incorrect 71 ms 8700 KB Output isn't correct
6 Incorrect 50 ms 8400 KB Output isn't correct
7 Correct 65 ms 8708 KB Output is correct
8 Correct 70 ms 8660 KB Output is correct
9 Runtime error 42 ms 9096 KB Execution killed with signal 11
10 Runtime error 42 ms 9064 KB Execution killed with signal 11