上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: Problem 阿克曼(Arkmann)函数 𝐴(𝑚,𝑛) 中,m与n的定义域是非负整数且本题中m include include include include include define io_opt ios::sync_with_stdio(false);cin.tie(0);cout 阅读全文
posted @ 2019-09-08 21:51 CCWUCMCTS 阅读(409) 评论(0) 推荐(0) 编辑
摘要: Problem 小b有一个01序列A,她想知道A有多少个非空连续子序列和为S。 你能帮帮她吗? Solution 暴力,可以搞一下剪枝。 另外也可以枚举位置,建一个mp[num],记录枚举到i位置时,前面的每个前缀和num出现过几次,每次把当前前缀和减去m在之前出现的数量加入答案即可。 Code i 阅读全文
posted @ 2019-09-08 21:49 CCWUCMCTS 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Problem 小b有n个关闭的灯泡,编号为1...n。 小b会进行n轮操作,第i轮她会将编号为i的倍数的灯泡的开关状态取反,即开变成关,关变成开。 求n轮操作后,有多少灯泡是亮着的。 Solution 对一个数的因数找规律,发现只有平方数才会出现奇数的因数,因此答案为(int)srqt(n) 阅读全文
posted @ 2019-09-07 11:45 CCWUCMCTS 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 定义 n的欧拉函数表示小于n的数中和n互质的数。 求法 定义n为正整数,ti为n唯一分解的质数基。 利用n的欧拉函数为n*所有的(ti-1)/ti来求。 第一种方法为sqrt(n)的时间单个求。 第二种方法利用质数筛,如果循环到一个数,其数组没被变过,说明这个数是质数,可以往后修改其他数。 模版 # 阅读全文
posted @ 2019-09-06 17:51 CCWUCMCTS 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Problem 有一堆石子共有N个。A B两个人轮流拿,A先拿。每次拿的数量最少1个,最多不超过对手上一次拿的数量的2倍(A第1次拿时要求不能全拿走)。拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N,问最后谁能赢得比赛。 例如N = 3。A只能拿1颗或2颗,所以B 阅读全文
posted @ 2019-09-02 21:34 CCWUCMCTS 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Code include include include define ll long long define inf 0x7fffffffffffffff define mem(a, x) memset(a,x,sizeof(a)) define io_opt ios::sync_with_std 阅读全文
posted @ 2019-09-02 21:29 CCWUCMCTS 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Problem 有一堆石子共有N个。A B两个人轮流拿,A先拿。每次拿的数量只能是2的正整数次幂,比如(1,2,4,8,16....),拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N,问最后谁能赢得比赛。 例如N = 3。A只能拿1颗或2颗,所以B可以拿到最后1颗 阅读全文
posted @ 2019-09-02 20:38 CCWUCMCTS 阅读(147) 评论(0) 推荐(0) 编辑
摘要: ICPC2019南京网络赛 B.super_log Problem 求aaa...总共b个a,结果%m Solution 欧拉降幂 Code #include<iostream> #include<cstring> #include<algorithm> #define ll long long # 阅读全文
posted @ 2019-09-01 21:29 CCWUCMCTS 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 真实菜鸡,被AK打蒙了,签到都最后才找到的。 A.Maximum Element In A Stack Problem 栈操作,每次操作后求最大值。 Solution 加入时加此时堆里的最大值,要开long long。 Code #include<cstdio> #include<cstdlib> 阅读全文
posted @ 2019-08-31 19:39 CCWUCMCTS 阅读(689) 评论(0) 推荐(0) 编辑
摘要: Problem In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He woke up from an egg and split the egg into 阅读全文
posted @ 2019-08-28 21:04 CCWUCMCTS 阅读(233) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页