思维题
文章平均质量分 75
STILLxjy
不要让任何人打乱你生活的节奏
展开
-
(HDU 5744)Keep On Movin <回文数,思维水题> 2016 Multi-University Training Contest 2
Keep On Movin Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1040 Accepted Submission(s): 733Problem Description Professor Zhang has kind原创 2017-01-09 10:46:26 · 485 阅读 · 0 评论 -
(LeetCode 50) Pow(x, n) [递归 & 非递归 & 对非指数的处理]
50. Pow(x, n)实现 pow(x, n) ,即计算 x 的 n 次幂函数。示例 1:输入: 2.00000, 10输出: 1024.00000示例 2:输入: 2.10000, 3输出: 9.26100示例 3:输入: 2.00000, -2输出: 0.25000解释: 2^-2 = (1/2)^2 = 1/4 = 0.25说明:-100.0 &lt; x &l...原创 2018-10-08 00:01:20 · 572 阅读 · 0 评论 -
(LeetCode 42)接雨水 [思维题]
42.接雨水 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下,可以接 6 个单位的雨水(蓝色部分表示雨水)。 感谢 Marcos 贡献此图。示例: 输入: [0,1,0,2,1,0,1,3,2,1,2,1] 输出: 6分析: (我们...原创 2018-09-09 23:47:09 · 919 阅读 · 0 评论 -
(Coderforces 1015D)D. Walking Between Houses 思维+贪心
题目链接: D. Walking Between Houses 题意: 现在有n个房子排成一列,编号为1~n,起初你在第1个房子里,现在你要进行k次移动,每次移动一都可以从一个房子i移动到另外一个其他的房子j里(i != j),移动的距离为|j - i|。问你进过k次移动后,移动的总和可以刚好是s吗?若可以则输出YES并依次输出每次到达的房子的编号,否则输出NO。分析: 每次至少移动一...原创 2018-08-02 19:19:10 · 643 阅读 · 0 评论 -
(Coderforces 1013B)B.And 贪心 + 思维
B. And time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputThere is an array with n elements a1, a2, …, an and the number x.In one operation...原创 2018-07-31 17:08:01 · 475 阅读 · 0 评论 -
(Codeforces 873B)B. Balanced Substring [前缀和]+思维
B. Balanced Substring time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given a string s consisting only of characters 0 and 1. A sub原创 2017-10-17 10:44:33 · 505 阅读 · 0 评论 -
(Coderforces 875A)A. Classroom Watch 暴力 + 思维
A. Classroom Watchtime limit per test: 1 secondmemory limit per test: 512 megabytesinput: standard inputoutput: standard outputEighth-grader Vova is on duty today in the class. After classes, he we原创 2017-10-17 21:59:51 · 830 阅读 · 0 评论 -
(HDU 6029 女生专场)Graph Theory 思维题
Graph Theory Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 346 Accepted Submission(s): 167Problem Description Little Q loves playing w原创 2017-05-19 09:25:24 · 823 阅读 · 0 评论 -
(2016年中国大学生程序设计竞赛(杭州)) HDU 5938 Four Operations 思维题 + 枚举
(HDU 5938)Four OperationsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1151 Accepted Submission(s): 338Problem Description Little Ruins i原创 2017-04-03 18:06:09 · 684 阅读 · 0 评论 -
(CF 792E Colored Balls) 思维题 贪心
题目链接: http://codeforces.com/problemset/problem/792/EE. Colored Ballstime limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputThere are n boxes wi原创 2017-04-03 13:13:38 · 1707 阅读 · 0 评论 -
(HDU 5783)Divide the Sequence <思维水题> 多校训练5
Divide the Sequence Problem Description Alice has a sequence A, She wants to split A into as much as possible continuous subsequences, satisfying that for each subsequence, every its prefix sum is no原创 2017-01-17 21:02:43 · 446 阅读 · 0 评论 -
(HDU 5773)The All-purpose Zero <最长上升子序列 + 思维题> 多校训练4
The All-purpose Zero Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1950 Accepted Submission(s): 920Problem Description ?? gets an sequen原创 2017-01-15 12:57:33 · 565 阅读 · 0 评论 -
(HDU 5742) It's All In The Mind <思维水题> 2016 Multi-University Training Contest 2
It’s All In The Mind Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1608 Accepted Submission(s): 749Problem Description Professor Zhang h原创 2017-01-09 11:41:59 · 531 阅读 · 0 评论 -
(LeetCode 73)矩阵置零 [图文详解 + 常数空间复杂度:转换思维,内部指定]
73. 矩阵置零给定一个 m x n 的矩阵,如果一个元素为 0,则将其所在行和列的所有元素都设为 0。请使用原地算法。示例 1:输入:[[1,1,1],[1,0,1],[1,1,1]]输出:[[1,0,1],[0,0,0],[1,0,1]]示例 2:输入:[[0,1,2,0],[3,4,5,2],[1,3,1,5]]输出:[[0,0,0,0],[...原创 2018-10-27 10:49:29 · 908 阅读 · 0 评论