結果

問題 No.3221 Count Turns
ユーザー 沙耶花
提出日時 2025-08-01 21:50:45
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 961 bytes
コンパイル時間 4,214 ms
コンパイル使用メモリ 257,732 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2025-08-01 21:50:54
合計ジャッジ時間 8,104 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000005
#define Inf64 1000000000000000001LL
using P = pair<int,int>;
P op(P a,P b){
	return min(a,b);
}
P e(){
	return {Inf32,Inf32};
}
P mapping(long long a,P b){
	b.first += a;
	return b;
}

long long composition(long long a,long long b){
	return a+b;
}
long long id(){
	return 0;
}
int main(){
	int N,H,T;
	cin>>N>>H>>T;
	vector<int> need(N);
	rep(i,N){
		cin>>need[i];
		need[i] = (H+need[i]-1)/need[i];
	}
	vector<int> ans(N);
	lazy_segtree<P,op,e,long long,mapping,composition,id> seg(N);
	rep(i,N)seg.set(i,{need[i],i});
	rep(_,T){
		auto res = seg.all_prod();
		ans[res.second]++;
		seg.apply(0,N,-res.first);
		seg.set(res.second,{need[res.second],res.second});
	}
	rep(i,N){
		if(i!=0)cout<<' ';
		cout<<ans[i];
	}
	cout<<endl;
	
	
	return 0;
}
0