結果
問題 | No.106 素数が嫌い!2 |
ユーザー | tottoripaper |
提出日時 | 2015-03-04 22:53:45 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 431 bytes |
コンパイル時間 | 1,072 ms |
コンパイル使用メモリ | 25,616 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-06 13:10:54 |
合計ジャッジ時間 | 35,581 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2,014 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 2,016 ms
4,376 KB |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | AC | 125 ms
4,380 KB |
testcase_09 | AC | 135 ms
4,376 KB |
testcase_10 | TLE | - |
testcase_11 | AC | 1,691 ms
4,380 KB |
testcase_12 | TLE | - |
testcase_13 | AC | 1 ms
4,380 KB |
testcase_14 | AC | 1 ms
4,376 KB |
testcase_15 | AC | 1 ms
4,380 KB |
ソースコード
#include <cstdio> typedef long long ll; int main(){ ll N; int K; scanf("%lld %d", &N, &K); int res = 0; for(ll i=2;i<=N;i++){ ll x = i; int count = 0; for(ll j=2;j*j<x;j++){ if(x % j == 0){count++;} while(x % j == 0){x /= j;} } if(x > 1){count++;} if(count >= K){ res++; } } printf("%d\n", res); }