結果
問題 |
No.106 素数が嫌い!2
|
ユーザー |
![]() |
提出日時 | 2020-09-03 07:22:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 788 ms |
コンパイル使用メモリ | 71,796 KB |
最終ジャッジ日時 | 2025-01-14 04:03:14 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | WA * 3 TLE * 10 |
ソースコード
#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; }