这里是正文。
这个文章专门用来测试博客的功能。博客的图片都放在第三方图床里,如果挂了可与我联系。
行间距和引用
这是 dropsong’s 的第一篇文章。 这是一句话。这是很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的一句话,长到这句话显示的时候要换行了。
这是 markdown 空出一行的一句话。
这里有一个引用。
这是一行文字。
特性
- 支持 Markdown 写作
- 支持代码高亮
- 支持 LaTeX 公式
- 支持文章加密
代码示例
function greet(name: string): string {
return `Hello, ${name}!`;
}
console.log(greet('world'));
#include <bits/stdc++.h>
#define MAXN 500015
#define MAXM MAXN-1
using namespace std;
int n,max0,d,tot,x,y,tempu,tempv;
int size[MAXN],head[MAXN],dep[MAXN];
int fa[MAXN<<1][20];
string s = "this is a very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong str.";
struct node{
int u,v,next;
}edge[MAXM<<1];
inline void addedge(int x,int y)
{
edge[++tot].u=x;
edge[tot].v=y;
edge[tot].next=head[x];
head[x]=tot;
}
inline void input()
{
scanf("%d",&n);
max0=(int)(log(n)/log(2))+3;
for(int i=1;i<n;i++)
{
scanf("%d%d",&x,&y);
addedge(x,y);addedge(y,x);
}
}
int lcainit(int x)
{
for(int i=1;i<=max0;i++)
if(fa[x][i-1]) fa[x][i]=fa[fa[x][i-1]][i-1];
else break;
for(int i=head[x];i;i=edge[i].next)
{
int y=edge[i].v;
if(y!=fa[x][0])
{
fa[y][0]=x;dep[y]=dep[x]+1;
size[x]+=lcainit(y);
}
}
return size[x];
}
inline int LCA(int u,int v)
{
if(dep[u]<dep[v])swap(u,v);
int delta=dep[u]-dep[v];
for(int x=0;x<=max0;x++)
if((1<<x)&delta)u=fa[u][x];
if(u==v)return u;
for(int x=max0;x>=0;x--)
if(fa[u][x]!=fa[v][x])
{
u=fa[u][x];
v=fa[v][x];
}
tempu=u; tempv=v;
return fa[u][0];
}
int main()
{
for(int i=0;i<MAXN;i++) size[i]=1;
input();
lcainit(1);
int m; cin>>m;
while(m--)
{
scanf("%d%d",&x,&y);
if(x==y){printf("%d\n",n);continue;}
int lca=LCA(x,y);
if(dep[x]<dep[y])swap(x,y);
d=dep[x]+dep[y]-(dep[lca]<<1);
if(d&1) {printf("0\n");continue;}
if(dep[x]==dep[y])
{
int ans=n-size[tempu]-size[tempv];
printf("%d\n",ans); continue;
}
int delta=d>>1;
int midson,mid;
for(int i=max0;i>=0;i--)
{
if((1<<i)&(delta-1))
x=fa[x][i],delta-=(1<<i);
if(delta==1)
midson=x,mid=fa[x][0];
}
int ans=size[mid]-size[midson];
printf("%d\n",ans);
}
return 0;
}
数学公式
本节的数学公式只是无意义的堆砌,用来测试其渲染是否正常。
$$
E = mc^2
$$
$$
\begin{pmatrix}
f(n) \\
f(n-1) \\
f(n-2) \\
\vdots \\
f(n-k+1)
\end{pmatrix} =
\begin{pmatrix}
1 & 1 & 1 & \cdots & 1 \\
1 & 0 & 0 & \cdots & 0 \\
0 & 1 & 0 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & \cdots & 1 & 0
\end{pmatrix}
\begin{pmatrix}
f(n-1) \\
f(n-2) \\
f(n-3) \\
\vdots \\
f(n-k)
\end{pmatrix}
$$
$$
\frac{\rm d} { {\rm d}x}\int_{g(x)}^{h(x)}f(t){\rm d}t=f[h(x)]h'(x)-f[g(x)]g'(x)
$$
测试 $\Phi(x)=\int_{a}^{x} f(x)\, {\rm d}x$ 测试
令 $\begin{cases} x= \sqrt{\frac{2}{3}} a \mathrm{cos}t \\ y+\frac{x}{2} = \frac{1}{\sqrt{2}}a \mathrm{sin}t \end{cases}$,则 $\begin{cases} x= \sqrt{\frac{2}{3}} a \mathrm{cos}t \\ y = \frac{1}{\sqrt{2}}a \mathrm{sin}t - \frac{1}{\sqrt{6}}a \mathrm{cos}t \end{cases}$,从而
$$
\begin{aligned}
\int_L x^2 \mathrm{d}s & = \frac{2a^2}{3} \int_0^{2 \pi} \mathrm{cos}^2t \mathrm{d}t \\
& = \frac{a^2}{3} \int_0^{2 \pi} (1-\mathrm{cos}2t) \mathrm{d}t \\
& = \frac{a^2}{3} (t - \frac{1}{2} \mathrm{sin}2t)|_0^{2 \pi} = \frac{2 \pi a^3}{3} \\
\end{aligned}
$$
表格示例
| 特性 | 状态 |
|---|---|
| Markdown | ✅ |
| 代码高亮 | ✅ |
| LaTeX | ✅ |
局部加密
这是普通可见的内容。
下面加密块的密码是“block123”,可解密查看效果。
加密内容
这里是一行文字。
多媒体测试
这是一行文字。
下面展示一个 pdf:
下面展示一个图片:

正文结束。