結果

問題 No.1260 たくさんの多項式
ユーザー ytftytft
提出日時 2021-05-15 16:58:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 575 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 8,208 ms
コンパイル使用メモリ 402,488 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-14 07:27:23
合計ジャッジ時間 25,685 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
6,816 KB
testcase_01 AC 7 ms
6,816 KB
testcase_02 AC 7 ms
6,944 KB
testcase_03 AC 4 ms
6,940 KB
testcase_04 AC 4 ms
6,940 KB
testcase_05 AC 8 ms
6,944 KB
testcase_06 AC 4 ms
6,944 KB
testcase_07 AC 7 ms
6,944 KB
testcase_08 AC 7 ms
6,940 KB
testcase_09 AC 6 ms
6,944 KB
testcase_10 AC 7 ms
6,948 KB
testcase_11 AC 6 ms
6,940 KB
testcase_12 AC 6 ms
6,948 KB
testcase_13 AC 8 ms
6,944 KB
testcase_14 AC 8 ms
6,944 KB
testcase_15 AC 7 ms
6,940 KB
testcase_16 AC 4 ms
6,940 KB
testcase_17 AC 7 ms
6,940 KB
testcase_18 AC 7 ms
6,940 KB
testcase_19 AC 7 ms
6,944 KB
testcase_20 AC 566 ms
6,944 KB
testcase_21 AC 162 ms
6,944 KB
testcase_22 AC 496 ms
6,948 KB
testcase_23 AC 405 ms
6,944 KB
testcase_24 AC 418 ms
6,944 KB
testcase_25 AC 329 ms
6,944 KB
testcase_26 AC 396 ms
6,944 KB
testcase_27 AC 315 ms
6,940 KB
testcase_28 AC 550 ms
6,940 KB
testcase_29 AC 413 ms
6,940 KB
testcase_30 AC 261 ms
6,944 KB
testcase_31 AC 414 ms
6,940 KB
testcase_32 AC 411 ms
6,940 KB
testcase_33 AC 337 ms
6,944 KB
testcase_34 AC 536 ms
6,940 KB
testcase_35 AC 242 ms
6,940 KB
testcase_36 AC 219 ms
6,940 KB
testcase_37 AC 418 ms
6,940 KB
testcase_38 AC 453 ms
6,944 KB
testcase_39 AC 539 ms
6,944 KB
testcase_40 AC 412 ms
6,944 KB
testcase_41 AC 513 ms
6,940 KB
testcase_42 AC 378 ms
6,940 KB
testcase_43 AC 530 ms
6,944 KB
testcase_44 AC 341 ms
6,940 KB
testcase_45 AC 329 ms
6,940 KB
testcase_46 AC 301 ms
6,944 KB
testcase_47 AC 369 ms
6,944 KB
testcase_48 AC 77 ms
6,944 KB
testcase_49 AC 281 ms
6,944 KB
testcase_50 AC 149 ms
6,940 KB
testcase_51 AC 535 ms
6,944 KB
testcase_52 AC 185 ms
6,944 KB
testcase_53 AC 247 ms
6,944 KB
testcase_54 AC 550 ms
6,940 KB
testcase_55 AC 569 ms
6,940 KB
testcase_56 AC 264 ms
6,940 KB
testcase_57 AC 387 ms
6,944 KB
testcase_58 AC 241 ms
6,940 KB
testcase_59 AC 408 ms
6,944 KB
testcase_60 AC 575 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mp;


int main(){
    mp N;
    mp ans=0;
    mp MOD=1000000007;
    cin>>N;
    mp i=2;
    while(i*i<=N){
        mp temp=N;
        while(temp>0){
            ans=(ans+temp%i)%MOD;
            temp/=i;
        }
        ++i;
    }
    for(int j=1;j<=N;j++){
        mp M=N/j;
        mp m=N/(j+1)+1;
        if(M<i)break;
        if(m<i)m=i;
        ans=(ans+N*(M-m+1)-j*(M+m-2)*(M-m+1)/2)%MOD;
    }
    cout<<ans<<endl;
}
0