結果

問題 No.286 Modulo Discount Store
ユーザー %20%20
提出日時 2017-05-11 09:27:51
言語 Perl
(5.38.2)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 7,868 KB
最終ジャッジ日時 2023-10-13 10:58:25
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,556 KB
testcase_01 AC 3 ms
4,468 KB
testcase_02 AC 42 ms
5,252 KB
testcase_03 AC 2 ms
4,588 KB
testcase_04 AC 3 ms
4,544 KB
testcase_05 AC 3 ms
4,524 KB
testcase_06 AC 85 ms
6,232 KB
testcase_07 AC 3 ms
4,700 KB
testcase_08 AC 3 ms
4,504 KB
testcase_09 AC 3 ms
4,476 KB
testcase_10 AC 21 ms
5,004 KB
testcase_11 AC 3 ms
4,584 KB
testcase_12 AC 3 ms
4,556 KB
testcase_13 AC 41 ms
5,408 KB
testcase_14 AC 2 ms
4,580 KB
testcase_15 AC 2 ms
4,580 KB
testcase_16 AC 3 ms
4,548 KB
testcase_17 AC 179 ms
7,868 KB
testcase_18 AC 21 ms
5,044 KB
testcase_19 AC 2 ms
4,556 KB
testcase_20 AC 6 ms
4,620 KB
testcase_21 AC 3 ms
4,528 KB
testcase_22 AC 3 ms
4,496 KB
testcase_23 AC 42 ms
5,300 KB
testcase_24 AC 3 ms
4,536 KB
testcase_25 AC 10 ms
4,672 KB
testcase_26 AC 3 ms
4,576 KB
testcase_27 AC 11 ms
4,740 KB
testcase_28 AC 84 ms
6,144 KB
testcase_29 AC 3 ms
4,500 KB
testcase_30 AC 2 ms
4,592 KB
testcase_31 AC 4 ms
4,624 KB
testcase_32 AC 4 ms
4,576 KB
testcase_33 AC 2 ms
4,600 KB
testcase_34 AC 2 ms
4,564 KB
testcase_35 AC 4 ms
4,584 KB
testcase_36 AC 2 ms
4,624 KB
testcase_37 AC 11 ms
4,644 KB
testcase_38 AC 2 ms
4,592 KB
testcase_39 AC 85 ms
6,068 KB
testcase_40 AC 2 ms
4,524 KB
testcase_41 AC 3 ms
4,552 KB
testcase_42 AC 3 ms
4,600 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($N,@M)=<>;
@q=0;
while(@q){
	$q=shift@q;
	for(0..$#M){
		if(not$q&1<<$_){
			if(defined$p[$Q=$q|1<<$_]){
				$p[$Q]-=$-=$p[$Q]-($p[$q]+($-=$M[$_]-$m[$q]));
			}else{
				$p[$Q]=$p[$q]+($-=$M[$_]-$m[$q]);
				$m[$Q]=($m[$q]+$M[$_])%1000;
				push@q,$Q;
			}
		}
	}
}
print$p[(1<<$N)-1]
0