結果

問題 No.1514 Squared Matching
ユーザー Y68170842Y68170842
提出日時 2021-05-21 23:58:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,846 ms / 4,000 ms
コード長 1,282 bytes
コンパイル時間 1,494 ms
コンパイル使用メモリ 166,368 KB
実行使用メモリ 198,656 KB
最終ジャッジ日時 2024-04-18 17:03:54
合計ジャッジ時間 32,528 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1,825 ms
198,564 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 27 ms
6,940 KB
testcase_07 AC 330 ms
40,564 KB
testcase_08 AC 1,710 ms
191,420 KB
testcase_09 AC 1,499 ms
167,940 KB
testcase_10 AC 1,651 ms
181,588 KB
testcase_11 AC 1,692 ms
189,084 KB
testcase_12 AC 1,754 ms
194,096 KB
testcase_13 AC 1,805 ms
196,680 KB
testcase_14 AC 1,793 ms
197,836 KB
testcase_15 AC 1,817 ms
198,124 KB
testcase_16 AC 1,815 ms
198,436 KB
testcase_17 AC 1,812 ms
198,488 KB
testcase_18 AC 1,834 ms
198,488 KB
testcase_19 AC 1,846 ms
198,656 KB
testcase_20 AC 1,789 ms
198,576 KB
testcase_21 AC 1,816 ms
198,552 KB
testcase_22 AC 330 ms
42,316 KB
testcase_23 AC 691 ms
81,396 KB
testcase_24 AC 1,040 ms
120,364 KB
testcase_25 AC 1,410 ms
159,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #








#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,n) for(int i=int(n-1);i>=int(0);--i)
#define fore(i,a) for(auto &i:a)
#define all(x) x.begin(),x.end() 
#define sz(x) ((int)(x).size())
#define bp(x) (__builtin_popcount((long long)(x)))
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define V vector
#define P pair<int,int>
#define TP tuple<int,int,int>
#define F first
#define S second
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using ll = long long;
using ld = long double;
using namespace std;
const int INF = 1001001001;
const ll INFL = 1001001001001001001;
const int MAX = 200005;



int main() {
    ll n;cin>>n;
    V<int> a(n+1);
    rep(i,n+1)a[i]=i;
    for(ll i=2;i*i<=n;i++){
        for(ll j=i*i;j<=n;j+=i*i){
            while(a[j]%(i*i)==0)a[j]/=i*i;
        }
    }

    ll ans=0;
    rep(i,1,n+1){
        ans+=sqrt(n/a[i]);
    }

    cout<<ans<<endl;
    return 0;
}


0