#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base :: sync_with_stdio(0);
cin.tie(0) , cout.tie(0);
int n , k;
cin >> n >> k;
vector<int> h(n);
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < n; i++) {
int tot = 0;
for (int j = 0; j < n; j++) {
if (i == j) {
continue;
}
if (h[i] % h[j] == k) {
tot++;
}
}
cout << tot << " ";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
376 KB |
Output is correct |
2 |
Correct |
19 ms |
376 KB |
Output is correct |
3 |
Execution timed out |
2027 ms |
912 KB |
Time limit exceeded |
4 |
Execution timed out |
2045 ms |
1572 KB |
Time limit exceeded |
5 |
Execution timed out |
2021 ms |
760 KB |
Time limit exceeded |
6 |
Execution timed out |
2063 ms |
1568 KB |
Time limit exceeded |
7 |
Execution timed out |
2040 ms |
888 KB |
Time limit exceeded |
8 |
Execution timed out |
2074 ms |
888 KB |
Time limit exceeded |
9 |
Execution timed out |
2017 ms |
1576 KB |
Time limit exceeded |
10 |
Execution timed out |
2036 ms |
1568 KB |
Time limit exceeded |