题意: 链接:https://ac.nowcoder.com/acm/contest/5158/I 思路:树状数组主要针对的是区间(而且是一条线段的)求和问题,所以需要利用dfs序和数组 in [ ], out [ ] (前缀和原理),利用dfs进行搜索,每个点依次被访问的顺序就是每个点的dfs序, ...
分类:
编程语言 时间:
2020-10-05 21:24:06
阅读次数:
36
1.创建表时并创建外键约束 create table score( scoreID int primary key, stuID int , score int constraint ck_score check(score between 0 and 100), courseName varcha ...
分类:
数据库 时间:
2020-09-24 22:03:46
阅读次数:
54
让我们先把没学完的IDFT放在这里 #include <stdio.h> #include <algorithm> #include <cstring> const int maxn=200000; typedef std:complex<double> com;//typedef 真实放前 def ...
分类:
其他好文 时间:
2020-09-24 21:58:31
阅读次数:
37
1. 深层对象的读取,后端返回一个null导致前端报错 //开发场景,有时后端接口返回的字段的数据为null,导致前端有时不能读取深度值 let obj= {a:null} const { b } = obj.a // 对一个不存在的字段值继续取字段,导致报错 解决方案: // 解决方案1, 增加d ...
分类:
其他好文 时间:
2020-09-24 21:58:00
阅读次数:
43
RT 考试的时候口胡出来的,正确性不会证,不过貌似100000内的数都是对的(现在已经会了,在此鸣谢gyz大佬) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=5e7+10,max ...
分类:
其他好文 时间:
2020-09-24 21:27:32
阅读次数:
46
代码如下 #include<iostream> using namespace std; const int MAXN = 1000 + 5; struct Node // 进去一个出去一个,很明显,队列 { int num; // 保存进去的数字 }; struct Node queue[MAXN ...
分类:
其他好文 时间:
2020-09-24 21:25:32
阅读次数:
42
1.Object构造函数创建 // 1.Object构造函数创建 var Obj = new Object(); Obj.name='saoge'; Obj.say=function(){ console.log(`我的名字是${this.name}`) } Obj.say(); 2.使用对象字面量 ...
分类:
编程语言 时间:
2020-09-24 00:03:48
阅读次数:
38
引言 在nuxt中使用vuex,以模块方式引用——计数器为例 目录结构 js模块写法 // user.js// state为一个函数, 注意箭头函数写法const state = () => ({ counter: 6}) // mutations为一个对象const mutations = { i ...
分类:
其他好文 时间:
2020-09-23 23:43:24
阅读次数:
50
匹配正则 使用 .test() 方法 let testString = "My test string";let testRegex = /string/;testRegex.test(testString); 匹配多个模式 使用操作符号 | const regex = /yes|no|maybe/ ...
分类:
Web程序 时间:
2020-09-23 23:24:18
阅读次数:
45
如下代码 const request = function(){ let num = Math.round(Math.random()*100)/100; console.log(num); setTimeout(function(){ if(num < 0.5){ return('1234567' ...
分类:
其他好文 时间:
2020-09-23 23:23:45
阅读次数:
46