随笔分类 -  Codeforces

摘要:Solutions A. Filling Diamonds 通过猜测就欧克了。 发现如果竖直放置就只有一种摆放方法了。 B. Sorted Adjacent Differences 排序后,比较显然的就相距最远的放右边,然后就这样放就可以了。 C. Powered Addition 这个题稍加分析, 阅读全文
posted @ 2020-04-30 22:03 Frontierone 阅读(193) 评论(0) 推荐(0)
摘要:Solutions A. Candies and Two Sisters 直接$\frac{x 1}2$ B. Construct the String 发现和字串长度无关,直接循环不同字符数即可。这样肯定是符合的。 阅读全文
posted @ 2020-04-19 23:35 Frontierone 阅读(201) 评论(0) 推荐(0)
摘要:Solutions A. Ichihime and Triangle 直接让三边是$a,c,c$即可 B. Kana and Dragon Quest game 贪心,只要操作1不会反向增加就一直用,然后再判断操作2能不能把血扣完。 阅读全文
posted @ 2020-04-19 11:49 Frontierone 阅读(220) 评论(0) 推荐(0)
摘要:Solutions A. Creating a Character 题意: 给出初始体力值$str$和智力值$int$,然后你可以把$exp$分别分配给这两个数值,使得分配后$str int$,求有多少种分配方案。 思路: 特判不可能情况:$str + exp int$,乱搞 正解: 假设分别分配给 阅读全文
posted @ 2019-09-13 18:08 Frontierone 阅读(210) 评论(0) 推荐(0)
摘要:Solutions A. There Are Two Types Of Burgers 题意: 做一个$A$需要两个$b$和两个$p$,能卖$h$元;做一个$B$需要两个$b$和两个$f$,能卖$c$元。给出$b,p,f$的数量,求最多卖多少元。 思路: 比赛的时候用循环搞了,判断$h,c$的大小关 阅读全文
posted @ 2019-08-27 14:41 Frontierone 阅读(224) 评论(0) 推荐(0)
摘要:Solutions A. Choose Two Numbers 题意: 给出$A,B$两个集合,$A,B$ 集合分别选一个数$a,b$ ,使得$a+b\notin\ A,B$ 思路: 每个集合选出最大值,必定满足条件。emmmmm比赛的时候傻了。 阅读全文
posted @ 2019-08-22 18:23 Frontierone 阅读(194) 评论(0) 推荐(0)
摘要:A:Tokitsukaze and Enhancement 当时看错条件了。。以为A>C>B>D。就胡写了判断条件。 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 bool work(int a,int b) { 5 if(a 1) ret 阅读全文
posted @ 2019-07-16 23:03 Frontierone 阅读(166) 评论(0) 推荐(0)
摘要:A:Remainder 遍历一遍就可以了。 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 char s[200010]; 5 int main() { 6 int n,x,y; 7 scanf("%d%d%d",&n,&x,&y); 8 s 阅读全文
posted @ 2019-05-17 19:39 Frontierone 阅读(187) 评论(0) 推荐(0)
摘要:B. Little Elephant and Array time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output B. Little E 阅读全文
posted @ 2019-05-14 21:18 Frontierone 阅读(183) 评论(0) 推荐(0)
摘要:A:模拟,出现重复的break。 1 #include <bits/stdc++.h> 2 #define lowbit(x) (x)&(-x) 3 #define il inline 4 #define lson l,mid-1,now 5 #define rson mid+1,r,now 6 # 阅读全文
posted @ 2019-04-28 21:12 Frontierone 阅读(137) 评论(0) 推荐(0)
摘要:A、题目意思理解就过了 B、读了题目没有写,但是依稀感觉是前缀和,不过写残了。题解代码非常简洁。 维护前缀、后缀奇数和,维护前缀、后缀偶数和。 题解把遍历过的数都减去了,也就维护了后缀和。 前缀过一个加一个。 1 #include<bits/stdc++.h> 2 typedef long long 阅读全文
posted @ 2019-02-28 20:40 Frontierone 阅读(226) 评论(0) 推荐(0)
摘要:C. Good Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Good Array time limit pe 阅读全文
posted @ 2018-11-20 19:30 Frontierone 阅读(208) 评论(0) 推荐(0)
摘要:B. Taxi drivers and Lyft time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Taxi drivers 阅读全文
posted @ 2018-11-11 17:19 Frontierone 阅读(245) 评论(0) 推荐(0)
摘要:题目大意:每个同学可以指定一个人,然后构成一个有向图。1-n次查询,从某个人开始并放入一个东西,然后循环,直到碰到一个人已经放过了,就输出。 思路:直接模拟就可以了,O(n^2) 但是O(n)也可以实现, 不是太懂大神的思路。 初始化ans[i] = i, 一个点能被输出的话就是 ans[i] = 阅读全文
posted @ 2018-08-14 20:12 Frontierone 阅读(206) 评论(0) 推荐(0)
摘要:D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Now Vasya is tak 阅读全文
posted @ 2018-08-06 10:54 Frontierone 阅读(138) 评论(0) 推荐(0)
摘要:B. Segment Occurrences time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Segment Occurr 阅读全文
posted @ 2018-08-06 09:40 Frontierone 阅读(187) 评论(0) 推荐(0)
摘要:D. Walking Between Houses time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Walking Bet 阅读全文
posted @ 2018-08-04 16:14 Frontierone 阅读(151) 评论(0) 推荐(0)
摘要:A. Points in Segments time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Points in Segmen 阅读全文
posted @ 2018-08-03 21:02 Frontierone 阅读(192) 评论(0) 推荐(0)