# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481401 | 2021-10-20T16:32:13 Z | rainboy | Spiderman (COCI20_spiderman) | C | 83 ms | 10052 KB |
#include <stdio.h> #define N 300000 #define A 1000000 int main() { static int aa[N], kk[A + 1], ans[A + 1]; int n, r, i, a, b; scanf("%d%d", &n, &r); for (i = 0; i < n; i++) { scanf("%d", &aa[i]); kk[aa[i]]++; } for (a = r + 1; a <= A; a++) for (b = r == 0 ? a * 2 : r; b <= A; b += a) ans[b] += kk[a]; for (i = 0; i < n; i++) printf("%d ", ans[aa[i]]); printf("\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 6516 KB | Output is correct |
2 | Correct | 15 ms | 5652 KB | Output is correct |
3 | Correct | 35 ms | 7192 KB | Output is correct |
4 | Correct | 72 ms | 8564 KB | Output is correct |
5 | Correct | 35 ms | 8644 KB | Output is correct |
6 | Incorrect | 83 ms | 10052 KB | Output isn't correct |
7 | Correct | 35 ms | 8648 KB | Output is correct |
8 | Correct | 55 ms | 8676 KB | Output is correct |
9 | Correct | 80 ms | 9924 KB | Output is correct |
10 | Correct | 79 ms | 9924 KB | Output is correct |