zoukankan      html  css  js  c++  java
  • BZOJ 4173


    我能说我这道题是打表找规律么


    并不会证明QAQ.


    答案就是phi(n)*phi(n)*n*m


    证明去膜拜PoPoQQQ

    #pragma GCC optimize ("O3")
    #include <iostream>
    #include <cstring>
    #include <algorithm>
    #include <stdio.h>
    typedef long long ll;
    #define P 998244353ll
    ll n,m;
     
     
    template<typename _t>
    inline _t read(){
        _t x=0,f=1;
        char ch=getchar();
        for(;ch>'9'||ch<'0';ch=getchar())if(ch=='-')f=-f;
        for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+(ch^48);
        return x*f;
    }
     
    inline ll get_phi(ll x){
        ll ans = 1;
        for(ll i = 2;i*i<=x;i++)
            if(x%i==0){
                ans = ans * (i-1) % P;
                x/=i;
                while(x%i==0){
                    ans = ans * i % P;
                    x/=i;
                }
            }
        if(x!=1)ans = ans * (x-1) % P;
        return ans;
    }
     
    int main(){
        n=read<ll>();m=read<ll>();
        ll Ans = (n % P) * (m % P) % P * (get_phi(n) % P) % P * (get_phi(m) % P) % P;
        printf("%lld
    ",Ans);
    }



  • 相关阅读:
    奇异值分解SVD
    Google Draco点云压缩
    C++计时函数
    NDT正态分布变换配准
    点云配准 Registration
    图像的距
    镜头基础
    道格拉斯-普克算法
    霍夫变换
    opencv基础
  • 原文地址:https://www.cnblogs.com/Cooook/p/7738483.html
Copyright © 2011-2022 走看看