摘要: 1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <string> 5 #include <vector> 6 7 using namespace std; 8 typedef long long 阅读全文
posted @ 2020-09-16 20:23 章楠雨 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 手写了一个单链表,实现了一些简单的功能。 1 #pragma once 2 3 using namespace std; 4 5 class Node 6 { 7 public: 8 Node* next; 9 int data; 10 }; 11 12 class List 13 { 14 pri 阅读全文
posted @ 2020-09-15 11:09 章楠雨 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 typedef long long ll; 5 6 const int maxn = 1010; 7 8 // 输入先序遍历和中序遍历, 求后序遍历; 9 10 int pre[maxn], in[ma 阅读全文
posted @ 2020-09-08 20:45 章楠雨 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/contest/388654#status/2019030001040/B/0/ 字符串匹配 KMP模板题 #include <iostream> #include <algorithm> #include <cstdlib> #include 阅读全文
posted @ 2020-08-22 11:17 章楠雨 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/contest/388654#problem/A 字符串匹配kmp模板题 #include <iostream> #include <algorithm> #include <cstdlib> #include <cstring> #includ 阅读全文
posted @ 2020-08-22 11:13 章楠雨 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/contest/388653#problem/C 由于有多个起点,遍历起点进行n次bellman-ford,并每次遍历终点,取最小值。 #include <iostream> #include <algorithm> #include <cstd 阅读全文
posted @ 2020-08-19 20:36 章楠雨 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/contest/388653#problem/B 最短路基础题,使用bellman-ford #include <iostream> #include <algorithm> #include <cstdlib> #include <cstrin 阅读全文
posted @ 2020-08-19 20:32 章楠雨 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 最短路基础题,使用bellman-ford struct edge e[1e5] 不是邻接表,只是简单存图。 题目链接:https://cn.vjudge.net/problem/HDU-2544 #include <iostream> #include <algorithm> #include < 阅读全文
posted @ 2020-08-18 21:40 章楠雨 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/contest/386543#problem/C 题目大意是有一只青蛙,每次可跳过d格(或更少),求从起点到终点至少需要跳几次。 如果 i + d + 1 没有超过终点并且不是障碍物,就直接跳到 i + d + 1上。否则从i + d + 1 开始,从 阅读全文
posted @ 2020-08-02 14:43 章楠雨 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/contest/386543#problem/D 题目大意是有C辆车,每辆车可坐4个人,要带4 * C个人去吃饭。给出C辆车到达饭店的时间和每个人吃饭花费的时间。 等所有人都吃完饭,大家才会离开,问至少需要多少时间。只需把车辆到达时间按照升序排列,吃饭 阅读全文
posted @ 2020-08-02 14:32 章楠雨 阅读(197) 评论(0) 推荐(0) 编辑