链接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87813#problem/J Description Daniel has a string s, consisting of lowercase English letters and period signs (characters '.'). Let's define the operation of replacement as the following sequenc…
http://codeforces.com/contest/787/problem/D 题目大意:有n个点,三种有向边,这三种有向边一共加在一起有m个,然后起点是s,问,从s到所有点的最短路是多少? 第一种边:u->v w 表示节点u到v有连接一条有向边,权值为w 第二种边:u->[l,r] w 表示节点u到区间[l,r]连接一条有向边,权值为w 第三种边:[l,r]->u w 表示区间[l, r]所有的节点到u都有一条有向边,权值为w 思路: 我们知道,对于dijstra都是用pr…
Flipping Parentheses 题目连接: http://codeforces.com/gym/100803/attachments Description A string consisting only of parentheses '(' and ')' is called balanced if it is one of the following. • A string "()" is balanced. • Concatenation of two balance…