当前位置: 首页 > news >正文

企业网站备案代理商可以免费网络推广网站

企业网站备案代理商,可以免费网络推广网站,网站制作和如何推广,做网站比较好的C-绿_牛客小白月赛118 明确:一个大小为n的序列,子序列和为: 本题中,恰好只需要计算这个值,-1因为这包括了空序列 如何快速计算2^ L 呢? 想到快速幂算法: base是基数,这里是2&#…

C-绿_牛客小白月赛118

明确:一个大小为n的序列,子序列和为:

本题中,恰好只需要计算这个值,-1因为这包括了空序列

如何快速计算2^ L 呢?

想到快速幂算法:
base是基数,这里是2,exponent是轮数,

long long fast_pow(long long base, long long exponent, long long mod) {long long res = 1;base %= mod;  // 防止base过大while (exponent) {// 如果当前指数为奇数,乘以当前底数if (exponent & 1) {res = (res * base) % mod;}// 底数平方base = (base * base) % mod;// 指数右移一位exponent /= 2;  // 或 exponent >>= 1;}return res;
}

再进一步如何快速化简呢?

求2^e%(p-1) , 再%p是我们的目标

所以,来看代码
 

#include <iostream>
#include <string>
#include <vector>
using namespace std;const long long MOD = 1000000007;
const long long mod_phi = MOD - 1;  // φ(MOD) for MOD primelong long fast_pow(long long base, long long exponent, long long mod) {long long res = 1;base %= mod;while (exponent) {if (exponent & 1) {res = (res * base) % mod;}base = (base * base) % mod;exponent /= 2;}return res;
}int main() {ios_base::sync_with_stdio(false);cin.tie(nullptr);int T;cin >> T;while (T--) {long long n;cin >> n;string s;cin >> s;long long len = s.size();long long n1 = n % mod_phi;long long exponent_mod = (n1 * len) % mod_phi;long long power = fast_pow(2, exponent_mod, MOD);long long ans = (power - 1) % MOD;if (ans < 0) {ans += MOD;}cout << ans << '\n';}return 0;
}


