
codeforces
nefu_zc
这个作者很懒,什么都没留下…
展开
-
寒假cf补题
Codeforces Round #695 (Div. 2)B. Hills And Valleys*1700,这题直接暴力,不需要dp,判断的时候注意下标#include <bits/stdc++.h>using namespace std;const int N = 3e5+10,M=2e5+10;typedef long long ll;int a[N];bool judge(int left,int right,int now){ if(now>left&原创 2021-01-23 16:01:20 · 211 阅读 · 0 评论 -
codeforces训练(rating1400-1800)
Educational Codeforces Round 90 (Rated for Div. 2)D. Maximum Sum on Even Positions解题思路:首先将问题的多种不同情况列出来,发现有两种情况。这种数组的问题好像经常会有差分数组的构造。,下次解不出来构造一下差分数组。由于求的是连续的,所以构造差分数组,后求连续子段和,并且复杂度是O(n),满足。#include <bits/stdc++.h>using namespace std;const int N原创 2020-08-18 17:46:52 · 779 阅读 · 0 评论 -
Educational Codeforces Round 92 (Rated for Div. 2)题解(A-C)
1389A. LCM Problem害,水题a的太慢,一开始还想着暴力,时间复杂度都没看,还有没用longlong结果交了3次,后面的不会,水题a的慢,得改改。题意:给定两个整数定义的闭区间[l,r],让你在区间内找出两个数x,y满足LCM(x,y)≤r;思路:容易验证LCM(x,y)至少是min(x,y)的二倍,所以直接构造一组最小的解(l,2l)(l,2l)#include <bits/stdc++.h>using namespace std;typedef long lo原创 2020-07-31 00:40:45 · 278 阅读 · 0 评论