- 博客(95)
- 资源 (1)
- 收藏
- 关注
转载 (转)C++文件的批处理——批量文件增删改查
原博客地址:http://www.cnblogs.com/hanxi/archive/2012/07/22/2603584.html一、统计代码行数 几个星期前做了个统计代码的小程序,对文件的批处理需要获取文件列表,因为是在windows下操作的,所以百度到一个系统调用 system(“dir /a /b >> file_list.txt”);功能就是把当前目录下的所有文件名写到file
2015-07-21 10:07:15 1054
原创 Codeforces 515B
题目大意: b个男生,g个女生,其中有bnum个男生是开心的,gnum个女生是开心的。 在第i 天第i mod b个男生会和第i mod g个女生一起吃饭,如果两人中有一个是开心的,两个人从那一天其几都会是开心的。 问能否使全部人开心?结题思路: 首先可以知道,如果i一直增加下去,有一些组合是怎么都不可能全部开心的,而可以全部开心的组合,应该会有一个i 的最小上界。 这道题最主要的就是确定
2015-02-21 16:53:01 528
原创 Codeforces 515B
题目大意: 初始坐标为0 0 给出目标坐标a b,a和b可正可负;再给出移动步数s。 从初始位置到目标位置中间过程完全随机,问是否可以以s步数最终停在目标位置。解题思路&反思: 若s的值小于曼哈顿距离,则一定不能到达。 否则判断,s-曼哈顿距离的值,是否能够被2整除。原因是其移动路径可以先投影出一条曼哈顿路径,剩下的“偏离”的路径,一定是有出有入成双的。WA在目标坐标可正可负,求解曼哈顿距
2015-02-21 16:40:44 413
原创 【模拟专题】HDU-4121[弱校联萌第一场]
A. XiangqiTime Limit: 1000msMemory Limit: 32768KB64-bit integer IO format: %I64d Java class name:Main SubmitStatus PID: 10277 Xiangqi is one of the most popular two-player
2015-02-14 10:12:49 598
原创 poj 1190 dfs+神剪枝
生日蛋糕Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 14120 Accepted: 4971Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 R
2014-12-08 20:53:24 383
原创 (待做)Codeforces Round.6 D. Lizards and Basements 2 dp
D. Lizards and Basements 2time limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputThis is simplified version of the
2014-10-25 15:47:59 500
原创 Codeforces Round #274 (Div. 2) A,B,C
A. Expressiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya studies in a school and he adores Maths.
2014-10-20 08:32:05 357
原创 Codeforces 4D Mysterious Present 求数对的最长上升序列 dp
D. Mysterious Presenttime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputPeter decided to wish happy birthday t
2014-10-19 14:58:46 373
原创 Codeforces 3 B. Lorry 暴力 排序 枚举 贪心
B. Lorrytime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputA group of tourists is going to kayak and catamaran
2014-10-18 09:03:20 1241
原创 Codeforces 2B The least round way 动态规划(分类讨论)
B. The least round waytime limit per test5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputThere is a square matrix n × n, consi
2014-10-15 14:16:06 446
原创 codeforces Queries for Number of Palindromes 区间dp
(4321在压入第四个数时第一次出栈 )(3421,3241,3214在压入第三个数时第一次出栈)(2143,2134,2314,2431,2341在压入第二个数时第一次出栈)(1432,1324,1342,1243,1234在压入第一个数时第一次出栈) 一共14个
2014-10-12 17:40:14 377
原创 Codeforces Round #230 (Div. 1) B. Tower of Hanoi 记忆化搜索
B. Tower of Hanoitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Tower of Hanoi is a well-known mathema
2014-10-11 15:35:10 369
原创 Codeforces Round #271 (Div. 2) B Worms 裸的二分查找
B. Wormstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is lunch time for Mole. His friend, Marmot, prep
2014-10-08 08:35:49 435
原创 CodeForces #Bayan# -- C Kamal-ol-molk's Painting 模拟
C. Kamal-ol-molk's Paintingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRumors say that one of Kamal-ol
2014-10-07 16:55:27 697
原创 CODEFORCES Bayan 2015 Contest Warm Up A题= =WA啦!~~!!!
A. Bayan Bustime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe final round of Bayan Programming Contest w
2014-10-06 10:18:33 483
原创 (复习) hdu 5037 frog~! 贪心策略
FrogTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1376 Accepted Submission(s): 373Problem DescriptionOnce upon a time, there
2014-09-25 10:10:41 499
原创 (复习)poj 1952 最长下降子序列—— dp+方案个数
BUY LOW, BUY LOWERTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8466 Accepted: 2930DescriptionThe advice to "buy low" is half the formula to success
2014-09-17 16:34:51 517
原创 hdu 5014 Number Sequence 想法题 构造题
Number SequenceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 765 Accepted Submission(s): 362Special JudgeProblem DescriptionThe
2014-09-17 16:17:38 368
原创 (待切)hdu 4096 大模拟(用map做爆栈了!!)
Universal Question Answering SystemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1229 Accepted Submission(s): 213Problem Descript
2014-09-16 22:36:28 678
原创 (待切)POJ 1926 Pollution 模拟/并查集
PollutionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3904 Accepted: 1034DescriptionThe managers of a chemical plant, which is notorious for its hi
2014-09-15 19:51:52 456
原创 (自坑,复习)poj 1887 水题 最长不升子序列
Testing the CATCHERTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 15180 Accepted: 5585DescriptionA military contractor for the Department of Defense
2014-09-12 23:07:51 384
转载 (复习)(转)03进制状态压缩DP——HDU3001 Travelling 旅行商问题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3001题目大意:n个城市之间有m条路,经过每条路径都有一定的花费,当然有些城市是不可达的。遍历所有的城市,并且每个城市最多只能遍历2次,求取花费的最小费用并输出,如果找不到这样的路径,输出-1。(n解题思路:由于n是小于10的,所以这个题目可以使用状态压缩
2014-09-11 21:56:21 493
原创 (复习)poj 1742 coins 多重背包可达性问题
CoinsTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 28958 Accepted: 9828DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3..
2014-09-02 10:42:17 496
原创 (复习)poj 1609 简单dp
Tiling Up BlocksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5050 Accepted: 1975DescriptionMichael The Kid receives an interesting game set from his
2014-08-31 14:49:58 394
原创 poj 1276 多重背包+二进制优化+单调队列优化
Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27570 Accepted: 9806DescriptionA Bank plans to install a machine for cash withdrawal. The
2014-08-28 13:59:36 1114
原创 (弃疗搁置)poj 1821 Fence
FenceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3586 Accepted: 1087DescriptionA team of k (1 <= K <= 100) workers should paint a fence which cont
2014-08-26 20:30:37 392
原创 (常复习)poj 1015 dp+记录dp路径+转变最优子结构+区间映射
Jury CompromiseTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24812 Accepted: 6464 Special JudgeDescriptionIn Frobnia, a far-away country, the ve
2014-08-26 17:13:46 643
原创 hdu 3401 单调队列优化dp
TradeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3588 Accepted Submission(s): 1161Problem DescriptionRecently, lxhgww is addi
2014-08-23 10:40:11 534
原创 temp
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define maxn 2015using namespace std;int ap[max
2014-08-20 20:12:51 331
转载 poj 2823 单调队列入门题(内含手写队列的学习和模板)
题目描述: 有N个数,每次从左到右选取M个数,第一行选取每个区间中的最小值输出,第二行选取最大值并输出。 解题思路: 看单调队列的时候推荐了这个题,所以自然就是单调队列的类型了。然后这个是典型的,固定k区间队列的。套用的本质思想是,如求最小值: 考虑这样的一个问题,在某个区间当中如果存在某两个元素A,B,满足A的下标小于B的下标,A的值大于B的值,那么A这个
2014-08-18 16:15:41 1987
原创 hdu 4956 Poor Hanamichi(BC.R#5) 读懂了题意就是水题/坑- -比赛中居然没有过
Poor HanamichiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 175 Accepted Submission(s): 86Problem DescriptionHanamichi is takin
2014-08-17 22:27:56 533
原创 poj 1151 Atlantis “线段树维护关键值”+“离散化”+“扫描线法”
AtlantisTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17448 Accepted: 6652DescriptionThere are several ancient Greek texts that contain descriptions o
2014-08-17 09:51:36 424
原创 hdu 4939 Stupid Tower Defense() dp
Stupid Tower DefenseTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1294 Accepted Submission(s): 383Problem DescriptionFSF
2014-08-15 10:48:48 390
原创 (弃疗搁置T)poj 1143 记忆化搜索+状压dp+dfs
Number GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3078 Accepted: 1235DescriptionChristine and Matt are playing an exciting game they just invente
2014-08-11 15:31:51 439
原创 (有坑可复习)poj 1083 Moving Tables 模拟/贪心/技巧性质
Moving TablesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 25839 Accepted: 8600DescriptionThe famous ACM (Advanced Computer Maker) Company has rented
2014-08-10 16:59:23 430
原创 POJ 1018 Communication System dp
Communication SystemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23065 Accepted: 8197DescriptionWe have received an order from Pizoor Communications In
2014-08-10 15:50:04 307
原创 暑期个人赛--第七场--C
C. 三角形的传说 2014新生暑假个人排位赛07时间限制 1000 ms 内存限制 65536 KB题目描述有一个传说,对给定正整数 m 和 q,总有一个边长为 a,b,c 的三角形,是满足 a % m + b % m = c % m = q 的条件的三角形中周长最小的。Mays 对此深信不疑,她打算和你一起探讨这个问题。她出了一些数据,请你帮忙求最小周长
2014-08-08 22:46:11 361
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人