Codeforces
文章平均质量分 81
老年退役选手
BAT打工人
展开
-
Codeforces946E Largest Beautiful Number
传送门:Codeforces946E 题意:给定一个数字,求一个比该数字小,且是漂亮数字的数字漂亮数字:不一定求得的数字就是回文数字,要求数位上的所有数字排列组合后是个回文数字分析: 贪心数据比较小,77ms过了。。先预处理,统计到第i个数位,0到9数字一共出现了奇数次还是偶数次从低位到高位枚举,若找到符合条件的数字则输出没有输出N-2个9代码如下:#include <cstdio>...原创 2018-03-07 19:28:47 · 688 阅读 · 0 评论 -
Codeforces 948A Protect Sheep
传送门:Proctect Sheep分析:简单题读入地图后,先判断是否出现羊和狼紧挨的情况,有的话羊一定被吃掉。既然不要求最少的狗的数目,那么只要地图有空位就放一只狗代码如下:#include <cstdio>#include <cstring>using namespace std;const int maxn = 510;bool flag;int n,m;...原创 2018-03-11 09:54:13 · 518 阅读 · 0 评论 -
Codeforces 923A - Primal Sport
传送门:Primal SportA. Primal Sporttime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob begin their day with a quick game. They first choos...原创 2018-03-11 10:02:39 · 1245 阅读 · 0 评论 -
Codeforces 923B Producing Snow
传送门:Producing SnowC. Producing Snowtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice likes snow a lot! Unfortunately, this year's winter is alr...原创 2018-03-11 10:13:19 · 967 阅读 · 0 评论 -
Codeforces 944B Laboratory Work
传送门:Codeforces 944BB. Laboratory Worktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnya and Kirill are doing a physics laboratory work. In one of...原创 2018-03-05 08:53:40 · 345 阅读 · 0 评论 -
Codeforces 930B Game with String
传送门:Codeforces 930B B. Game with Stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya and Kolya play a game with a string, using the follow...原创 2018-03-05 09:29:45 · 1698 阅读 · 0 评论 -
Codeforces 955C Sad powers 基础数论+二分
传送门:Sad powers分析: 先固定指数p,x^p <= 1e18 可以推导出 x <= 10^(18/p) [取对数推导]若 p == 2, 则有 10^9 那么多的数字 满足条件若 p >= 3, 则最多有 10^6 的数字满足 条件先预处理,把所有不是 完全平方数且满足 x^p<=1e18(p>=3) 的x都加入到vector, 排序去重对于每次查询 输出...原创 2018-03-27 16:49:30 · 869 阅读 · 10 评论 -
Helvetic Coding Contest 2018 online mirror (teams allowed, unrated) C2.Encryption (medium)
传送门:Encryption(medium)题意:N个数,分成k个连续的序列,把每个序列的数累加取模p,求k个取模结果累加的最大值。分析:DP, 复杂度O(Nkp)设dp[i][j]为取模结果i,分为j个区间的最大值,具体见代码~#include <cstdio>#include <cstring>#include <algorithm>using nam...原创 2018-04-16 21:48:34 · 256 阅读 · 0 评论