結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tails
提出日時 2016-10-14 23:11:44
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 38,784 KB
最終ジャッジ日時 2024-11-22 10:03:21
合計ジャッジ時間 28,745 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 46
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::n" used only once: possible typo at Main.pl line 1.
Main.pl syntax OK

ソースコード

diff #

($n,$k)=glob<>;
for(<>){
	($s,$p,$u)=glob<>;
	push@{$a[$s]{$u}//=[]},$p*1e5+$i;
	++$i;
}
for(reverse@a){
	for$u(keys%$_){
		@{$_->{$u}}=sort{$a-$b}@{$_->{$u}};
	}
	while(1){
		for$u(keys%$_){
			push@b,shift@{$_->{$u}} if @{$_->{$u}};
		}
		last if !@b;
		@b=sort{$a-$b}@b;
		while(@b){
			print pop(@b)%1e5,$/;
			exit if !--$k;
		}
	}
}
0