結果
| 問題 |
No.106 素数が嫌い!2
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-09-03 07:27:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 71,396 KB |
| 最終ジャッジ日時 | 2025-01-14 04:04:28 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 3 WA * 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 = i; j <= N; j += i){
if (f[j] == -1){
int x = j;
while (x % i == 0){
x /= i;
}
f[j] = f[x] + 1;
if (f[j] >= K){
ans++;
}
}
}
}
cout << ans << endl;
}
SSRS