12 2020 档案

摘要:题目: 题目大意: 在数组中寻找和最大的一段连续的序列 思路: 用贪心的做法,从第一个开始,累加a[i],如果sum<0就把这一段给舍去掉,从新的起点开始,如果sum>max,则进行信息的更新 #include <iostream> using namespace std; const int MA 阅读全文
posted @ 2020-12-13 13:33 grass_lin 阅读(74) 评论(0) 推荐(0) 编辑
摘要:题目 解题思路: 对时间进行排序即可 #include <bits/stdc++.h> using namespace std; struct node{ string name; int be,en; }stu[100000]; int format(string s){ return ((s[0 阅读全文
posted @ 2020-12-13 13:28 grass_lin 阅读(42) 评论(0) 推荐(0) 编辑
摘要:题目 代码 #include <bits/stdc++.h> using namespace std; string s[10]={"zero","one","two","three","four","five","six","seven","eight","nine"}; int a[1000]; 阅读全文
posted @ 2020-12-13 13:26 grass_lin 阅读(34) 评论(0) 推荐(0) 编辑
摘要:解题思路: DFS,从起点开始遍历所有能到达终点的路,找出最短路径和最大的救援队伍数 #include <bits/stdc++.h> const int INF = 0x7fffffff; using namespace std; int n,m,c1,c2; int head[2000],tot 阅读全文
posted @ 2020-12-12 14:58 grass_lin 阅读(71) 评论(0) 推荐(0) 编辑