#include<iostream> #include<string> using namespace std; void getNext(string s, int *nex) { nex[0] = -1; int i = 0, j = -1; int len = s.length(); whil ...
分类:
其他好文 时间:
2020-12-01 12:22:41
阅读次数:
7
#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
##题面 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
//将圆弧看成一段段的直线段,每个单元时间为dt //每一段路径长为 v1dt 和 v2dt //对于v2来说,存在径向速度vx(向外) 和 切向速度vy(绕圆) (vx^2 + vy^2 = v2^2) //又v1/R = w(角速度)= vy/r (r是运动过程中离圆心的距离)r属于[0, R] ...
分类:
其他好文 时间:
2020-11-20 11:47:20
阅读次数:
4
题目链接 题意:给定一个字符串,求重复次数最多的连续重复子串 题目思路:先穷举长度L,然后求长度为L的子串最多能连续出现几次。首先连续出现1次是肯定可以的,所以这里只考虑至少2次的情况。假设在原字符串中连续出现2次,记这个子字符串为S,那么S肯定包括了字符r[0], r[L], r[L2],r[L3 ...
分类:
编程语言 时间:
2020-11-12 14:07:06
阅读次数:
10
题意 $T$组数据$(n,m)$ 令$f(n)=\sum\limits_{d|n}|\mu(d)|$ 求$\sum\limits_^m f(ni)$ \(T\le 10^4,n,m\le 10^7\) 做法 显然$f(n)$是积性函数 则$f(ni)=\frac{f(n)f(i)}{f((n,i)) ...
分类:
其他好文 时间:
2020-11-11 16:07:42
阅读次数:
5
#include<iostream> #include<cstring> #include<cmath> using namespace std; char map[8][8]; int n, m, t; int dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}}; bool ...
分类:
其他好文 时间:
2020-11-08 17:14:10
阅读次数:
17
#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
题意:给你四组长度为$n$序列,从每个序列中选一个数出来,使得四个数字之和等于$0$,问由多少种组成情况(仅于元素的所在位置有关). 题解:$n$最大可以取4000,直接暴力肯定是不行的,我们可以先对后两个数组$c$和$d$,枚举他们每个元素的和,用一个新数组$CD$记录,然后再去枚举$a$和$b$ ...
分类:
其他好文 时间:
2020-10-31 01:32:05
阅读次数:
17