結果
| 問題 | No.774 tatyamと素数大富豪 |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2018-12-22 00:45:26 |
| 言語 | Perl (5.44.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 306 bytes |
| 記録 | |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 6,272 KB |
| 実行使用メモリ | 112,768 KB |
| 最終ジャッジ日時 | 2026-09-04 00:16:38 |
| 合計ジャッジ時間 | 7,744 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 9 WA * 5 |
コンパイルメッセージ
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
ソースコード
$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;
tails