笔记
文章平均质量分 68
y2001tm
一个什么都不会的科研小白,慢慢学习ing
展开
-
1044 Shopping in Mars(另外做法)
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position ...原创 2020-02-11 13:44:44 · 158 阅读 · 0 评论 -
PTA 1067(另外做法)
Given any permutation of the numbers {0, 1, 2,…, N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2...原创 2020-02-11 13:40:20 · 222 阅读 · 0 评论 -
1013 Battle Over Cities
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we nee...原创 2020-01-20 11:26:34 · 116 阅读 · 0 评论 -
Leetcode每日一题——1585
我们可以选中一个连续的字符串,对其进行升序操作。也就是说,我们可以选择任意一段区间进行排序,我们可以分解成若干个长度为2的子区间的操作之和。也就是说,我们每次可以选择一个相邻的逆序对进行交换,问t能否由s这样转而来。后面就简单了,对于每个字符,统计前面比他小的数less和前面比他大的数greater,less上s要更小,greater上t要更小一点。原创 2023-06-18 00:00:18 · 46 阅读 · 1 评论 -
1004 Counting Leaves
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts ...原创 2020-01-20 13:21:25 · 168 阅读 · 2 评论 -
1017 Queueing at Bank
Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow li...原创 2020-01-20 10:09:17 · 127 阅读 · 0 评论 -
1003 Emergency
**1003 Emergency加权最短路径**As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue ...原创 2020-01-20 09:59:34 · 182 阅读 · 3 评论