結果

問題 No.3221 Count Turns
コンテスト
ユーザー vjudge1
提出日時 2025-10-26 17:33:43
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 585 bytes
コンパイル時間 4,537 ms
コンパイル使用メモリ 215,256 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-26 17:33:51
合計ジャッジ時間 7,412 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int n,h,t;
struct noob{
	int wz;
	double num;
	friend bool operator <(noob a,noob b){
		if(a.num!=b.num)return a.num>b.num;
		else  return a.wz>b.wz; 
	}
}tmp;
priority_queue <noob> q;
int c[100010];
int main(){
	cin>>n>>h>>t;
	double a[100010];
	for(int i=1;i<=n;i++){
		int kkk;
		cin>>kkk;
		tmp.wz=i;
		tmp.num=a[i]=(double)h/(double)kkk;
		q.push(tmp);
	}
	for(int i=1;i<=t;i++){
		tmp=q.top();
		q.pop();
		c[tmp.wz]++;
		tmp.num+=a[tmp.wz];
		q.push(tmp);
	} 
	for(int i=1;i<=n;i++){
		cout<<c[i]<<" ";
	}
	cout<<"\n";
	return 0;
}
 
0