# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
638142 | 2022-09-04T18:46:59 Z | Mr_Ph | Spiderman (COCI20_spiderman) | C++14 | 80 ms | 10276 KB |
///Never gonna give you up. #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> typedef long long ll; typedef long long int lli; typedef unsigned long long ull; using namespace std; using namespace __gnu_pbds; template<class x> using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>; const ll mod=(ll)1e9+7; const ll mod1=998244353; ///the defines :) #define endl '\n' #define vi vector<int> #define vll vector<ll> #define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i]; #define all(arr) arr.begin(),arr.end() #define allr(arr) arr.rbegin(),arr.rend() #define sz size() ///the end of the defines ;) void bla() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("notsus.txt","w",stdout); #endif } ll power(ll x,ll y) { if(y==0) return 1; if(y==1) return x%mod; ll r=power(x%mod,(y%mod)/2)%mod; if(y%2) return ((r%mod)*(r%mod)*(x%mod)); else return ((r%mod)*(r%mod)); } ll lcm(ll a,ll b) { return max(a,b)/__gcd(a,b)*min(a,b); } void preprocess(){} void solve() { int n,k; cin>>n>>k; vi mp(1e6+1); vi arr(n); ent(arr); vi mp1(1e6+1); int x=*max_element(all(arr)); for(int i=0;i<n;i++)mp[arr[i]]++; for(int i=k+1;i<=x;i++) { for(int j=k;j<=x;j+=i) mp1[j]+=mp[i]; } for(int i=0;i<n;i++) cout<<mp1[arr[i]]<<" "; } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); preprocess(); //bla(); int t=1; //cin>>t; while(t--) solve(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 8148 KB | Output is correct |
2 | Correct | 21 ms | 8168 KB | Output is correct |
3 | Correct | 34 ms | 8804 KB | Output is correct |
4 | Correct | 60 ms | 10276 KB | Output is correct |
5 | Incorrect | 36 ms | 8680 KB | Output isn't correct |
6 | Incorrect | 71 ms | 10192 KB | Output isn't correct |
7 | Correct | 32 ms | 8676 KB | Output is correct |
8 | Correct | 37 ms | 8700 KB | Output is correct |
9 | Correct | 80 ms | 10028 KB | Output is correct |
10 | Correct | 69 ms | 10056 KB | Output is correct |