Coding Wiki文档的应用
基本操作首先,可以新建一个页面
选中新建的页面,点击右上角的编辑。右边有个模板,可以选择项目模板/Wiki模板,然后确定。然后最可以往下写markdown格式的文档了。
markdown语法编辑界面右边有个问好图标
HashTag
只要打一个#号就会出现上图的HashTag,可以直接关联到其他文档,上传到文件网盘的文件以及需求等等。
历史对比点击图中的共xx个版本可以看到和历史版本文档的对比,每次编辑都会产生一个版本。绿色为新增,红色为删除,如果发现有不对的还能恢复到历史版本。
Crusaders Quest(模拟)
ZOJ - 3983
Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world, and the only hope for your kingdom is to save the Goddesses so that they can unleash their power to fight against the witch.In order to save the game world, you need to choose three heroes to fight for victory and use their skills wisely. Nine skill blocks of three different types (three blocks per type) will be presented at the bottom of the screen. If kkk (k≥1k \ge 1k≥1) ...
Cutting Sticks
UVA10003这是一道区间动态规划定义:$dp[i][j]$为第$i$个切割点到第$j$个切割点之间的木条的最小切割费用,$Point[i]$为第$i$个切割点的位置。初始化:
dp[i][i+1]=0因为相邻切割点之间没有切割点,不需要切割。
Point[0]=0\\Point[n+1]=L(木条长度)在头和尾也添加切割点,方便枚举转移方程:
dp[i][j]=min(dp[i][k]+dp[k][j])+Point[j]-Point[i](i
Divisors(约数的数目)
UVA294
题目要求指定范围内约数数目最多的数以及对应的约数数量。根据唯一分解定理,对于任意正整数$2\leq N$,有:
N=\sum\limits_{i=1}^{n}p_i^{a_i},p为素数那么根据乘法原理,约数的总数目为:
f(N)=\prod\limits_{i=1}^{n}(1+a^i)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include <iostream>#include <algorithm>#include <cmath>#include <vector>using namespace std;const int MAXN = 1000001;int main() { int T; cin >> T; int Left, Right; while (T--) { cin >> Left >> Right; int An ...
Flippy Sequence
ZOJ
DreamGrid has just found two binary sequences $s_1, s_2, \dots, s_n$ and $t_1, t_2, \dots, t_n$ ($s_i, t_i \in \{0, 1\}$ for all $1 \le i \le n$) from his virtual machine! He would like to perform the operation described below exactly twice, so that $s_i = t_i$ holds for all $1 \le i \le n$ after the two operations.The operation is: Select two integers $l$ and $r$ ($1 \le l \le r \le n$), change $s_i$ to $(1 - s_i)$ for all $l \le i \le r$.DreamGrid would like to know the number of ways to ...
Forgery
CodeForces - 1059B
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudent Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a passing grade on this subject. Obviously, it is impossible to do this by legal means, but Andrey doesn’t give up. Having obtained an empty certificate from a local hospital, he is going to use his knowledge of local doctor’s handwriting to make a counterfeit certific ...
Game of Sum
题目链接
题意:有一个长度为n的整数序列,两个人$A$和$B$轮流取数,$A$先取。一个玩家每次只能从左端或者右端取任意数量连续的数,但不能两边同时取。当所有的数都被取走时游戏结束,然后统计每个人取走的数的和,作为各自的得分。两个人采取的策略都是让自己得分尽可能高,并且两个人都很机智,求$A$的得分$-B$的得分后的结果。显然,最后整数序列的所有元素必定被$A$或$B$取得。定义:$dp[i][j]$为第i到j个数,先手能取得的最大得分,$Sum(i,j)$表示$i$到$j$的数的和。因为彼此都很聪明,所以$dp[i][j]=Sum(i,j)-$后手所能取得的分数的最大值。而先手能从左端或右端取任意数量的数,因此:转移方程:$dp[i][j]=Sum(i,j)-min(dp[i+1][j],dp[i+2][j],\cdots dp[j][j],dp[i][j-1],dp[i][j-2],\cdots dp[i][i])$(当先手取了第$i$个数,此时的后手得分就是$dp[i+1][j]$,其他以此类推)12345678910111213141516171819202122232425 ...
Glass Beads
UVA719将循环串$S$展开成两倍大小:$S+S$,这样线性处理就可以处理所有循环的情况了。对$S+S$建立一个后缀自动机,让后从初始状态开始走,每次选择字典序最小的道路,走$N$步就得到一个字典序最小的原串了。假设最后走到$p$,那么此时首字符下标即为$len(p)-N+1$,即从首字符的位置走了$N$步到$p$。AC代码:1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192#include<iostream>#include<string>#include<cstring>#include<algorithm>#include<vector>#include<cmath>#include<map>usin ...
Jin Ge Jin Qu hao
UVA12563定义:dp[i][j]为考虑前i首歌并且总时长为j时最多能唱的歌曲数,Song[i]表示第i首歌的时长。转移方程:
dp[i][j]=max(dp[i-1][j],dp[i-1][j-Song[i]]+1)经典的01背包。题目特殊要求在注释中说明。12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include<iostream>#include<algorithm>#include<cstring>#include<stack>#include<vector>using namespace std;int n, T;int Song[51], dp[51][10001];void Input() { cin >> n >> T; for (int i = 1; i <= n; ++i) { cin >> Song[i] ...
K-th occurrence (后缀自动机上合并权值线段树+树上倍增)
You are given a string $S$ consisting of only lowercase english letters and some queries.For each query $(l,r,k)$, please output the starting position of the k-th occurence of the substring $S_lS_{l+1}\cdots S_r$ in $S$.InputThe first line contains an integer $T(1≤T≤20)$, denoting the number of test cases.The first line of each test case contains two integer $N(1≤N≤10^5),Q(1≤Q≤10^5)$, denoting the length of $S$ and the number of queries.The second line of each test case contains a string $S(|S| ...