結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
long long n,h,t;
int abab(int x){
	if(h%x==0)    return h/x;
	else return h/x+1;
}
struct noob{
	long long wz;
	long long 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;
	long long a[100010];
	for(int i=1;i<=n;i++){
		int kkk;
		cin>>kkk;
		tmp.wz=i;
		tmp.num=a[i]=abab(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