随笔分类 -  算法-差分

摘要:题目 The cows are hard at work trying to invent interesting new games to play. One of their current endeavors involves a set of \(N\) intervals (\(1\le 阅读全文
posted @ 2021-12-21 18:35 zhangtingxi 阅读(577) 评论(0) 推荐(0)
摘要:题目链接 题目 Define the distance between two strings of the same length as the numbers of the positions where the characters differ in these two strings. I 阅读全文
posted @ 2021-12-08 19:01 zhangtingxi 阅读(107) 评论(0) 推荐(0)
摘要:题目链接 我要是在noip前做这道题就好了。 这道题的本质就是noip2021方差中的一个性质,对于每个数进行修改,就是把它左右的差进行交换。 注意的是首项一定要一样。 Code // Problem: CF1110E Magic Stones // Contest: Luogu // URL: h 阅读全文
posted @ 2021-12-03 21:06 zhangtingxi 阅读(55) 评论(0) 推荐(0)
摘要:题目链接 Part A 式子化简 首先题目要求的式子就是 \(n^2\) 乘上 \(\frac{1}{n}\sum_{i=1}^n(a_i-\bar a)^2\),其中 \(\bar a=\frac{1}{n}\sum_{i=1}^n a_i\)。 我们把这三合在一起也就是: \(n^2\times 阅读全文
posted @ 2021-11-24 17:48 zhangtingxi 阅读(854) 评论(1) 推荐(0)