結果
問題 | No.106 素数が嫌い!2 |
ユーザー | SSRS |
提出日時 | 2020-09-03 07:22:47 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 665 ms |
コンパイル使用メモリ | 72,476 KB |
実行使用メモリ | 11,396 KB |
最終ジャッジ日時 | 2023-08-14 17:47:23 |
合計ジャッジ時間 | 13,447 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int N, K; cin >> N >> K; vector<int> f(N + 1, 0); f[1] = 0; int ans = 0; for (int i = 2; i <= N; i++){ for (int j = 2; j <= i; j++){ if (i % j == 0){ int x = i; while (x % j == 0){ x /= j; } f[i] = f[x] + 1; if (f[i] >= K){ ans++; } } } } cout << ans << endl; }