摘要: 翰翰和达达饲养了N只小猫,这天,小猫们要去爬山。 经历了千辛万苦,小猫们终于爬上了山顶,但是疲倦的它们再也不想徒步走下山了(呜咕>_<)。 翰翰和达达只好花钱让它们坐索道下山。 索道上的缆车最大承重量为W,而N只小猫的重量分别是C1、C2……CN. 当然,每辆缆车上的小猫的重量之和不能超过W。 每租 阅读全文
posted @ 2019-12-08 11:10 Spring-Onion 阅读(175) 评论(0) 推荐(0) 编辑
摘要: csdn地址:https://blog.csdn.net/qq_42505741 两边会尽力同时更新的 阅读全文
posted @ 2019-10-13 16:40 Spring-Onion 阅读(112) 评论(0) 推荐(0) 编辑
摘要: E. Tourism time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output E. Tourism time limit per tes 阅读全文
posted @ 2019-09-26 22:19 Spring-Onion 阅读(269) 评论(0) 推荐(0) 编辑
摘要: E. Middle-Out time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output E. Middle-Out time limit p 阅读全文
posted @ 2019-09-26 18:01 Spring-Onion 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 题目: In Complexity theory, some functions are nearly O(1)O(1), but it is greater then O(1)O(1). For example, the complexity of a typical disjoint set i 阅读全文
posted @ 2019-09-01 22:43 Spring-Onion 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 题目: You may not know this but it's a fact that Xinghai Square is Asia's largest city square. It is located in Dalian and, of course, a landmark of the 阅读全文
posted @ 2019-08-30 13:23 Spring-Onion 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Amy asks Mr. B problem E. Please help Mr. B to solve the following problem. There are n people, who don't know each other at the beginning. There 阅读全文
posted @ 2019-08-15 21:42 Spring-Onion 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Amy asks Mr. B problem B. Please help Mr. B to solve the following problem. Let p = 1000000007. Given two integers b and c, please find two integ 阅读全文
posted @ 2019-08-15 20:50 Spring-Onion 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 题目: 给定长度为N的序列A,构造一个长度为N的序列B,满足: 1、B非严格单调,即B1≤B2≤…≤BN或B1≥B2≥…≥BN。2、最小化 S=∑Ni=1|Ai−Bi|。 只需要求出这个最小值S。 输入格式 第一行包含一个整数N。 接下来N行,每行包含一个整数Ai。 输出格式 输出一个整数,表示最小 阅读全文
posted @ 2019-08-15 00:02 Spring-Onion 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 一.最长上升子序列(LIS) LIS(Longest Increasing Subsequence)最长上升子序列 一个数的序列bi,当b1 < b2 < … < bS的时候,我们称这个序列是上升的。 对于给定的一个序列(a1, a2, …, aN),我们可以得到一些上升的子序列(ai1, ai2, 阅读全文
posted @ 2019-08-14 23:26 Spring-Onion 阅读(204) 评论(0) 推荐(0) 编辑