算法
程序与算法
我不聪明但很努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
sicily7911. Windows
这道题目,其实不用怎么想,数据有大,不过一次遍历搜索就可以完成。 首先读入数据,储存在数组中,然后从数组的尾部向前面搜索判断,就可以了。。 #include #include using namespace std;int main(){ int t; int n, m; int r, c, w, h, cr, cc;原创 2013-08-19 21:52:14 · 448 阅读 · 0 评论 -
sicily1034. Forest
ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionIn the field of computer science, forest is important and deeply researched , it is a model for many data structures . Now it’s you原创 2013-08-28 19:03:33 · 642 阅读 · 0 评论 -
sicily1625. Binary Clock
1625. Binary Clock ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription A binary clock is a clock which displays traditional sexagesimal time (military format) in a binary forma原创 2013-08-19 21:53:00 · 576 阅读 · 0 评论 -
sicily1825. Nickname
其实,这道题目的意思简单的。 大概的意思就是,把找到每一个字符串出现的次数,然后,按照字典顺序把字符串和出现的次数依次输出来。。 题目的链接: http://soj.me/1825 下面是我的代码,还有优化的需要,通过的时间为2.3S,题目限定的时间为3S #include #include #include #inclu原创 2013-08-19 21:52:34 · 600 阅读 · 0 评论 -
sicily6135. Blackjack
鉴于这道题目的数据量并不大,所以,暴力解决就可以啦。。所谓暴力,也就说,三重循环。。题目的链接: http://soj.me/6135 #include #include using namespace std;int main(){ int n, m; int count = 1; while (scanf("%d%d", &n, &原创 2013-08-19 21:52:19 · 709 阅读 · 0 评论 -
[置顶] sicily1007. To and Fro
1007. To and FroConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionMo and Larry have devised a way of encrypting messages. They first decide secretly on the number of columns and w原创 2013-08-19 21:53:05 · 488 阅读 · 0 评论 -
sicily1155. Can I Post the lette
1155. Can I Post the lette ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription I am a traveler. I want to post a letter to Merlin. But because there are so many roads I can wal原创 2013-08-19 21:52:55 · 685 阅读 · 0 评论 -
sicily1198. Substring
1198. Substring ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription Dr lee cuts a string S into N pieces,s[1],…,s[N]. Now, Dr lee gives you these N sub-strings: s[1],…s[N].原创 2013-08-19 21:52:50 · 542 阅读 · 0 评论 -
sicily1703. Obstacle Course
一道很典型的最短路径的题目。 算法的思想来自于Dijkstra(迪杰斯特拉)算法,大家在这里对这个算法就不介绍了。 可以在学完最短经的算法后,用这道题目当做练手。。我的算法还需要优化一下,代码也需要优化,因为我的代码确实有点乱。。下面的代码仅供参考。。 题目的链接:http://soj.me/1703 #include #inclu原创 2013-08-19 21:52:40 · 529 阅读 · 0 评论 -
sicily1940. Ordering Tasks
1940. Ordering TasksConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only p原创 2013-08-19 21:52:24 · 1015 阅读 · 0 评论 -
sicily1122. Prerequisites?
1122. Prerequisites?ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription Freddie the frosh has chosen to take k courses. To meet the degree requirements, he must take courses from原创 2013-08-19 21:52:45 · 544 阅读 · 0 评论 -
sicily1321. Robot
1321. RobotConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionKarell Incorporated has designed a new exploration robot that has the ability to explore new terrains, this new robot原创 2013-08-19 21:52:29 · 1118 阅读 · 0 评论 -
sicily1010. Zipper
Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay in its original order. For example, consider forming "原创 2013-08-19 21:53:10 · 565 阅读 · 0 评论
分享