#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define ll long long
#define endl "\n"
#define all(x) x.begin(),x.end()
const int MOD = 0, SZ = 1e4+5e3, MX = 1e9;
void solve(){
int n, k;
cin >> n >> k;
int arr[n], ans[n]={};
for(int &i : arr) cin >> i;
for(int i=0;i<n;i++){
if(arr[i] < k) continue;
for(int j=0;j<n;j++){
if(j == i) continue;
if(arr[i] % arr[j] == k) ans[i]++;
}
}
for(int i : ans)
cout << i << ' ';
}
signed main()
{
//ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// int test;
// cin >> test;
// while(test--)
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
212 KB |
Output is correct |
2 |
Correct |
21 ms |
312 KB |
Output is correct |
3 |
Execution timed out |
2075 ms |
1564 KB |
Time limit exceeded |
4 |
Execution timed out |
2013 ms |
4272 KB |
Time limit exceeded |
5 |
Execution timed out |
2078 ms |
1620 KB |
Time limit exceeded |
6 |
Execution timed out |
2072 ms |
4532 KB |
Time limit exceeded |
7 |
Execution timed out |
2060 ms |
1696 KB |
Time limit exceeded |
8 |
Execution timed out |
2067 ms |
1692 KB |
Time limit exceeded |
9 |
Execution timed out |
2057 ms |
4556 KB |
Time limit exceeded |
10 |
Execution timed out |
2069 ms |
4556 KB |
Time limit exceeded |