上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 64 下一页
摘要: 股票买卖 V 给定一个长度为 $N$ 的数组,数组中的第 $i$ 个数字表示一个给定股票在第 $i$ 天的价格。 设计一个算法计算出最大利润。在满足以下约束条件下,你可以尽可能地完成更多的交易(多次买卖一支股票): 你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。 卖出股票后,你无法在 阅读全文
posted @ 2023-05-27 17:46 onlyblues 阅读(53) 评论(0) 推荐(0)
摘要: B. Complete The Graph ZS the Coder has drawn an undirected graph of $n$ vertices numbered from $0$ to $n - 1$ and $m$ edges between them. Each edge of 阅读全文
posted @ 2023-05-25 14:46 onlyblues 阅读(70) 评论(0) 推荐(0)
摘要: F. Ira and Flamenco Ira loves Spanish flamenco dance very much. She decided to start her own dance studio and found $n$ students, $i$th of whom has le 阅读全文
posted @ 2023-05-22 09:07 onlyblues 阅读(136) 评论(0) 推荐(1)
摘要: G. Hits Different In a carnival game, there is a huge pyramid of cans with $2023$ rows, numbered in a regular pattern as shown. If can $9^2$ is hit in 阅读全文
posted @ 2023-05-08 14:48 onlyblues 阅读(111) 评论(0) 推荐(0)
摘要: D. Fish Graph You are given a simple undirected graph with $n$ nodes and $m$ edges. Note that the graph is not necessarily connected. The nodes are la 阅读全文
posted @ 2023-05-06 20:20 onlyblues 阅读(174) 评论(0) 推荐(0)
摘要: D. Running Miles There is a street with $n$ sights, with sight number $i$ being $i$ miles from the beginning of the street. Sight number $i$ has beaut 阅读全文
posted @ 2023-05-06 09:05 onlyblues 阅读(186) 评论(0) 推荐(1)
摘要: 砍树 给定一棵由 $n$ 个结点组成的树以及 $m$ 个不重复的无序数对 $(a_1,b_1),(a_2,b_2), \ldots ,(a_m,b_m)$,其中 $a_i$ 互不相同,$b_i$ 互不相同,$a_i \ne b_j \ (1 \leq i,j \leq m)$。 小明想知道是否能够选 阅读全文
posted @ 2023-04-29 08:55 onlyblues 阅读(98) 评论(0) 推荐(0)
摘要: D. Unique Palindromes A palindrome is a string that reads the same backwards as forwards. For example, the string abcba is palindrome, while the strin 阅读全文
posted @ 2023-04-28 19:39 onlyblues 阅读(150) 评论(0) 推荐(2)
摘要: 闇の連鎖 传说中的暗之连锁被人们称为 Dark。 Dark 是人类内心的黑暗的产物,古今中外的勇者们都试图打倒它。 经过研究,你发现 Dark 呈现无向图的结构,图中有 $N$ 个节点和两类边,一类边被称为主要边,而另一类被称为附加边。 Dark 有 $N–1$ 条主要边,并且 Dark 的任意两个 阅读全文
posted @ 2023-04-27 22:18 onlyblues 阅读(70) 评论(0) 推荐(0)
摘要: D. Super-Permutation A permutation is a sequence $n$ integers, where each integer from $1$ to $n$ appears exactly once. For example, $[1]$, $[3,5,2,1, 阅读全文
posted @ 2023-04-26 19:38 onlyblues 阅读(229) 评论(0) 推荐(1)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 64 下一页
Web Analytics