#include<iostream> #include<cstring> using namespace std; int len; void getNext(char *s, int *nex) { nex[0] = -1; int i = 0, j = -1; while(i < len) { ...
分类:
其他好文 时间:
2020-12-01 12:21:17
阅读次数:
7
Sumdiv Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 37483 Accepted: 9161 Description Consider two natural numbers A and B. Let S be the ...
分类:
其他好文 时间:
2020-11-27 11:53:21
阅读次数:
25
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i ...
分类:
其他好文 时间:
2020-11-25 12:59:50
阅读次数:
14
##题面 You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting ...
分类:
其他好文 时间:
2020-11-21 12:28:36
阅读次数:
7
题目链接 题意:给定一个字符串,求重复次数最多的连续重复子串 题目思路:先穷举长度L,然后求长度为L的子串最多能连续出现几次。首先连续出现1次是肯定可以的,所以这里只考虑至少2次的情况。假设在原字符串中连续出现2次,记这个子字符串为S,那么S肯定包括了字符r[0], r[L], r[L2],r[L3 ...
分类:
编程语言 时间:
2020-11-12 14:07:06
阅读次数:
10
确切的含义如下。在C++中没有真正的2D矢量,但有std::vector<T>包含std::vector<T>。 如果你声明一个载体std::vector<int> vec(10)你有一个包含10个元素的向量。所以vec.size()是10. 如果你声明std::vector<std::vector ...
分类:
编程语言 时间:
2020-11-11 16:26:59
阅读次数:
10
#include<iostream> #include<memory.h> #include<cmath> #include<algorithm> using namespace std; typedef struct { int x, y; }node; node d[6000]; int r, ...
分类:
其他好文 时间:
2020-11-08 17:11:46
阅读次数:
15
1.confusion_matrix 理论部分见https://www.cnblogs.com/cxq1126/p/12990784.html#_label2 1 from sklearn.metrics import confusion_matrix 2 3 #if y_true.shape=y_ ...
分类:
其他好文 时间:
2020-11-06 02:47:11
阅读次数:
41
1. numpy.ndarray类型乘积 1.1 矩阵乘法 a@b np.dot(a, b) np.matmul(a, b) 1.2 对应位置元素相乘 a*b np.multiply(a, b) 2.numpy.matrix类型乘积 2.1 矩阵乘法 a@b a*b np.dot(a, b) np. ...
分类:
编程语言 时间:
2020-11-01 20:39:23
阅读次数:
17
题意:给你四组长度为$n$序列,从每个序列中选一个数出来,使得四个数字之和等于$0$,问由多少种组成情况(仅于元素的所在位置有关). 题解:$n$最大可以取4000,直接暴力肯定是不行的,我们可以先对后两个数组$c$和$d$,枚举他们每个元素的和,用一个新数组$CD$记录,然后再去枚举$a$和$b$ ...
分类:
其他好文 时间:
2020-10-31 01:32:05
阅读次数:
17