結果

問題 No.774 tatyamと素数大富豪
ユーザー tailstails
提出日時 2018-12-22 00:45:26
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 6,140 KB
実行使用メモリ 112,980 KB
最終ジャッジ日時 2023-10-26 01:42:11
合計ジャッジ時間 10,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 11 ms
6,368 KB
testcase_02 AC 11 ms
6,188 KB
testcase_03 AC 32 ms
8,088 KB
testcase_04 AC 11 ms
6,388 KB
testcase_05 AC 11 ms
6,376 KB
testcase_06 WA -
testcase_07 AC 12 ms
6,376 KB
testcase_08 AC 11 ms
6,184 KB
testcase_09 AC 239 ms
10,740 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1,912 ms
95,652 KB
testcase_13 AC 1,115 ms
55,508 KB
testcase_14 AC 49 ms
8,960 KB
testcase_15 WA -
testcase_16 AC 53 ms
7,032 KB
testcase_17 AC 12 ms
6,376 KB
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "t" may clash with future reserved word at Main.pl line 2.
Unquoted string "t" may clash with future reserved word at Main.pl line 8.
Unquoted string "p" may clash with future reserved word at Main.pl line 21.
Name "main::h" used only once: possible typo at Main.pl line 6.
Main.pl syntax OK

ソースコード

diff #

$n=<>;@a=glob<>;
open(t,">/tmp/t");

sub f{
	my($x,$u)=@_;
	if(!$h{$x}++){
		if(!$u){
			print t $x,$/;
		}else{
			for$i(0..$n-1){
				if($u&1<<$i){
					my$y=$a[$i];
					f($x.$y,$u^1<<$i);
				}
			}
		}
	}
}
f('',(1<<$n)-1);

open(p,"sort -nr /tmp/t|factor|");
($r)=(grep(!/\d /,<p>),-1);
print $r+0;

0