上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页
摘要: ##Problem A 让你求最长子数组,可以不被x整除。那么整除问题,我们直接取模做方便一点。然后,考虑怎么样会是-1的情况,很显然所有元素都是x的倍数,无论我们怎么选,都会是x的倍数。然后考虑最优情况,那肯定是总和加起来不是x的倍数那么答案一定是n。剩下的情况是怎么样的呢,剩下的情况就是总和可以 阅读全文
posted @ 2020-09-04 14:14 Luglucky 阅读(123) 评论(0) 推荐(0) 编辑
摘要: ##Problem A 我真是个傻逼,本来想判一下和前一项是否相等的,但是t3明显就不对,后面发现就是一个模拟题,直接甲加一输出就好了。 ##Problem B 首先,和下标奇偶性一样的显然不需要动,那么就是看不相等的数目,因为一次交换可以使得两个不相等的恢复,如果这个两种数量不一样,那么输出-1. 阅读全文
posted @ 2020-09-02 14:04 Luglucky 阅读(152) 评论(0) 推荐(0) 编辑
摘要: ##Problem B 是这样,原来的数组是偶数长度,所以要么有偶数个奇数和偶数个偶数组成,要么奇数偶数都是奇数个,要求gcd不等于1,那么我们求gcd等于2就好了。直接暴力存奇数偶数,然后输出就好了。 ##Problem C 首先我们特判1和2,然后如果先手面临奇数的情况,先手必胜,如果是没有奇数 阅读全文
posted @ 2020-09-01 09:50 Luglucky 阅读(124) 评论(0) 推荐(0) 编辑
摘要: ##题目 Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) whi 阅读全文
posted @ 2020-08-31 20:56 Luglucky 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ##题目 As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these compute 阅读全文
posted @ 2020-08-28 23:43 Luglucky 阅读(172) 评论(0) 推荐(0) 编辑
摘要: ##题目 (left->)[https://www.luogu.com.cn/problem/solution/P4012] ##思路 首先考虑费用和流量分别是什么,那么很显然,费用是步数,流量是价值。那么接下来考虑建图,首先源点连机器人,汇点连目的地,这都没问题。然后考虑相邻的点并且可以行走的话就 阅读全文
posted @ 2020-08-27 23:21 Luglucky 阅读(119) 评论(0) 推荐(0) 编辑
摘要: ##Problem B ###题目 You are playing one RPG from the 2010s. You are planning to raise your smithing skill, so you need as many resources as possible. So 阅读全文
posted @ 2020-08-26 23:50 Luglucky 阅读(213) 评论(0) 推荐(0) 编辑
摘要: ##题目 (戳我)[https://www.luogu.com.cn/problem/solution/P4016] ##思路 讲一下费用流的建图,首先我们需要做的肯定是做到数量平均,所以我们考虑大于平均值的边应该是要出流的,小于的应该是要流入的,题目要求的是搬运量,自然而然它就是费用,我们在相邻的 阅读全文
posted @ 2020-08-26 23:21 Luglucky 阅读(134) 评论(0) 推荐(0) 编辑
摘要: ##Problem B ###题目 A competitive eater, Alice is scheduling some practices for an eating contest on a magical calendar. The calendar is unusual because 阅读全文
posted @ 2020-08-25 17:56 Luglucky 阅读(144) 评论(0) 推荐(0) 编辑
摘要: ##题目 roblem Description Little Q's factory recently purchased m pieces of new equipment, labeled by 1,2,…,m. There are n workers in the factory, label 阅读全文
posted @ 2020-08-25 13:33 Luglucky 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页