結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tails
提出日時 2016-10-14 23:44:56
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 40,064 KB
最終ジャッジ日時 2024-11-22 07:03:15
合計ジャッジ時間 27,315 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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*2e5+$i;
	++$i;
}
for(reverse@a){
	for$u(keys%$_){
		@{$_->{$u}}=sort{$b-$a}@{$_->{$u}};
	}
	$m=0;
	while(1){
		$w=0;
		for$u(keys%$_){
			if(@{$_->{$u}}){
				if($v{$u}<$m){
					push@b,pop@{$_->{$u}};
					++$v{$u};
				}else{
					$w=1;
				}
			}
		}
		++$m,redo if !@b && $w;
		last if !@b;
		@b=sort{$b-$a}@b;
		while(@b){
			print pop(@b)%2e5,$/;
			exit if !--$k;
		}
	}
}
0