zoukankan      html  css  js  c++  java
  • 【HDU2019多校】Easy Math Problem (插值+Min25+杜教筛)

    Problem Description

    One day, Touma Kazusa encountered a easy math problem. Given n and k, she need to calculate the following sum modulo 1e9+7.
    ∑ni=1∑nj=1gcd(i,j)klcm(i,j)[gcd(i,j)∈prime]%(1e9+7) ∑_{i=1}^n∑_{j=1}^ngcd(i,j)^klcm(i,j)[gcd(i,j)∈prime]\%(1e9+7)∑
    i=1
    n


    j=1
    n

    gcd(i,j)
    k
    lcm(i,j)[gcd(i,j)∈prime]%(1e9+7)

    However, as a poor student, Kazusa obviously did not, so Touma Kazusa went to ask Kitahara Haruki. But Kitahara Haruki is too busy, in order to prove that he is a skilled man, so he threw this problem to you. Can you answer this easy math problem quickly?

    Input

    There are multiple test cases.(T=5) The first line of the input contains an integer T, indicating the number of test cases. For each test case:

    There are only two positive integers n and k which are separated by spaces.

    1≤n≤1010 1≤n≤10^{10}1≤n≤10
    10

    1≤k≤100 1≤k≤1001≤k≤100

    Output

    An integer representing your answer.

    Sample Input

    1

    10 2
    Sample Output

    2829

    SOLUTION:

    https://blog.csdn.net/baiyifeifei/article/details/97798086

    代码:https://blog.csdn.net/Coldfresh/article/details/98668028

    其实官方题解写的也不错

    这题要是能写出来那数论算是毕业了吧qwq

     

  • 相关阅读:
    用C#编写获取远程IP,MAC的方法
    创建 TransactSQL 作业步骤
    S3C2440系统时钟
    C# 跟年月日判断星期几
    嵌入式系统启动例程
    使用HTML5和CSS3来创建幻灯片
    巧解Android时区加载过慢的问题
    HTML5之美
    C#如何取硬件标志
    S3C2440看门狗定时器(Watchdog)
  • 原文地址:https://www.cnblogs.com/zhangbuang/p/11344501.html
Copyright © 2011-2022 走看看