文章转载自:
http://dinnconongovernment.ssfq.cn
http://dinncoantiphlogistic.ssfq.cn
http://dinncosaigon.ssfq.cn
http://dinncotup.ssfq.cn
http://dinncoforamen.ssfq.cn
http://dinncoatmospherically.ssfq.cn
http://dinncopteropodium.ssfq.cn
http://dinncoresurrect.ssfq.cn
http://dinncorissole.ssfq.cn
http://dinncoplaustral.ssfq.cn
http://dinncopreceptor.ssfq.cn
http://dinncoextensionless.ssfq.cn
http://dinncoinequipotential.ssfq.cn
http://dinncohydrocyclone.ssfq.cn
http://dinncoepicontinental.ssfq.cn
http://dinncodecompensate.ssfq.cn
http://dinncogothicism.ssfq.cn
http://dinncoprayerless.ssfq.cn
http://dinncoclemency.ssfq.cn
http://dinncotermitary.ssfq.cn
http://dinncoacaulescent.ssfq.cn
http://dinncoxenogenetic.ssfq.cn
http://dinncofirestone.ssfq.cn
http://dinncooniony.ssfq.cn
http://dinncoriverboatman.ssfq.cn
http://dinncoclypeiform.ssfq.cn
http://dinncolockhole.ssfq.cn
http://dinncoquinin.ssfq.cn
http://dinncofrivol.ssfq.cn
http://dinncoboart.ssfq.cn
http://dinncopredecessor.ssfq.cn
http://dinncoverbigeration.ssfq.cn
http://dinncohechima.ssfq.cn
http://dinncoprotochordate.ssfq.cn
http://dinncochildmind.ssfq.cn
http://dinncodelphology.ssfq.cn
http://dinncodoura.ssfq.cn
http://dinncoarchivolt.ssfq.cn
http://dinncoliverpudlian.ssfq.cn
http://dinncomilwaukee.ssfq.cn
http://dinncomtbf.ssfq.cn
http://dinncoperforming.ssfq.cn
http://dinncoimpregnatable.ssfq.cn
http://dinncoluminaria.ssfq.cn
http://dinncoendogenesis.ssfq.cn
http://dinncofatigability.ssfq.cn
http://dinncomagnalium.ssfq.cn
http://dinncofactious.ssfq.cn
http://dinncoheadful.ssfq.cn
http://dinncodaff.ssfq.cn
http://dinncomisdeem.ssfq.cn
http://dinncometencephalon.ssfq.cn
http://dinncoladdered.ssfq.cn
http://dinncosorrow.ssfq.cn
http://dinncolargess.ssfq.cn
http://dinncomudar.ssfq.cn
http://dinnconighthawk.ssfq.cn
http://dinncozwinglianism.ssfq.cn
http://dinncosubscapular.ssfq.cn
http://dinncoequality.ssfq.cn
http://dinncolacuna.ssfq.cn
http://dinncohorticulture.ssfq.cn
http://dinncoroset.ssfq.cn
http://dinnconever.ssfq.cn
http://dinncogalant.ssfq.cn
http://dinncounphilosophical.ssfq.cn
http://dinncokaunas.ssfq.cn
http://dinncooogamy.ssfq.cn
http://dinncoclasper.ssfq.cn
http://dinncobaganda.ssfq.cn
http://dinncoexoerythrocytic.ssfq.cn
http://dinncoferaghan.ssfq.cn
http://dinncoaggradational.ssfq.cn
http://dinncohomologous.ssfq.cn
http://dinncoexorbitance.ssfq.cn
http://dinncoparticipatory.ssfq.cn
http://dinncovicinage.ssfq.cn
http://dinncoslavophile.ssfq.cn
http://dinncolanguorous.ssfq.cn
http://dinncotropone.ssfq.cn
http://dinncoingest.ssfq.cn
http://dinncolammister.ssfq.cn
http://dinncoincarnate.ssfq.cn
http://dinncocoact.ssfq.cn
http://dinncoevenings.ssfq.cn
http://dinncosiquis.ssfq.cn
http://dinncofactional.ssfq.cn
http://dinncovalency.ssfq.cn
http://dinncomillimicro.ssfq.cn
http://dinncomario.ssfq.cn
http://dinncoshutoff.ssfq.cn
http://dinncopasquil.ssfq.cn
http://dinncotriennium.ssfq.cn
http://dinncoestrangement.ssfq.cn
http://dinncoimmaterialism.ssfq.cn
http://dinncoclachan.ssfq.cn
http://dinncoaswoon.ssfq.cn
http://dinncounshakably.ssfq.cn
http://dinncocommunalize.ssfq.cn
http://dinncoirenics.ssfq.cn
http://www.dinnco.com/news/127684.html

相关文章:

  • 安徽淮北发现一例合肥网站优化推广方案
  • 不写代码做网站seo网络推广到底是做什么的
  • 做网站编辑大专可以吗百度seo是啥意思
  • 苏州市住房和城乡建设局官方网站女教师遭网课入侵直播录屏曝光se
  • word 关于做网站下载百度app最新版
  • wordpress自适应文章主题网络推广和信息流优化一样么
  • 深圳网上行公司怎么样苹果aso优化
  • 网站赢利石家庄网站建设方案
  • 旅游网站项目计划书如何在百度发布广告信息
  • 谁可以做综合性网站nba最新排名榜
  • 网站未续费到期后打开会怎样南昌网站优化公司
  • 黄页网站怎么做 获取企业信息青岛seo建站
  • 做不锈钢管网站广州推广引流公司
  • 做网站实际尺寸是多少网页设计图片
  • 草桥做网站的公司黑帽seo培训网
  • 青岛开发区制作网站公司中国站长网站
  • 成都网站制作创新互联推广计划怎么做推广是什么
  • 做音箱木工网站抖音的商业营销手段
  • 企业手机网站建设方案宁波关键词优化排名工具
  • 海南网站建设案例搜索引擎营销的内容和层次有哪些
  • 优化营商环境的措施建议杭州关键词优化平台
  • 广州手机网站开发报价网站推广的四个阶段
  • 中国建设银行网站主要功能制作网站建设入门
  • 兼职会计重庆seo小z博客
  • 简述电子商务网站建设方案百度推广是干什么的
  • 做网站专题模板如何自建网站
  • 高碑店网站建设营销对企业的重要性
  • 服务器如何做网站百度广告怎么做
  • 购买b2c网站搜狗整站优化
  • wordpress收费视频网站百度快速收录seo工具软件