結果
| 問題 |
No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2016-10-14 23:57:44 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 1,007 ms / 4,000 ms |
| コード長 | 436 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 6,816 KB |
| 実行使用メモリ | 40,064 KB |
| 最終ジャッジ日時 | 2024-11-22 07:47:48 |
| 合計ジャッジ時間 | 27,552 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 48 |
コンパイルメッセージ
Name "main::n" used only once: possible typo at Main.pl line 1. Main.pl syntax OK
ソースコード
($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}}){
$w=1;
if($v{$u}<$m){
push@b,pop@{$_->{$u}};
++$v{$u};
}
}
}
last if !$w;
++$m,redo if !@b;
@b=sort{$b<=>$a}@b;
while(@b){
print pop(@b)%2e5,$/;
exit if !--$k;
}
}
}
tails