上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页
摘要: 第一题:SPFA,最难的还是读入,一般读入接上一行的\n; 第二题:LIS即为答案,一个逆序对一条边,只有LIS里面没有边,应该多想一下,这道题很简单,但我方向完全偏了; 第三题:搜索+剪枝,所有数据都很小,所以可以实际跑的很快,本来想状压没搞出来; #include<algorithm> #inc 阅读全文
posted @ 2018-09-07 18:23 Ed_Sheeran 阅读(152) 评论(0) 推荐(0)
摘要: 题解: 第一题:裸的exgcd,注意有很多特判; #include<bits/stdc++.h> using namespace std; #define ll long long const ll P = 65535; ll exgcd(ll a, ll b, ll &x, ll &y){ if( 阅读全文
posted @ 2018-09-02 15:51 Ed_Sheeran 阅读(246) 评论(0) 推荐(0)
摘要: 第三题换成能否得到x, 可以1, 不可以-1 题解: 第一题:打表找规律; 打表发现a是:1 1 2 2 3 4 4 4 5 6 6 7 8 8 8 8 9…… 对于每一项Ai = i拆分成质因数中有多少个2 + 1;如果把桶也给打出来,就发现他是这样的: 1 + 2 + 3 + 4 + 5 + 6 阅读全文
posted @ 2018-08-31 18:40 Ed_Sheeran 阅读(216) 评论(0) 推荐(0)
摘要: 题解: 第一题:蓝书上原题,每个蚂蚁相对位置不变,排一遍序; #include<bits/stdc++.h> using namespace std; const int M = 100005, E = 1000000000; double ans[M], t[M] ; struct Ant{int 阅读全文
posted @ 2018-08-30 14:11 Ed_Sheeran 阅读(166) 评论(0) 推荐(0)
摘要: 题解: 第一题,水题,把点拆了,dis[i][j]表示当前在i点经过了j个城市的最小距离,然后建一个大的S,T,跑一遍SPFA就可以了,dijstra巨慢(好多人都被卡了,数据很绝); #include<bits/stdc++.h> using namespace std; const int M 阅读全文
posted @ 2018-08-29 20:57 Ed_Sheeran 阅读(155) 评论(0) 推荐(0)
摘要: 今天是我调代码最久的y一天 题解: 第一题: check的时候记录c字符从左区间向右第一次出现cmin, 和最后一次出现cmax; 如果这个区间合法,就有cmax(c -1) < cmin(c); 这道题的细节很多,比如其中一个字符没有出现怎么办(数据中每组都有这种情况,还有边界的取舍); 我调了一 阅读全文
posted @ 2018-08-28 20:43 Ed_Sheeran 阅读(163) 评论(0) 推荐(0)
摘要: 今天又考的奇差 题解: 第一题; 这么简单一道题我想了好久,智商实在是下线了; #include<bits/stdc++.h> using namespace std; int main(){ freopen("shortway.in","r",stdin); freopen("shortway.o 阅读全文
posted @ 2018-08-27 18:17 Ed_Sheeran 阅读(133) 评论(0) 推荐(0)
摘要: 链接:https://www.luogu.org/problemnew/show/P2024 题目描述 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形。A 吃 B,B 吃 C,C 吃 A。 现有 N 个动物,以 1 - N 编号。每个动物都是 A,B,C 中的一种,但是我们并不 阅读全文
posted @ 2018-08-26 21:45 Ed_Sheeran 阅读(148) 评论(0) 推荐(0)
摘要: 以后WA了T了看数组; 暑假四次数组下标超界,多次数组开小,暂时没有访问到负下标 题解; 第一题;这道题可以转换为颜色相同的点缩成一个点,每次可以将两个点合并成同一点,问最少几次将所有点合并成一个点; 开始想到并查集+贪心合并度数最多的并查集,但这样是有问题的,比如度数一样时,选择的先后顺序是有影响 阅读全文
posted @ 2018-08-26 18:53 Ed_Sheeran 阅读(182) 评论(0) 推荐(0)
摘要: 题解: 第一题:二分+贪心;二分距离上限,两端的人能从两端取就从两端取,这样可以为中间的做贡献; #include<bits/stdc++.h> using namespace std; const int M = 10005; int a[M], b[M], pos[M], x, n, m; bo 阅读全文
posted @ 2018-08-24 15:08 Ed_Sheeran 阅读(227) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页