Fork me on GitHub
Sky of war

Beyond the spectacle of the sky


  • 首页

  • 关于

  • 标签60

  • 分类7

  • 归档63

  • Game2048

  • 搜索

Schur不等式的学习感想

发表于 2018-08-24 | 更新于 2018-09-15 | 分类于 讲解

Schur不等式的学习感想

什么是Schur不等式?

设$x,y,z\ge 0,r \in \mathbb {R}$,则

$x^r(x-y)(x-z)+y^r(y-x)(y-z)+z^r(z-y)(z-x)\ge 0$

当$r=1$时,Schur不等式有几种变形:

  • $x^3+y^3+z^3 \geq (x^2y+xy^2+x^2z+xz^2+y^2z+yz^2)-3xyz$
  • $(x+y+z)^3 \geq 4(xy+yz+zx)(x+y+z)-9xyz$
  • $xyz \geq (x+y-z)(y+z-x)(z+x-y)$

差不多就是这样(个人感觉变形用的炒鸡多…)

下面看唯一一道自己做出来的题:(窝太菜了学了这个不等式之后只会做一道)

阅读全文 »

神奇的Mathematica的三角函数

发表于 2018-08-21 | 分类于 无聊

神奇的Mathematica的三角函数

某天……

麻麻我要玩三角函数!!

神奇的事情发生了…

什么鬼?居然不给lz根式…窝生气了,强制让你写根式……

然后这踏马答案就对了??

我…………..

一怒之下,请教了@wuyudi神犇,然后…

涨姿势了。。。

由一道神奇的题目引发的思考

发表于 2018-08-19 | 更新于 2018-08-27 | 分类于 讲解

由一道神奇的题目引发的思考

题目

计算$\displaystyle \sum_\limits{i=1}^\limits{k}i*2^i$

解答

观察恒等式:$\displaystyle \sum_\limits{i=0}^\limits{k} r^i=\dfrac{1-r^{k+1}}{1-r} $

对两边形式地求导,得$\displaystyle\dfrac{\rm d}{ {\rm d} r}\sum_\limits{i=0}^\limits{k} r^i=\sum_\limits{i=0}^\limits{k} i*r^{i-1}=\dfrac{\rm d}{ {\rm d} r}\dfrac{1-r^{k+1}}{1-r}=-(k+1)\dfrac{r^k}{1-r}+\dfrac{1-r^{k+1}}{(1-r)^2}$

两边同时乘$r$,令$r=2$,得

$\displaystyle \sum_{i=0}^{k} i \cdot 2^{i}=-2(k+1)2^k/(-1)+2(1-2^{k+1})/(-1)^2=(k+1)2^{k+1}+2-2 \cdot 2^{k+1} $

化简得$(k-1)2^{k+1}+2$

阅读全文 »

二项式系数及其反演

发表于 2018-08-19 | 分类于 总结

二项式系数及其反演

二项式系数&二项式定理

了解标题之前,我们先要花一些时间复习一下普通的二项式系数:

$\left( \begin{array}{c}n\\k\end{array} \right) = \dfrac{\Gamma (n + 1)}{\Gamma (k + 1)\Gamma (n - k + 1)}$

我们对它研究得非常多,例如经典的二项式定理:

${(x + y)^n} = \left( \begin{array}{c}n\\0\end{array} \right){x^n}{y^0} + \left( \begin{array}{c}n\\1\end{array} \right){x^{n - 1}}{y^1} + \left( \begin{array}{c}n\\2\end{array} \right){x^{n - 2}}{y^2} + \cdots + \left( \begin{array}{c}n\\n - 1\end{array} \right){x^1}{y^{n - 1}} + \left( \begin{array}{c}n\\n\end{array} \right){x^0}{y^n}$

写成和式的形式,也就是

${(x + y)^n} = \sum\limits_{k = 0}^n {\left( \begin{array}{c}n\\k\end{array} \right)} {x^{n - k}}{y^k} = \sum\limits_{k = 0}^n {\left( \begin{array}{c}n\\k\end{array} \right)} {x^k}{y^{n - k}}$

证明挺简单的,想必大家都会,这里不会的可以来谈人生了QwQ

阅读全文 »

莫比乌斯反演

发表于 2018-08-18 | 更新于 2018-08-19 | 分类于 总结

莫比乌斯反演

前言

  • 不要把莫比乌斯反演和莫比乌斯变换当成一回事

莫比乌斯变换的范围要广的多,别一眼看上去:哇,傻逼分式线性函数嘛,so easy!然后后面你就不懂了

详细看维基百科:Möbius transformation

还有这一篇深度好文 Moebius.pdf

言归正传,回到topic。今天主要从数学角度去研究。

定义

如果对数论函数$f(n)$和$g(n)$,有以下关系式:

${\displaystyle g(n)=\sum _{d\,\mid \,n}f(d)\quad {\text{对于每个整数}}n\geq 1} $

那么有

