結果
| 問題 |
No.462 6日知らずのコンピュータ
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2016-12-13 00:54:21 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 73 ms |
| コンパイル使用メモリ | 5,888 KB |
| 実行使用メモリ | 6,016 KB |
| 最終ジャッジ日時 | 2024-11-29 23:41:30 |
| 合計ジャッジ時間 | 2,507 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 84 |
コンパイルメッセージ
Name "main::db" used only once: possible typo at Main.pl line 5. Name "main::k" used only once: possible typo at Main.pl line 1. Main.pl syntax OK
ソースコード
($n,$k)=glob<>;
$r=1;
#for(sort{$a<=>$b}<>=~/\d+/g){
for(sort map{sprintf"%030d",$_}<>=~/\d+/g){
die if $db++==0 && $b!=0;
$a="$_"|0;
if($b&~$a){
#die;
print 0;
exit;
}
for(1..c($a)- c($b)){
$r=($r*$_)%(1e9+7);
}
$b=$a;
}
{
for(1..$n- c($b)){
$r=($r*$_)%(1e9+7);
}
}
print $r;
sub c {
my $v=0;
my ($n)=@_;
while($n){
$v+=$n&1;
$n>>=1;
}
$v
}
tails