透视http协议-03http报文
HTTP报文
HTTP 协议的请求报文和响应报文的结构基本相同,由三大部分组成:
起始行(start line):描述请求或响应的基本信息;
头部字段集合(header):使用 key-value 形式更详细地说明报文;
消息正文(entity):实际传输的数据,它不一定是纯文本,可以是图片、视频等二进制数据。
leetcode-342. 4的幂
342. 4的幂
123456789101112131415161718192021222324252627class Solution { public boolean isPowerOfFour(int n) { if(n <= 0){ return false; } if(n == 1){ return true; } // 位运算 int cnt = 0; while(n != 0){ if((n&1) != 0){ int tmp = n >> 1; if(tmp == 0 && cnt % 2 == 0){ return true; }el ...
洛谷-P3386 【模板】二分图最大匹配
二分图的最大分配
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import java.util.*;class Main{ static Map<Integer, List<Integer>> map = new HashMap<>(); static int[] link = null; static boolean[] st = null; public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int e = sc.nextInt(); link = new int[m+1]; st = ...
leetcode-785. 判断二分图
785. 判断二分图
123456789101112131415161718192021222324252627282930313233343536373839404142class Solution { public boolean isBipartite(int[][] graph) { // 二分图、染色法判别 int n = graph.length; int[] color = new int[n]; // 将每个节点都染色一遍 for(int i = 0; i < n; i++){ if(color[i] == 0){ //如果该节点没有被染色 color[i] = 1; } if(!dfs(i, 0, graph, color)){ return false; ...
leetcode-1734. 解码异或后的排列
1734. 解码异或后的排列
123456789101112131415161718192021class Solution { public int[] decode(int[] encoded) { int n = encoded.length; int[] arr = new int[n+1]; int total = 0; for(int i = 1; i <= n+1; i ++){ total ^= i; } int tmp = 0; for(int i = 1; i < n; i = i + 2){ tmp ^= encoded[i]; } arr[0] = total ^ tmp; for(int i = 1; i <= n; i++){ arr[i] = arr[i-1] ...
leetcode-1310. 子数组异或查询
1310. 子数组异或查询
1234567891011121314151617class Solution { public int[] xorQueries(int[] arr, int[][] queries) { int n = arr.length; int[] s = new int[n+1]; for(int i = 1; i <= n; i++){ s[i] = s[i-1] ^ arr[i-1]; } int[] ans = new int[queries.length]; for(int i = 0; i < queries.length ; i++){ int[] tmp = queries[i]; int a = tmp[0]; int b = tmp[1]; ans[i] = s[b+1] ^ s[a] ...
spring cloud-01 eureka
eureka源码笔记
eureka初始化的整体流程
leetcode-1720. 解码异或后的数组
1720. 解码异或后的数组
12345678910111213141516171819202122232425262728293031323334353637383940class Solution { public int[] decode(int[] encoded, int first) { int n = encoded.length; int[] arr = new int[n+1]; arr[0] = first; for(int i = 0; i < n; i++){ int k = encoded[i]; int j = arr[i]; int ans = 0; int cnt = 0; while(k!=0){ int x; int a = (k & 1); ...
leetcode-938. 二叉搜索树的范围和
938. 二叉搜索树的范围和
123456789101112131415161718class Solution { int ans = 0; public int rangeSumBST(TreeNode root, int low, int high) { dfs(root, low, high); return ans; } public void dfs(TreeNode root, int low, int high){ if(root == null){ return; } dfs(root.left, low, high); if(root.val >=low && root.val <= high){ ans += root.val; } dfs(root.right, low, hi ...
git笔记-关联远程仓库
git关联远程项目步骤:
git init
git remote add origin https://gitee.com/ZhongHuaShiShan/eshop.git
git fetch origin
git branch --set-upstream-to=origin/master master
git pull origin master --allow-unrelated-histories
git push -u origin master
git暂存:
git stash --暂存代码
git stash list --查看暂存
git stash apply --恢复暂存