07 2018 档案
摘要:题目描述 White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row belong
阅读全文
摘要:题目描述 White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row belong
阅读全文
摘要:现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次操作: 操作一:将a[L]-a[R]内的元素都加上P 操作二:将a[L]-a[R]内的元素都减去P 最后询问a[l]-a[r]内的元素之和? n,m <= 1e6 1 #include <iostream> 2 #include <cst
阅读全文
摘要:1 链接:https://www.nowcoder.com/acm/contest/141/C 2 来源:牛客网 3 4 Eddy likes to play cards game since there are always lots of randomness in the game. For most of the cards game, the very first step ...
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/139/J来源:牛客网 题目描述 Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ...,
阅读全文
摘要:Chiaki has an array of n positive integers. You are told some facts about the array: for every two elements ai and aj in the subarray al..r (l≤i<j≤r),
阅读全文
摘要:线段树构造 因为树状数组不需要构造这一过程,所以先讲线段树的构造 就是用到递归:先设left=1,right=n,然后每一次递归,left、mid和mid+1、right。代码如下: `` 线段树单点修改 单点修改就是每到一个节点,看这个节点代表着的区间包括不包括这个点,包括就加上。 树状数组单点修
阅读全文
摘要:核心思想: (1)树状数组中的每个元素是原数组中一个或者多个连续元素的和。 (2)在进行连续求和操作a[1]+...+a[n]时,只需要将树状数组中某几个元素的和即可。时间复杂度为O(lgn) (3)在进行修改某个元素a[i]时,只需要修改树状数组中某几个元素的和即可。时间复杂度为O(lgn) 下图
阅读全文
摘要:package 选课管理系统; import java.sql.*; public class 连接数据库 { static Connection con = null; static String datascore = "教务系统"; static String URL = "jdbc:mysql://localhost:3306/"+datascore+"?use...
阅读全文

浙公网安备 33010602011771号