Vanilla_chan

永远可爱 永远善良

Problem

You are given sequences of length $N$, $A=(A_1,A_2,\ldots,A_N)$ and $B=(B_1,B_2,\ldots,B_N)$.

You are also given $Q$ queries to process in order.

There are three types of queries:

  • 1 l r x : Add $x$ to each of $Al, A{l+1}, \ldots, A_r$.
  • 2 l r x : Add $x$ to each of $Bl, B{l+1}, \ldots, B_r$.
  • 3 l r : Print the remainder of $\displaystyle\sum_{i=l}^r (A_i\times B_i)$ when divided by $998244353$.

阅读全文 »

Problem

For a positive integer $N$, let $V_N$ be the integer formed by concatenating $N$ exactly $N$ times.

More precisely, consider $N$ as a string, concatenate $N$ copies of it, and treat the result as an integer to get $V_N$.

For example, $V3=333$ and $V{10}=10101010101010101010$ .

Find the remainder when $V_N$ is divided by $998244353$.

阅读全文 »

Hexo博客Next主题更换cdn加速访问

有时候访问我的博客时,总是会出现cdn.jsdelivr.net无法访问或者访问速度过慢的情况。我的博客园使用的是BNDong/Cnblogs-Theme-SimpleMemory主题,也遇到的这样的情况。经过我的一番折腾之后,将js文件转移到了我自己的OSS中,并且又经过了我的一番折腾之后,设置好了跨域资源共享(CORS)策略,让我的博客访问的时候不会时好时坏了。

现在我搭建了Hexo博客,使用Next主题,其中也使用了很多jsdelivr的托管文件。有时候别人会出现访问慢、卡、进不去的情况。我打算也更换成我的OSS。

好在Next主题配置文件_config.yml中就有相关的配置。

阅读全文 »

Problem

当你使用polyfit函数进行多项式拟合之后,你希望计算决定系数或者相关系数看看拟合效果如何。聪明的你肯定觉得聪明的 Matlab 的polyfit函数的返回值中会有$R^2$或者$r$吧。你尝试disp了一下,发现有一个结构体$S$。再查一查帮助文档,发现误差估计结构体$S$中只有一个范德蒙德矩阵$R$、自由度$df$和残差的范数$normr$,并没有你想要的$R^2$或者$r$。

Solution

很遗憾,我们还是需要手动计算这两个系数。

阅读全文 »

Problem

For a non-negative integer $K$, we define a level-$K$ carpet as follows:

  • A level-$0$ carpet is a $1 \times 1$ grid consisting of a single black cell.
  • For $K>0$, a level-$K$ carpet is a $3^K \times 3^K$ grid. When this grid is divided into nine $3^{K-1} \times 3^{K-1}$ blocks:
    • The central block consists entirely of white cells.
    • The other eight blocks are level-$(K-1)$ carpets.

You are given a non-negative integer $N$. Print a level-$N$ carpet according to the specified format.

阅读全文 »

由于洛谷个人简介迟迟没有维护完毕,故在博客园同步一份


欢迎来看我的博客!

$\large My Blog$

阅读全文 »