0%

How to use Django

  • install python

    1
    brew python
  • install pip

    1
    pip3 install pipenv
  • Create Django

    1
    pipenv install django==2.1

    This should create a virtual environment for you with Django install.

Read more »

写在前面

  • Mean of Array After Removing Some Elements
  • Coordinate With Maximum Network Quality
  • Number of Sets of K Non-Overlapping Line Segments
  • Fancy Sequence
    easy题主要考察浮点问题,审题可以很快做出。
    hard题没有很难,但是通过率不高,因为溢出问题。
Read more »

写在前面

可能之前在学高数的时候老师有讲过,但是最近学DSP的时候,哈佛毕业的老师又提到了,所以来记录一下。
起源是证明LTI系统的因果性(引理),LTI系统的稳定性(定理)。
顺便在整理几个常用的数学性质的英文说法。

Read more »

What would I do with the expected time each of the omelette tasks would require?

  • To obtain reliable/robust data to allow us to drive proceed design and then operations decisions, e/g/ scheduling, Capacity, control/monitoring, inventory related decisions.
Read more »

Kosaraju 算法

  • 为了找到SCC分支,首先对图G运行DFS,计算出各顶点完成搜索的时间f;
  • 然后计算图的逆图GT,对逆图也进行DFS搜索,但是这里搜索时顶点的访问次序不是按照顶点标号的大小,而是按照各顶点f值由大到小的顺序;
  • 逆图DFS所得到的森林即对应连通区域。
Read more »

写在前面

  • Maximum Nesting Depth of the Parentheses 字符串
  • Maximal Network Rank 图 brute force
  • Split Two Strings to Make Palindrome 回文字符 hash
  • Count Subtrees With Max Distance Between Cities
Read more »

动态规划

已知问题规模为n的前提A,求解一个未知解B。
此时,如果把问题规模降到0,即已知A0,可以得到A0->B。

  • 如果从A0添加一个元素,得到A1的变化过程,即A0->A1;进而有A1->2; A2->A3;……;Ai->Ai+1。这就是严格的归纳推理,也就是我们经常使用的数学归纳法
  • 对于Ai+1,只需要它的上一个状态Ai即可完成整个推理过程(而不需要更前序的状态)。我们将这个模型称为马尔可夫模型,对应的推理过程叫做“贪心法”

然而,Ai与Ai+1往往不是互为充要条件,随着i的增加,有价值的前提信息越来越少,我们无法仅仅通过上一个状态得到下一个状态,因此可以采用如下的方案:

  • {A1->A2}; {A1, A2->A3}; {A1,A2,A3->A4};……; {A1,A2,…,Ai}->Ai+1. 这种方式就是第二数学归纳法。
  • 对于Ai+1需要前面的所有前序状态才能完成推理过程。我们将这一模型称为高阶马尔科夫模型。对应的推理过程叫做“动态规划法”。
Read more »