結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tailstails
提出日時 2016-10-14 23:57:44
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,041 ms / 4,000 ms
コード長 436 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 41,992 KB
最終ジャッジ日時 2023-08-14 11:20:25
合計ジャッジ時間 29,829 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,015 ms
41,992 KB
testcase_01 AC 985 ms
41,728 KB
testcase_02 AC 821 ms
37,596 KB
testcase_03 AC 1,022 ms
34,468 KB
testcase_04 AC 1,024 ms
33,984 KB
testcase_05 AC 862 ms
38,624 KB
testcase_06 AC 1,041 ms
39,472 KB
testcase_07 AC 813 ms
41,116 KB
testcase_08 AC 901 ms
35,092 KB
testcase_09 AC 831 ms
28,152 KB
testcase_10 AC 713 ms
27,292 KB
testcase_11 AC 699 ms
27,176 KB
testcase_12 AC 711 ms
27,024 KB
testcase_13 AC 672 ms
27,456 KB
testcase_14 AC 666 ms
27,664 KB
testcase_15 AC 643 ms
26,936 KB
testcase_16 AC 703 ms
26,820 KB
testcase_17 AC 703 ms
27,276 KB
testcase_18 AC 708 ms
27,316 KB
testcase_19 AC 640 ms
27,440 KB
testcase_20 AC 663 ms
27,104 KB
testcase_21 AC 655 ms
27,604 KB
testcase_22 AC 673 ms
27,428 KB
testcase_23 AC 664 ms
27,316 KB
testcase_24 AC 644 ms
27,472 KB
testcase_25 AC 677 ms
27,352 KB
testcase_26 AC 642 ms
26,832 KB
testcase_27 AC 671 ms
26,868 KB
testcase_28 AC 633 ms
27,388 KB
testcase_29 AC 671 ms
26,888 KB
testcase_30 AC 6 ms
5,196 KB
testcase_31 AC 6 ms
5,148 KB
testcase_32 AC 785 ms
27,000 KB
testcase_33 AC 715 ms
27,128 KB
testcase_34 AC 805 ms
29,656 KB
testcase_35 AC 6 ms
5,252 KB
testcase_36 AC 7 ms
5,288 KB
testcase_37 AC 6 ms
5,212 KB
testcase_38 AC 6 ms
5,152 KB
testcase_39 AC 13 ms
5,544 KB
testcase_40 AC 13 ms
5,556 KB
testcase_41 AC 69 ms
7,304 KB
testcase_42 AC 68 ms
7,588 KB
testcase_43 AC 69 ms
7,396 KB
testcase_44 AC 69 ms
7,400 KB
testcase_45 AC 16 ms
5,308 KB
testcase_46 AC 111 ms
7,364 KB
testcase_47 AC 85 ms
7,392 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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}}){
				$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;
		}
	}
}
0