摘要: ACwing23 方法 dfs 开始以为是dijkstra没想到是dfs 学习 冲这个题中看出,dfs用的是标记,不一定是visited[],能标记,递归就行 代码 bool hasPath(vector<vector<char>>& matrix, string &str) { for(int i 阅读全文
posted @ 2022-11-15 08:38 壹剑霜寒十四州 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 洛谷1216 思路 求和最大,划分没子问题,求的每次子问题最大 代码 #include<iostream> #include<vector> using namespace std; const int N = 1010; int dp[N][N] = {0}; int arr[N][N]={0}; 阅读全文
posted @ 2022-11-15 08:05 壹剑霜寒十四州 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 题 思路 最开始用的dp做,但是发现只有10分 #include<iostream> using namespace std; string a,b; int main(){ cin>>a>>b; int dp[a.length()+1][b.length()+1]={0}; for(int i = 阅读全文
posted @ 2022-11-14 15:55 壹剑霜寒十四州 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 洛谷 8697 给你一个数组,求连续的数组最大值 方法dp 代码 #include<iostream> using namespace std; int main(){ int n ; cin>>n; int arr[n]; for(int i = 0;i<n;i++) cin>>arr[i]; i 阅读全文
posted @ 2022-11-14 15:06 壹剑霜寒十四州 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 洛谷1303 #include<iostream> using namespace std; const int N = 50000; int arr[2*N]; int aa[N]; int bb[N]; int main(){ string a,b; cin>>a>>b; for(int i = 阅读全文
posted @ 2022-11-14 12:25 壹剑霜寒十四州 阅读(8) 评论(0) 推荐(0) 编辑
摘要: A+B ` 考虑高精度 代码 #include<iostream> using namespace std; const int N = 510; int arr[N],aa[N],ab[N]; int main(){ string a,b; cin>>a; cin>>b; int sizea = 阅读全文
posted @ 2022-11-14 11:28 壹剑霜寒十四州 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 洛谷1255,数楼梯 概念 特高精度 long long也无法满足,就要用string或者数组存放数字 方法 斐波那契+高精度 代码 #include<iostream> #include<cmath> #include<algorithm> using namespace std; int f[5 阅读全文
posted @ 2022-11-14 09:44 壹剑霜寒十四州 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 概念 servlet?what is servlet,相比单调的前端,是一种前后端一体化的动态web资源开发,,是服务器的Java程序, 工作原理 doGet和doPost方法是居基于http的post和get方法 doGet():当客户端通过http表单发送httpget请求,或者url,后端的d 阅读全文
posted @ 2022-11-13 11:44 壹剑霜寒十四州 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 监听器 监听器主要是监听某个具体事件,如果事件发生就执行一般是监听: 1、ServletContext:application,整个应用只存在一个 2、HttpSession:session,针对每一个对话 3、ServletRequest:request,针对每一个客户请求 加载顺序: 监听器>过 阅读全文
posted @ 2022-11-13 11:17 壹剑霜寒十四州 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 洛谷1116 概念 //当然下面是争对升序排序 冒泡是每次大当往最后移动,所有只需只需n-1次,每次移动完全,后面就不需要关,所以后面就要用j-i,表示不考虑最后的 for(int i = 0;i<n-1;i++){ for(int j = 0;j<n-i-1;j++){ if(..) } } 时间 阅读全文
posted @ 2022-11-12 15:10 壹剑霜寒十四州 阅读(12) 评论(0) 推荐(0) 编辑