結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,542 ms
6,676 KB
testcase_01 AC 5 ms
6,676 KB
testcase_02 AC 5 ms
6,676 KB
testcase_03 AC 6 ms
6,676 KB
testcase_04 AC 1,553 ms
6,676 KB
testcase_05 AC 3,144 ms
6,676 KB
testcase_06 AC 3,119 ms
6,676 KB
testcase_07 AC 3,128 ms
6,676 KB
testcase_08 AC 195 ms
6,676 KB
testcase_09 AC 206 ms
6,676 KB
testcase_10 AC 3,120 ms
6,676 KB
testcase_11 AC 1,348 ms
6,676 KB
testcase_12 AC 3,052 ms
6,676 KB
testcase_13 AC 5 ms
6,676 KB
testcase_14 AC 5 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} {c=0; pre=0;for(i=2;i<=NF;i++){if(pre==$i)continue;c+=1;pre=$i};if(c>=K)sum+=1}END{print sum}'
0