摘要: You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. Each edge has an integer value assigned t 阅读全文
posted @ 2019-02-07 21:00 NKDEWSM 阅读(215) 评论(0) 推荐(0) 编辑
摘要: There are N (1 ≤ N ≤ 105) cities on land, and there are N - 1 wires connecting the cities. Therefore, each city can transmit electricity to all other 阅读全文
posted @ 2019-02-07 20:54 NKDEWSM 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 题目描述 这次小可可想解决的难题和中国象棋有关,在一个N行M列的棋盘上,让你放若干个炮(可以是0个),使得没有一个炮可以攻击到另一个炮,请问有多少种放置方法。大家肯定很清楚,在中国象棋中炮的行走方式是:一个炮攻击到另一个炮,当且仅当它们在同一行或同一列中,且它们之间恰好 有一个棋子。你也来和小可可一 阅读全文
posted @ 2019-02-07 11:37 NKDEWSM 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 打印严格上升子序列; 阅读全文
posted @ 2019-02-07 09:47 NKDEWSM 阅读(122) 评论(0) 推荐(0) 编辑
摘要: You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. We will ask you to perfrom some instructi 阅读全文
posted @ 2019-02-07 09:22 NKDEWSM 阅读(347) 评论(0) 推荐(0) 编辑