結果

問題 No.106 素数が嫌い!2
ユーザー neko_the_shadowneko_the_shadow
提出日時 2024-02-07 11:05:59
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 4,685 ms / 5,000 ms
コード長 163 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-07 11:06:33
合計ジャッジ時間 33,447 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,246 ms
6,676 KB
testcase_01 AC 5 ms
6,676 KB
testcase_02 AC 6 ms
6,676 KB
testcase_03 AC 6 ms
6,676 KB
testcase_04 AC 2,230 ms
6,676 KB
testcase_05 AC 4,685 ms
6,676 KB
testcase_06 AC 4,650 ms
6,676 KB
testcase_07 AC 4,622 ms
6,676 KB
testcase_08 AC 272 ms
6,676 KB
testcase_09 AC 286 ms
6,676 KB
testcase_10 AC 4,621 ms
6,676 KB
testcase_11 AC 1,935 ms
6,676 KB
testcase_12 AC 4,509 ms
6,676 KB
testcase_13 AC 6 ms
6,676 KB
testcase_14 AC 6 ms
6,676 KB
testcase_15 AC 7 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/bin/bash

read N K
seq 2 $N | factor | awk -v K=$K '
    BEGIN{sum=0} 
    {split("",a); for(i=2;i<=NF;i++)a[$i]=1; if(length(a)>=K)sum+=1}
    END{print sum}
'
0