結果
問題 |
No.1383 Numbers of Product
|
ユーザー |
|
提出日時 | 2021-12-09 08:49:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 564 bytes |
コンパイル時間 | 1,811 ms |
コンパイル使用メモリ | 170,548 KB |
実行使用メモリ | 204,672 KB |
最終ジャッジ日時 | 2024-07-16 19:11:51 |
合計ジャッジ時間 | 5,516 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 TLE * 1 -- * 45 |
ソースコード
#include <bits/stdc++.h> using namespace std; long long int n, k, m; int main(){ cin >> n >> k >> m; long long int a = 1; multiset<long long int> S; long long int res = 0; while (a*(a + k) <= n){ long long int cur = a*(a + k); for (long long int i = 1; cur <= n; cur *= (a + k*i)){ S.insert(cur); ++i; if (S.count(cur) == m){ ++res; } if (S.count(cur) > m){ --res; } } ++a; } cout << res << endl; }