国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

寧波網(wǎng)站建設(shè)的企業(yè)太原今日頭條

寧波網(wǎng)站建設(shè)的企業(yè),太原今日頭條,房地產(chǎn)網(wǎng)信息,網(wǎng)站頁面是自己做還是使用模板假設(shè)現(xiàn)在有兩個自然數(shù) A 和 B,S 是 AB 的所有約數(shù)之和。 請你求出 Smod9901 的值是多少。 輸入格式 在一行中輸入用空格隔開的兩個整數(shù) A 和 B 。 輸出格式 輸出一個整數(shù),代表 Smod9901 的值。 數(shù)據(jù)范圍 0≤A,B≤5107 輸入樣例: …

假設(shè)現(xiàn)在有兩個自然數(shù) A 和 B,S 是 AB

的所有約數(shù)之和。

請你求出 Smod9901

的值是多少。

輸入格式

在一行中輸入用空格隔開的兩個整數(shù) A

和 B

。

輸出格式

輸出一個整數(shù),代表 Smod9901

的值。

數(shù)據(jù)范圍

0≤A,B≤5×107

輸入樣例:
2 3
輸出樣例:
15

注意: A

和 B 不會同時為 0。

思路

??????? 因為要求p^0+p^1+...+p^k-1,所以這是一個等比數(shù)列,完全可以用快速冪求逆元然后用等比數(shù)列求和公式得到答案

#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<stack>
#include<string>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<bitset>
#include<cstring>
#include <unordered_set>
//#include<priority_queue>
#include<queue>
#include<deque>
#include<set>
#include<stdlib.h>
#define dbug cout<<"*****hear*****"<<endl;
#define rep(a,b,c) for(ll a=b;a<=c;a++)
#define per(a,b,c) for(ll a=b;a>=c;a--)
#define no cout<<"NO"<<endl;
#define yes cout<<"YES"<<endl;
#define endl "\n"//交互題一定要關(guān)!!!!!!!!!
#define lowbit(x) (x&-x)
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//priority_queue<int,vector<int>,greater<int> >q;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> PII;
typedef pair<long double,long double> PDD;ll  INF = 0x3f3f3f3f;
//const ll LINF=LLONG_MAX;
// int get_len(int x1,int y1,int x2,int y2)
// {
//   return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
// }
const ll N = 2e5+ 10;const ll mod1 =998244353;const ll mod2 =1e9+7;
// const ll hash_num = 3e9+9;
ll n,m,ca;
ll arr[N],brr[N],crr[N],drr[N];
//ll h[N],ne[N],e[N],w[N],book[N],idx;
//ll idx;// void add(ll a, ll b , ll c)
// {
//   e[idx] = b, w[idx] = c,ne[idx] = h[a], h[a] =idx ++ ; 
// }
ll mod=9901;
unordered_map<ll,ll>prime;ll fast_power(ll a,ll b)//快速冪
{ll res=1;while(b){if(b&1)res=res*a%mod;b >>= 1;a=a*a%mod;}return res;
}void get(ll x)//獲得質(zhì)因數(shù)
{for(ll i=2;i<=x/i;i++){while(x%i==0){x/=i;prime[i]++;}}if(x>1)prime[x]++;
}ll sum(ll p,ll k)//sum函數(shù)
{if(k==1)return 1;if(k%2==0){return (1+fast_power(p,k/2))*sum(p,k/2)%mod;}else{return (fast_power(p, k - 1) + sum(p, k - 1)) % mod;}
}void solve()
{cin >> n >> m;get(n);ll ans=1;for(auto it : prime){ll a = it.first, b = it.second * m;if((a-1)%mod==0)//如果a-1是mod的倍數(shù)的話那么其實就是k+1個1相加{ans=ans*(b+1)%mod;}else{ans=ans*(fast_power(a,b+1)-1)%mod*(fast_power(a-1,mod-2))%mod;//這里是將求和公式上下都提取一個負號變成了(a^b+1)-1和a-1}}if(!n)ans=0;cout << (ans%mod+mod)%mod;
}int main()
{IOS;ll _;_=1;//scanf("%lld",&_);// cin>>_;ca=1;while(_--){solve(); ca++;}    return 0;
}

http://aloenet.com.cn/news/46050.html

相關(guān)文章:

  • 百度推廣做網(wǎng)站什么價位網(wǎng)站開發(fā)流程的8個步驟
  • asp網(wǎng)站vps搬家2024年重大新聞簡短
  • 武漢做網(wǎng)站找哪家好世界球隊最新排名榜
  • 杭州未來科技網(wǎng)站建設(shè)高端建站
  • 企業(yè)信用網(wǎng)查詢網(wǎng)站優(yōu)化推廣培訓(xùn)
  • 建甌網(wǎng)站制作百度網(wǎng)站怎么提升排名
  • 自己做產(chǎn)品品牌網(wǎng)站谷歌官網(wǎng)網(wǎng)址
  • 杭州富陽區(qū)網(wǎng)站建設(shè)公司seo排名軟件有用嗎
  • 鄭州響應(yīng)式網(wǎng)站建設(shè)如何找外包的銷售團隊
  • 網(wǎng)絡(luò)工作室頭像seo積分優(yōu)化
  • 用flash做的網(wǎng)站展示品牌策劃方案模板
  • 網(wǎng)站二級域名 權(quán)重 盧松松學(xué)seo網(wǎng)絡(luò)推廣
  • 國內(nèi)醫(yī)療美容網(wǎng)站建設(shè)培訓(xùn)機構(gòu)不退費最有效方式
  • 電子書推送網(wǎng)站怎么做會計培訓(xùn)班
  • 政府采購網(wǎng)站的建設(shè)情況bing收錄提交
  • 個人博客網(wǎng)站開發(fā)的原因鄭州seo排名優(yōu)化公司
  • flash 做ppt的模板下載網(wǎng)站北京seo招聘信息
  • wordpress 命令插件東莞seo靠譜
  • wap網(wǎng)站開發(fā)協(xié)議個人推廣網(wǎng)站
  • 做網(wǎng)站最主要是什么最新的新聞 最新消息
  • java網(wǎng)站開發(fā)步驟搜索引擎費用
  • html做電子書網(wǎng)站抖音關(guān)鍵詞搜索排名
  • 網(wǎng)站速度優(yōu)化工具關(guān)鍵詞排名
  • 怎么做淘寶鏈接網(wǎng)站開戶推廣競價開戶
  • 甘肅省建設(shè)部網(wǎng)站微信朋友圈軟文大全
  • 深圳做棋牌網(wǎng)站建設(shè)軟文推廣的優(yōu)點
  • 網(wǎng)站的做用seo引擎優(yōu)化專員
  • 中央廣播電視總臺央視頻在線直播百度seo教程視頻
  • 哈西建站優(yōu)化購物網(wǎng)站大全
  • 博彩導(dǎo)航網(wǎng)站可以做嗎創(chuàng)建網(wǎng)站需要多少資金