Submission #1099615

# Submission time Handle Problem Language Result Execution time Memory
1099615 2024-10-11T20:27:47 Z Petrix Spiderman (COCI20_spiderman) C++17
56 / 70
136 ms 29008 KB
#include <iostream>
using namespace std;

#define int long long

int v[2000001];
int ciur[2000001];
int frv[2000001];

signed main()
{
    int n,i,j,k,cnt=0;
    cin>>n>>k;
    for(i=1;i<=n;i++){
        cin>>v[i];
        if(v[i]>k){cnt++;
            frv[v[i]]++;
        }
    }
    for(i=1;i<=2e6;i++){
        if(frv[i]){
            for(j=i;j<=2e6;j+=i){
                ciur[j]+=frv[i];
            }
        }
    }
    for(i=1;i<=n;i++){
        if(v[i]>k) cout<<ciur[v[i]-k]<<" ";
        else if(v[i]==k) cout<<cnt<<" ";
        else cout<<"0 ";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 19 ms 19032 KB Output is correct
2 Correct 22 ms 17756 KB Output is correct
3 Correct 47 ms 20876 KB Output is correct
4 Correct 100 ms 24144 KB Output is correct
5 Incorrect 78 ms 25420 KB Output isn't correct
6 Incorrect 136 ms 29008 KB Output isn't correct
7 Correct 66 ms 25356 KB Output is correct
8 Correct 74 ms 25428 KB Output is correct
9 Correct 124 ms 28964 KB Output is correct
10 Correct 116 ms 28752 KB Output is correct