c++入门
kybxdkybxd
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU查找(4)
1067 Gap bfs,注意输入的数据是short可以转化为char再转化为string来存储 #pragma warning(disable:4996) #include<cstdio> #include<map> #include<cmath> #include<vector> #include<iostream> #include...原创 2019-11-29 23:54:21 · 342 阅读 · 0 评论 -
HDU查找(3)
1044 Collect More Jewels 先bfs打表,再dfs找最大收益 注意: 1.bfs把每个点push进queue之前就检查,否则ME 2.dfs最大值已经为所有珠宝价值总和时直接返回,否则TE 3.注意对不能到达的点的处理,否则RE 测试样例: 3 3 3 3 2 1 1 @*A <*B .*. 4.注意最后一行结尾没有\n,否则PE #pragma warning(di...原创 2019-11-26 21:29:33 · 175 阅读 · 0 评论 -
HDU查找(2)
1026 Ignatius and the Princess I 找最短路径问题用bfs,注意对发生战斗位置的处理 #pragma warning(disable:4996) #include<cstdio> #include<cstring> #include<string> #include<map> #include<stack> ...原创 2019-11-26 21:24:18 · 253 阅读 · 0 评论 -
HDU水题(6)
1076 An Easy Task 每400年有97个闰年,然后遍历 #pragma warning(disable:4996) #include<cstdio> #include<map> #include<cmath> #include<vector> #include<iostream> #include<algorithm&...原创 2019-11-20 21:53:24 · 226 阅读 · 0 评论 -
HDU水题(5)
1048 The Hardest Problem Ever 注意gets读取一行时把’\n’转换为’\0’,puts输出一个字符串时把’\0’转换为’\n’。 #pragma warning(disable:4996) #include<cstdio> #include<map> #include<vector> #include<iostream>...原创 2019-11-20 21:47:13 · 205 阅读 · 0 评论 -
HDU水题(4)
1031 Design T-Shirt 建立一个map来存,然后对value排序并查找 #pragma warning(disable:4996) #include<cstdio> #include<map> #include<vector> #include<algorithm> bool cmp(double a, double b) { ...原创 2019-11-14 22:52:48 · 192 阅读 · 0 评论 -
HDU水题(3)
1017 A Mathematical Curiosity 水水水,报Presentation Error,貌似是哪里空格和换行不对 #pragma warning(disable:4996) #include<cstdio> int main() { int N; scanf("%d", &N); for (int i = 0; i < N; i++...原创 2019-11-13 20:15:34 · 172 阅读 · 0 评论 -
HDU水题(2)
1015 Safecracker 深度优先搜索 //使VS在while(scanf(...))时不报错 #pragma warning(disable:4996) #include<cstdio> #include<cstring> #include<algorithm> using namespace std; //直接定义为全局变量即可 int tar...原创 2019-11-12 13:02:30 · 153 阅读 · 0 评论 -
HDU水题(1)
1008 Elevator 注意采用三元表达式 bool ? a : b简化代码 1012 u Calculate e 注意printf和cout的输出形式 #include<iomanip> cout << setprecision(10); //输出数据小数点前后总共保留十位,末尾的0不显示 //注意setprecision在iomanip中定义 printf("%...原创 2019-11-11 21:37:05 · 157 阅读 · 0 评论
分享