
快速幂
bao___zi
ACM 弱鸡一枚
What this era lacks is not the person who is perfect but the person who is with virtue, justice, courage and compassion.
展开
-
Wannafly 挑战赛13 B- Jxc军训
题目描述 在文某路学车中学高一新生军训中,Jxc正站在太阳下站着军姿,对于这样的酷热的阳光,Jxc 表示非常不爽。 Jxc将天空看做一个n*n的矩阵,此时天上有m朵云,这些云会随机分布在m个不同的位置,同时太阳会随机出现在一个位置,Jxc想知道他被太阳晒到的概率是多少,由于他仍在站军姿,所以这个有趣的问题就交给了你。考虑到精度问题,Jxc只需要知道这个概率在对998244353取...原创 2018-04-09 13:05:06 · 200 阅读 · 0 评论 -
2018年东北农业大学春季校赛 K wyh的数列
链接:点击打开链接题目描述 wyh学长特别喜欢斐波那契数列,F(0)=0,F(1)=1,F(n)=F(n-1)+F(n-2)(n>=2) 一天他突发奇想,想求F(a^b)%c 输入描述:输入第一行一个整数T(1<=T<=100),代表测试组数接下来T行,每行三个数 a,b,c (a,b<=2^64) (1<c<1000)输出描述:输出第a^b项斐波那契...原创 2018-04-05 21:19:29 · 275 阅读 · 0 评论 -
Codeforces 964C Alternating Sum
You are given two integers a and b. Moreover, you are given a sequence s0,s1,…,sn. All values in s are integers 1 or −1. It's known that sequence is k-periodic and k divides n+1. In other words, for e...原创 2018-04-18 16:23:24 · 1062 阅读 · 0 评论 -
牛客小白月赛6 J 洋灰三角
题目描述 洋灰是一种建筑材料,常用来筑桥搭建高层建筑,又称,水泥、混凝土。 WHZ有很多铸造成三角形的洋灰块,他想把这些洋灰三角按照一定的规律放到摆成一排的n个格子里,其中第i个格子放入的洋灰三角数量是前一个格子的k倍再多p个,特殊地,第一个格子里放1个。 WHZ想知道把这n个格子铺满需要多少洋灰三角。输入描述:第一行有3个正整数n,k,p。输出描述:...原创 2018-08-19 11:05:57 · 369 阅读 · 0 评论 -
HDU 5187 zhx's contest (高精度快速幂)
Problem DescriptionAs one of the most powerful brushes, zhx is required to give his juniors n problems.zhx thinks the ith problem's difficulty is i. He wants to arrange these problems in a beautifu...原创 2018-08-28 09:11:58 · 274 阅读 · 0 评论