
程序设计
程序与算法
我不聪明但很努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
sicily1321. Robot
http://linxiaoty.iteye.com/blog/1876251转载 2013-05-27 10:15:06 · 521 阅读 · 0 评论 -
sicily1134.积木分发
#include using namespace std;class child{public: child(){} int have; int need;};int main(){ int num, sum; while (true) { cin >> num >> sum; if (num == 0) {原创 2013-08-18 14:43:01 · 588 阅读 · 0 评论 -
sicily1762 排座椅
ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription上课的时候总有一些同学和前后左右的人交头接耳,这是令小学班主任十分头疼的一件事情。不过,班主任小雪发现了一些有趣的现象,当同学们的座次确定下来之后,只有有限的D对同学上课时会交头接耳。同学们在教室中坐成了M行N列,坐在第i行第j列 的同学原创 2013-08-24 15:05:02 · 727 阅读 · 0 评论 -
sicily1825. Nickname
其实,这道题目的意思简单的。 大概的意思就是,把找到每一个字符串出现的次数,然后,按照字典顺序把字符串和出现的次数依次输出来。。 题目的链接: http://soj.me/1825 下面是我的代码,还有优化的需要,通过的时间为2.3S,题目限定的时间为3S #include #include #include #inclu原创 2013-08-19 21:52:34 · 592 阅读 · 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 · 670 阅读 · 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 · 699 阅读 · 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 · 533 阅读 · 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 · 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 · 1003 阅读 · 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 · 476 阅读 · 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 · 565 阅读 · 0 评论 -
sicily1703. Obstacle Course
一道很典型的最短路径的题目。 算法的思想来自于Dijkstra(迪杰斯特拉)算法,大家在这里对这个算法就不介绍了。 可以在学完最短经的算法后,用这道题目当做练手。。我的算法还需要优化一下,代码也需要优化,因为我的代码确实有点乱。。下面的代码仅供参考。。 题目的链接:http://soj.me/1703 #include #inclu原创 2013-08-19 21:52:40 · 511 阅读 · 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 · 1104 阅读 · 0 评论 -
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 · 438 阅读 · 0 评论 -
sicily9457. Typo
Description Bessie has just purchased a new laptop computer, but she unfortunately finds herself unable to type well, given the size of her large hooves relative to the small keyboard. Bessie has原创 2013-11-26 22:01:08 · 930 阅读 · 0 评论