답안 #198967

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
198967 2020-01-28T12:56:39 Z virchau13 Spiderman (COCI20_spiderman) C++17
49 / 70
2000 ms 12408 KB
#include <iostream>
#include <algorithm>
#include <set>
#include <deque>
using namespace std;

const long long SIZE = 1000007;

bool v[1000007] = {};
long long ans[1000007] = {};

int main(){
    long long n, k;
    cin >> n >> k;
    long long arr[n];
    for(long long i = 0; i < n; i++){
        cin >> arr[i];
        v[arr[i]] = 1;
    }
    for(long long i = 0; i < n; i++){
        if(arr[i] > k) for(long long j = k; j < SIZE; j += arr[i]) ans[j]++;
    }
    for(long long i = 0; i < n; i++){
        cout << ans[arr[i]] << ' ';
    }
    cout << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 9080 KB Output is correct
2 Correct 48 ms 8952 KB Output is correct
3 Correct 1622 ms 10232 KB Output is correct
4 Execution timed out 2092 ms 11488 KB Time limit exceeded
5 Incorrect 158 ms 10188 KB Output isn't correct
6 Incorrect 399 ms 12408 KB Output isn't correct
7 Correct 125 ms 10104 KB Output is correct
8 Correct 137 ms 10104 KB Output is correct
9 Correct 445 ms 12408 KB Output is correct
10 Correct 376 ms 12280 KB Output is correct