結果
問題 |
No.1514 Squared Matching
|
ユーザー |
![]() |
提出日時 | 2021-05-21 22:43:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 241 ms / 4,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 619 ms |
コンパイル使用メモリ | 67,680 KB |
最終ジャッジ日時 | 2025-01-21 15:54:14 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <bitset> #include <iostream> int main() { int n; std::cin >> n; std::bitset<50000001> used; long ans = 0; for (int i = 1; i <= n; ++i) { if (used[i]) continue; long size = 0; for (long j = 1; j * j * i <= n; ++j) { used[j * j * i] = 1; ++size; } ans += size * size; } std::cout << ans << "\n"; }