随笔分类 -  思维

 
CodeForces - 35D
摘要:题目:https://vjudge.net/contest/326867#problem/A 题意:有一个农场,自己有m斤粮食,有n天,每天动物吃的量不同,那个动物的食量的是由他是从那天开始进这个农场确定的,后面不能再变,从这天进来后就必须吃到第n天,每天只能进来一个动物,问最后能被保留下来的动物数 阅读全文
posted @ 2019-09-18 14:12 Lis~ 阅读(159) 评论(0) 推荐(0)
Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2) G1. Into Blocks (easy version)
摘要:题目:https://codeforc.es/contest/1209/problem/G1 题意:给你一个序列,要你进行一些操作后把他变成一个好序列,好序列的定义是,两个相同的数中间的数都要与他相同,可以把某一种数统一变成另一个数,问最少变得个数 思路:我们可以考虑贪心,对于一个互相牵扯的区间,我 阅读全文
posted @ 2019-09-17 17:51 Lis~ 阅读(224) 评论(0) 推荐(0)
AcWing 199. 余数之和 (除法分块)打卡
摘要:给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值。 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5=0+1+0+3+3=7。 输入格式 输入仅一行,包含两个 阅读全文
posted @ 2019-06-10 22:43 Lis~ 阅读(135) 评论(0) 推荐(0)
AcWing 197. 阶乘分解 (筛法)打卡
摘要:给定整数 N ,试把阶乘 N! 分解质因数,按照算术基本定理的形式输出分解结果中的 pipi 和 cici 即可。 输入格式 一个整数N。 输出格式 N! 分解质因数后的结果,共若干行,每行一对pi,cipi,ci,表示含有pciipici项。按照pipi从小到大的顺序输出。 数据范围 1≤N≤10 阅读全文
posted @ 2019-06-09 21:32 Lis~ 阅读(185) 评论(0) 推荐(0)
Codeforces Round #554 (Div. 2) C. Neko does Maths (简单推导)
摘要:题目:http://codeforces.com/contest/1152/problem/C 题意:给你a,b, 你可以找任意一个k 算出a+k,b+k的最小公倍数,让最小公倍数尽量小,求出这个k 思路: 因为现在两个都是未知数,我们无法确定 我们根据gcd底层实现原理 gcd(a+k,b+k) 阅读全文
posted @ 2019-04-25 20:05 Lis~ 阅读(264) 评论(0) 推荐(0)
Codeforces Round #538 (Div. 2) C. Trailing Loves (or L'oeufs?) (分解质因数)
摘要:题目:http://codeforces.com/problemset/problem/1114/C 题意:给你n,m,让你求n!换算成m进制的末尾0的个数是多少(1<n<1e18 1<m<1e12) 思路:首先我们想一下更简单的一个问题 n!下十进制的末尾0的个数是多少,我们要使末尾出现0,十进制 阅读全文
posted @ 2019-04-18 17:25 Lis~ 阅读(165) 评论(0) 推荐(0)
Codeforces Round #324 (Div. 2) (哥德巴赫猜想)
摘要:题目:http://codeforces.com/problemset/problem/584/D 思路: 关于偶数的哥德巴赫猜想:任一大于2的偶数都可写成两个素数之和。 关于奇数的哥德巴赫猜想:任一大于7的奇数都可写成三个质数之和的猜想。 #include<cstdio> #include<cst 阅读全文
posted @ 2019-04-11 23:36 Lis~ 阅读(168) 评论(0) 推荐(0)
Codeforces Round #281 (Div. 2) D(简单博弈)
摘要:题目:http://codeforces.com/problemset/problem/493/D 题意:一个n*n的地图,有两个人在比赛,第一个人是白皇后开始在(1,1)位置,第二个人是黑皇后开始在(1,n)位置,然后问你谁嬴,并且如果是白赢输出第一步走的什么 如果有多个答案输出x最小,还有相同输 阅读全文
posted @ 2019-04-10 16:14 Lis~ 阅读(105) 评论(0) 推荐(0)
2018ICPC青岛 E - Plants vs. Zombies (二分+模拟)
摘要:ZOJ - 4062 题意:有n个植物排成一排,按顺序植物的编号是1-n,每个植物都有一个生长速率,有一个机器人,机器人可以走m步,每走一步,这个机器人就会浇一次水,浇一次水那个植物就会长 自身的生长速率那么高,然后现在要求最大的最小生长值, 思路:一般要求最大的最小值都是使用二分来求答案,我们二分 阅读全文
posted @ 2018-12-13 17:02 Lis~ 阅读(321) 评论(0) 推荐(0)
CodeForces - 429A Xor-tree
摘要:Iahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary disco 阅读全文
posted @ 2018-10-21 21:14 Lis~ 阅读(368) 评论(0) 推荐(0)
2017 秦皇岛CCPC Balloon Robot (ZOJ 3981)
摘要:题意:给出n个队伍,m个座位,q次A题的队伍与时间,下一行是n个队伍的坐的位置,再下面q行就是第x个队再第y秒A出一道题,然后有一个机器人,开始位置由你选,他每走一步 他就会向右走一格,走到m的时候会再次走到1位置,然后如果一个队在第x秒A出一道题,机器人第y秒才到,那么会有一个不开心值y-x,然后 阅读全文
posted @ 2018-09-24 20:22 Lis~ 阅读(134) 评论(0) 推荐(0)
四川省赛 SCU - 4438
摘要:Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text pp. Her job is relatively simple -- just to find the first 阅读全文
posted @ 2018-08-30 14:43 Lis~ 阅读(226) 评论(0) 推荐(0)
Codeforces Round #506 (Div. 3) D. Concatenated Multiples
摘要:D. Concatenated Multiples You are given an array aa, consisting of nn positive integers. Let's call a concatenation of numbers xx and yy the number th 阅读全文
posted @ 2018-08-26 15:30 Lis~ 阅读(539) 评论(0) 推荐(0)
Codeforces Round #506 (Div. 3) C. Maximal Intersection
摘要:C. Maximal Intersection time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output C. Maximal Inter 阅读全文
posted @ 2018-08-25 10:04 Lis~ 阅读(499) 评论(0) 推荐(0)
Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) D. Array Restoration
摘要:D. Array Restoration time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. Array Restoration 阅读全文
posted @ 2018-08-18 11:38 Lis~ 阅读(298) 评论(0) 推荐(0)
Codeforces Round #503 (by SIS, Div. 2) C. Elections
摘要:C. Elections As you know, majority of students and teachers of Summer Informatics School live in Berland for the most part of the year. Since corrupti 阅读全文
posted @ 2018-08-12 19:57 Lis~ 阅读(801) 评论(0) 推荐(0)
Codeforces Round #212 (Div. 2) C. Insertion Sort
摘要:C. Insertion Sort Petya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The firs 阅读全文
posted @ 2018-08-10 11:57 Lis~ 阅读(361) 评论(0) 推荐(0)
牛客多校第五场 F take
摘要:链接:https://www.nowcoder.com/acm/contest/143/F来源:牛客网 题目描述 Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At th 阅读全文
posted @ 2018-08-03 10:02 Lis~ 阅读(369) 评论(0) 推荐(0)
杭电多校第三场 A Ascending Rating
摘要:Problem Description Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. 阅读全文
posted @ 2018-07-31 04:14 Lis~ 阅读(205) 评论(0) 推荐(0)
牛客多校第四场 G Maximum Mode
摘要:链接:https://www.nowcoder.com/acm/contest/142/G来源:牛客网 The mode of an integer sequence is the value that appears most often. Chiaki has n integers a1,a2, 阅读全文
posted @ 2018-07-28 17:16 Lis~ 阅读(634) 评论(0) 推荐(0)