답안 #643880

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
643880 2022-09-23T07:41:41 Z MuntherCarrot Spiderman (COCI20_spiderman) C++14
56 / 70
799 ms 8192 KB
#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 = 1e6+1;
void solve(){
    int n, k;
    cin >> n >> k;
    int arr[n];
    vector<int> frq(MX, 0);
    for(int &i : arr)
        cin >> i;
    for(int i : arr){
        if(i <= k) continue;
        for(int j=k;j<MX;j+=i){
            frq[j]++;
        }
    }
    for(int i : arr)
        cout << frq[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 7 ms 4144 KB Output is correct
2 Correct 9 ms 4180 KB Output is correct
3 Correct 313 ms 5484 KB Output is correct
4 Correct 799 ms 8020 KB Output is correct
5 Incorrect 51 ms 5452 KB Output isn't correct
6 Incorrect 156 ms 8192 KB Output isn't correct
7 Correct 43 ms 5356 KB Output is correct
8 Correct 51 ms 5496 KB Output is correct
9 Correct 179 ms 8052 KB Output is correct
10 Correct 138 ms 7976 KB Output is correct