# GCJ 2019 Round3 B

## Problem B. Pancake Pyramid

#### Analysis

– M[l][r] 表示 [l, r] 区间最大的数的位置。
– L[l][r] 表示把 [l, r] 这个区间处理成递增序列的最小代价。
– R[l][r] 表示把 [l, r] 这个区间处理成递减序列的最小代价。

\$\$\Sigma_{i=1}^n Dl[i] * Sr[i] + Dr[i] * Sl[i]\$\$

sl 需要被统计 sp – s.top() 次。最后加上这个区间本身的代价 Sl[sp]。

``````stack<int> s; s.push(0); REP_1(i, n) {
Sl[i] = 0;
while (h[i] > h[s.top()]) {
int sp = s.top(); s.pop();
Int sl = Int(h[sp]) * (i-sp-1) - (hh[i-1]-hh[sp]);
Sl[i] += sl * (sp - s.top()) + Sl[sp];
}
Dl[i] = i - s.top();
s.push(i);
}
``````

# TCO 2019 2B

Beijing Onsite 的热身，不过居然晋级了，下一场还是好好打（受虐）一下吧。。。

### 1000 SlightlyBigger

#### Brief Description

Alice 和 Bob 报数，从 1 到 oo，目标是比对方报的数只大一点。
– 如果恰好差小于等于 maxDiff，那么大的一方获胜，并得到 ifNear 分。
– 否则，小的一方获胜，并得到 ifFar 分。

(ifNear < ifFar <= 2×ifNear)

# 比特币分叉史 (WIP)

https://hackmd.io/@E-5gxTGiSByBOKpvsaKa_g/SyGtjw_qN/edit

## 立场与偏见

This perception demonstration also shows how powerfully our paradigms affect the way we interact with other people. As clearly and objectively as we think we see things, we begin to realize that others see them differently from their own apparently equally clear and objective point of view. “Where we stand depends on where we sit.”
—— The 7 habits of highly effective people: restoring the character ethic, Stephen R. Covey

## 比特币的迭代与治理

Social progress means a checking of the cosmic process at every step and the substitution for it of another, which may be called the ethical process; the end of which is not the survival of those who may happen to be the fittest, in respect of the whole of the conditions which obtain, but of those who are ethically the best.
—— Evolution and Ethics, Thomas Henry Huxley

BIPs 源自 Python 改进提案（PIPs）。最早由 Amir Taaki 2011 在 BIP 0001 中提出并在 BIP 0002 中由 Luke Dash Jr. 扩展并改进。BIP 的目标是给所有人参与到改进比特币协议，并在实际动手编写代码之前审查提案的安全性，达成初步的共识（Rough Consensus）。这一协作的标准也被推广到了其他区块链项目之中，例如以太坊改进提案（EIPs）。

Bitcoin Governance: What are BIPs and how do they work? | 中译，比特币的治理：什么是比特币改进协议以及它们如何工作

Bitcoin 的权力皇冠 —— CORE

## 扩容路线之争

Consensus is the path, not the destination.
—— On Consensus and Humming in the IETF

If you don’t believe me or don’t get it, I don’t have time to try to convince you, sorry.

## 比特币的分叉

### Bitcoin Core 与 Bitcoin Cash 分叉

The current system where every user is a network node is not the intended configuration for large scale. That would be like every Usenet user runs their own NNTP server. The design supports letting users just be users. The more burden it is to run a node, the fewer nodes there will be. Those few nodes will be big server farms. The rest will be client nodes that only do transactions and don’t generate.

UASF 只是这次分叉的导火索，实际上围绕着扩容的争议，在比特币社区的内部演化成了长达四年的争吵、敌视，才最终导致社区一分为二。