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

     

  • 相关阅读:
    理解MySQL——索引与优化
    ArrayList vs LinkedList vs Vector
    Java集合框架的接口和类层次关系结构图
    Java集合的10个最常见问题
    Mysql 中的事件//定时任务
    Mysql中的函数
    Mysql中的触发器
    Mysql中的存储过程
    Oracle数据库表的一些宏处理
    Oracle查询和过滤重复数据
  • 原文地址:https://www.cnblogs.com/zhangbuang/p/11344501.html
Copyright © 2011-2022 走看看