随笔分类 -  Implementation

摘要:这题是2016 CCPC 东北四省赛的B题, 其实很简单. 现场想到的就是正解, 只是在合并两个并查集这个问题上没想清楚. 做法 并查集合并 ~~+ 归并~~ 1. 对每个节点 u, 将 u 到根的那些边添到一个初始为空的并查集中, 得到的并查集记作 au. 2. 询问相当于将 k 阅读全文
posted @ 2016-10-17 22:02 Pat 阅读(463) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 20000MS Memory Limit: 65536K Total Submissions: 1165 Accepted: 110 Case Time Limit: 5000MS Description May is a lovely girl. Due to her fi 阅读全文
posted @ 2016-07-03 00:21 Pat 阅读(440) 评论(0) 推荐(0) 编辑
摘要:(在队友怂恿下写了LeetCode上的一个水题) 传送门 题意 Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" 阅读全文
posted @ 2016-06-17 20:45 Pat 阅读(236) 评论(0) 推荐(0) 编辑
摘要:传送门 A. Ariel time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output King Triton really likes wa 阅读全文
posted @ 2016-06-06 23:32 Pat 阅读(310) 评论(0) 推荐(1) 编辑
摘要:传送门 E. Epic Fail of a Genie time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output Aladdin had 阅读全文
posted @ 2016-06-06 16:47 Pat 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Problem Description 小明在旅游的路上看到了一条美丽的河,河上有许多船只,有的船只向左航行,有的船只向右航行。小明希望拍下这一美丽的风景,并且把尽可能多的船只都完整地拍到一张照片中。 小明位于河的边上,并且可以在河边的任意位置进行拍照,照相机的视野恰好为90度角,只能以垂直于河边的 阅读全文
posted @ 2016-05-30 23:31 Pat 阅读(301) 评论(0) 推荐(0) 编辑
摘要:传送门 Solution: 记一颗流星在视野内的时间段为(L, R), 为了使所有(L, R)都取整数,首先将坐标放大。 放大倍数可取为 LCM(1, 2, ..., 10)= 2520 接着计算:从0时刻开始,每单位时间内入画的流星数,即数组: a[0], ..., a[M] 显然这可借助线段树, 阅读全文
posted @ 2016-03-23 22:40 Pat 阅读(186) 评论(0) 推荐(0) 编辑
摘要:传送门The Enterprise has encountered a planet that at one point had been inhabited. The only remnant from the prior civilization is a set of texts that w... 阅读全文
posted @ 2015-11-28 01:01 Pat 阅读(211) 评论(0) 推荐(0) 编辑
摘要:example POJ 2229 Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KDescriptionIn this problem, you have to analyze a particular sorting algorith... 阅读全文
posted @ 2015-11-09 12:12 Pat 阅读(408) 评论(0) 推荐(0) 编辑
摘要:传送门Ice Cream ParlorAuthored bydheerajonMar 21 2013Problem StatementSunny and Johnny together haveMdollars they want to spend on ice cream. The parlor ... 阅读全文
posted @ 2015-08-20 23:14 Pat 阅读(246) 评论(0) 推荐(0) 编辑
摘要:传送门Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluDescriptionIn this problem, a dictionary is collection of key-value pairs, where k... 阅读全文
posted @ 2015-08-14 15:22 Pat 阅读(168) 评论(0) 推荐(0) 编辑
摘要:传送门 B. Mike and Fun time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike and some bears 阅读全文
posted @ 2015-08-08 03:12 Pat 阅读(242) 评论(0) 推荐(0) 编辑
摘要:传送门 D. One-Dimensional Battle Ships time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. On 阅读全文
posted @ 2015-08-07 04:04 Pat 阅读(374) 评论(0) 推荐(0) 编辑
摘要:传送门 Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departme 阅读全文
posted @ 2015-08-06 11:33 Pat 阅读(467) 评论(0) 推荐(0) 编辑
摘要:2015年辽宁省赛热身赛有一道高精度乘法 传送门:NEUOJ 1574 A*B 1574: A * B 题目描述 Calculate a×b. Calculate a×b. 输入 Your program will be tested on one or more 阅读全文
posted @ 2015-07-06 20:49 Pat 阅读(1182) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示