結果
| 問題 | No.1514 Squared Matching |
| コンテスト | |
| ユーザー |
kai4096_don
|
| 提出日時 | 2021-09-10 22:16:59 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 486 ms / 4,000 ms |
| + 341µs | |
| コード長 | 589 bytes |
| 記録 | |
| コンパイル時間 | 2,555 ms |
| コンパイル使用メモリ | 246,236 KB |
| 実行使用メモリ | 394,112 KB |
| 最終ジャッジ日時 | 2026-07-25 20:29:26 |
| 合計ジャッジ時間 | 12,381 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
//const long nPrime = 1000000007;
//const long nPrime = 998244353;
typedef long long ll;
int main() {
long n;
cin >> n;
vector<long> viCheck(n+1,0);
long nAns = 0;
for(long i = 1; i <= n; i++){
if(viCheck[i] == 1){
continue;
}
long nCount = 1;
for(; i*nCount*nCount <= n; nCount++){
viCheck[i*nCount*nCount] = 1;
}
nCount--;
nAns += nCount*nCount;
}
cout << nAns << endl;
return 0;
}
kai4096_don