贪心
东边的大西瓜
这个作者很懒,什么都没留下…
展开
-
洛谷P1803 凌乱的yyy / 线段覆盖
题目详情 #include<iostream> #include<algorithm> using namespace std; struct time{ int x; int y; }tt[1000000]; bool cmp(struct time a,struct time b){ return a.y<b.y; } int main() { int n...原创 2020-01-28 23:49:17 · 104 阅读 · 0 评论 -
贪心
最大子串和 贪心 #include<iostream> using namespace std; int main() { int sum,max,n; cin>>n>>max; sum=max;//防止都是负数的情况 while(--n) { int k=0; cin>>k; if(sum<0) sum=0; 如果当前和...原创 2020-01-26 23:35:55 · 116 阅读 · 0 评论