${\displaystyle f(n)=\sum _{d\,\mid \,n}\mu (d)g\left({\frac {n}{d}}\right)\quad {\text{对于每个整数}}n\geq 1}$

其中$\mu$是莫比乌斯函数。实际上,原函数$f(n)$通过使用反演公式给定唯一的$g(n)$。$f$和$g$被称为对方的$莫比乌斯变换$

如果f和g是从正整数到某个阿贝尔群的函数(被看作ℤ - 模块),则该公式也是正确的。

用Dirichlet卷积描述,第一个公式可以写成${\displaystyle g = f * {\mathit {1}}}$

其中星号表示Dirichlet卷积,$\mathit{1}$是常数函数$\mathit{1}(n)=1$。然后将第二个公式写成$f = \mu * g$

因为卷乘是(可交换的)和关联的,并且$\mathit{1} * \mu=\varepsilon$,而$\varepsilon$是Dirichlet卷积中的单位函数

所以我们有:

仅仅是数论函数?我们来看看它的一般形式:

阅读全文 »

疯狂的馒头---并查集的妙用

发表于 2018-05-16 | 更新于 2018-08-29 | 分类于 题解

疯狂的馒头

Problem

Description

CQF十分喜欢吃馒头,兴奋之下他一下子买了N 个馒头请所有认识他的人吃。

但是CQF不喜欢白色,喜欢红色、黄色、绿色等鲜艳的颜色。于是他把所有白色的馒头排成一列。然后进行M 次染色操作。每个染色操作都是用一个神奇的刷子把连续的多个馒头染成特定的某种颜色。一个馒头最终的颜色是最后一次染它的颜色。如果一个馒头没有被染过色,那么它的颜色就是白色。

现在CQF已经定好了染色计划:在第i次染色操作中,把第$(i × p + q)\ mod\ N + 1$个馒头和第$(i × q + p)\ mod\ N+1$个馒头之间的馒头染成颜色i,其中p, q是特定的两个正整数。他想立即知道最后每个馒头的颜色。你能帮他吗?

阅读全文 »

天鹅会面 [BFS+SPFA]

发表于 2018-05-16 | 更新于 2018-08-29 | 分类于 题解

天鹅会面 [BFS+SPFA]

Problem

两头白天鹅生活在一个部分湖面结了冰的湖泊中,湖面的形状为一个长方形,并且被分割成R行C列的小方格,某些方格中结了冰,这样的方格称之为冰格,其余的方格称之为水格。

冬天过去了,湖面上的冰渐渐开始溶解了,每一天与水相邻的冰格就将消融而转化为水格。所谓两个方格相邻是指它们在水平或垂直方向有公共边,两个呈对角的方格是不相邻的。

白天鹅只能在水中沿水平或垂直方向游动,写一个程序判断多少天后两只白天鹅才能够相会。

阅读全文 »

『POJ 2229 』 Sumsets

发表于 2018-05-15 | 更新于 2018-09-15 | 分类于 题解

Problem

传送门

Description

Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers that sum to 7:

1) 1+1+1+1+1+1+1

2) 1+1+1+1+1+2

3) 1+1+1+2+2

4) 1+1+1+4

5) 1+2+2+2

6) 1+2+4

Help FJ count all possible representations for a given integer N (1 <= N <= 1,000,000).

阅读全文 »

『POJ 2376 』 Cleaning Shifts

发表于 2018-05-15 | 更新于 2018-09-15 | 分类于 题解

Problem

Description

Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T shifts (1 <= T <= 1,000,000), the first being shift 1 and the last being shift T.
Each cow is only available at some interval of times during the day for work on cleaning. Any cow that is selected for cleaning duty will work for the entirety of her interval.
Your job is to help Farmer John assign some cows to shifts so that (i) every shift has at least one cow assigned to it, and (ii) as few cows as possible are involved in cleaning. If it is not possible to assign a cow to each shift, print -1.

阅读全文 »

『Codeforces 825B』Five-In-a-Row

发表于 2018-05-06 | 更新于 2018-09-15 | 分类于 题解

题目链接: 点我

Problem

B. Five-In-a-Row
time limit per test :1 second
memory limit per test :256 megabytes
Description
Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob puts noughts.

In current match they have made some turns and now it’s Alice’s turn. She wonders if she can put cross in such empty cell that she wins immediately.

Alice wins if some crosses in the field form line of length not smaller than 5. This line can be horizontal, vertical and diagonal.

阅读全文 »
1…345…7
Sky of war

Sky of war

Why I gotta fly? The boundlessness precipitates me to do so.

63 日志
7 分类
60 标签
RSS
GitHub E-Mail Google Twitter FB Page YouTube
Links
  • 几何大师wuyudi
  • OI巨佬ExtendedAsh
  • 马上要碾压我的cz
  • galgame的神犇Highwind
  • Waterloo的CS大佬Jude
  • yww%%%
0%
© 2018 Sky of war
博客全站共46.3k字