
贪心
甦萌
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Educational Codeforces Round 81 (Rated for Div. 2) C. Obtain The String
主要思想就是 用dp记录下t中的这个字母在s中那个位置找到 #include<bits/stdc++.h> using namespace std; #define ll long long int dp[100005][30]; int main() { std::ios::sync_with_stdio(false); int t,i,j; cin&g...原创 2020-04-08 22:18:49 · 152 阅读 · 0 评论 -
51nod 1432 独木舟 贪心
题目链接: http://www.51nod.com/Challenge/Problem.html#!#problemId=1432 排序匹配就行 #include<cstdio> #include<algorithm> #include<iostream> #include<cmath> #include<cstdlib> #in...原创 2019-03-02 12:50:01 · 138 阅读 · 0 评论 -
51nod 1428 活动安排 贪心
题目链接: http://www.51nod.com/Challenge/Problem.html#!#problemId=1428 排序之后 用vector容器模拟教室,每次记住教室使用结束时间 然后每次都找一个可以使用的教室 如果都有冲突就重新开一个教室 最后输出容器的size就行 #include<cstdio> #include<algorithm> ...原创 2019-03-02 13:15:02 · 149 阅读 · 0 评论 -
落谷 P2695 骑士的工作 简单贪心
题目链接 : https://www.luogu.org/problemnew/show/P2695 骑士排个序 遍历每个头 用lower_bound 二分查找一个大于等于他的骑士 需要注意的是 每个骑士只能上场一次 所以用一个数组标记下 #include<iostream> #include<cstdio> #include<cmath> #...原创 2019-03-03 11:07:04 · 378 阅读 · 0 评论