Submission #881321

# Submission time Handle Problem Language Result Execution time Memory
881321 2023-12-01T06:41:20 Z ilhan_arda Spiderman (COCI20_spiderman) C++17
0 / 70
1020 ms 6888 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fi first
#define se second
#define pb push_back
#define endl "\n"
//~ #define int long long
using namespace std;
 
typedef tuple<int, int, int> iii;
typedef long long ll;
const int mod =998244353;
 
int n, k;
int a[300005], mp[1000005];
 
int32_t main(){
	fast;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		mp[a[i]]++;
	}
	//~ sort(a+1, a+n+1);
	int temp=0;
	for(int i=1;i<=n;i++){
		if(a[i]<k){
			cout<<0<<" ";
			continue;
		}
		if(a[i]==k && !temp){
			temp=n;
			for(int j=1;j<=n;j++){
				if(a[j]<=k)temp--;
			}
			cout<<temp<<" ";
			//~ for(int j=1;j<=mp[k];j++)cout<<temp<<" ";
			continue;
		}
		else if(a[i]==k){
			cout<<temp<<" ";
			continue;
		}
		int ans=0;
		for(int  j=1;j*j<=a[i];j++){
			if(a[i]/j*j==a[i]){
				if(j>k)ans+=mp[j];
				if(j*j!=a[i] && a[i]/j>k)ans+=mp[a[i]/j];
				
			}
		}
		a[i]+=k;
		cout<<ans<<" ";
	}
	cout<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 4696 KB Output isn't correct
2 Incorrect 6 ms 4696 KB Output isn't correct
3 Incorrect 263 ms 5460 KB Output isn't correct
4 Incorrect 771 ms 6888 KB Output isn't correct
5 Incorrect 302 ms 4984 KB Output isn't correct
6 Incorrect 883 ms 6516 KB Output isn't correct
7 Incorrect 344 ms 4860 KB Output isn't correct
8 Incorrect 344 ms 4772 KB Output isn't correct
9 Incorrect 1012 ms 6356 KB Output isn't correct
10 Incorrect 1020 ms 6288 KB Output isn't correct