05 2017 档案

摘要:给定一段文字,已知单词a1, a2, …, an出现的频率分别t1, t2, …, tn。可以用01串给这些单词编码,即将每个单词与一个01串对应,使得任何一个单词的编码(对应的01串)不是另一个单词编码的前缀,这种编码称为前缀码。 使用前缀码编码一段文字是指将这段文字中的每个单词依次对应到其编码。 阅读全文
posted @ 2017-05-22 13:56 Dilthey 阅读(1002) 评论(0) 推荐(0) 编辑
摘要:2017江苏省赛的E题,当时在场上看错了题目没做出来,现在补一下…… 题目链接:http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1264(注意在上面使用G++编译的话,请使用%I64d) Time Limit : 3000 M 阅读全文
posted @ 2017-05-19 09:28 Dilthey 阅读(326) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.ecnu.edu.cn/problem/3260/ Time limit per test: 1.5 seconds Time limit all tests: 10.0 seconds Memory limit: 256 megabytes Time limit a 阅读全文
posted @ 2017-05-17 08:51 Dilthey 阅读(236) 评论(0) 推荐(0) 编辑
摘要:Time limit per test: 2.0 seconds Time limit all tests: 15.0 seconds Memory limit: 256 megabytes Time limit per test: 2.0 seconds Time limit all tests: 阅读全文
posted @ 2017-05-12 23:12 Dilthey 阅读(350) 评论(0) 推荐(0) 编辑
摘要:一定要纪念一下第一道在比赛中自己做出来的贪心。 题目链接:http://acm.ecnu.edu.cn/problem/3263/ Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 阅读全文
posted @ 2017-05-12 23:06 Dilthey 阅读(381) 评论(0) 推荐(0) 编辑
摘要:从Y1-M1-D1到Y2-M2-D2间所有日期,出现多少个9? 呃讲真,刚开始想这个题目还是很烦的,各种要考虑的情况…… 最后思考这样: 对于任何输入,设输入分别为 st.y st.m st.d ed.y ed.m ed.d ,分成三种情况: ①st.y==ed.y,两个日期出现在同一年里,直接暴力 阅读全文
posted @ 2017-05-10 20:09 Dilthey 阅读(160) 评论(0) 推荐(0) 编辑
摘要:让我回想起了小学的时候,空瓶换饮料还能向别人借一个空瓶喝了再还回去的神奇问题…… 开始时思考,特判一下a=1或者b=1的情况为INF就可以了,然后发现2 2 1 2这样的样例也是能够喝到无穷多瓶饮料的。 所以干脆直接做循环,每次循环模拟换了饮料然后喝掉的情形,如果发现喝完空瓶子不减少或者瓶盖子不减少 阅读全文
posted @ 2017-05-10 19:45 Dilthey 阅读(331) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-05-08 21:32 Dilthey 阅读(329) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.uestc.edu.cn/#/problem/show/1059 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) 秋实大哥以周济天下,锄强扶弱为己任,他常对 阅读全文
posted @ 2017-05-08 19:44 Dilthey 阅读(231) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.uestc.edu.cn/#/problem/show/1057 线段树的第一题,看着题解和讲解,自己把模板一点点慢慢码出来的。 线段树讲解:http://www.cnblogs.com/TenosDoIt/p/3453089.html 2018-5-1更新 今天又看 阅读全文
posted @ 2017-05-08 14:20 Dilthey 阅读(298) 评论(0) 推荐(0) 编辑
摘要:首先,可以自己先一个超时的标程出来: 那么考虑如何进行时间优化: 这样一来,原本例如(2 + 3)mod 5 = 0 的情况,我们得到的是 ( i_num = 1 ) * ( j_num = 1 ) = 1,1对( i , j ), 现在就可以使 ( i_num = 2 ) * ( j_num = 阅读全文
posted @ 2017-05-07 09:38 Dilthey 阅读(372) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 10000ms Memory Limit: 262154KB 64-bit integer IO format: %lld Java class name: Main Time Limit: 10000ms Memory Limit: 262154KB 木衫同学和凌小小都是军 阅读全文
posted @ 2017-05-07 08:11 Dilthey 阅读(338) 评论(0) 推荐(0) 编辑
摘要:花了半个小时,强行拗出一长串又臭又长的代码,把所有情况都分了(该分的,不该分的……都分了……) 阅读全文
posted @ 2017-05-06 22:38 Dilthey 阅读(300) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description There are n Doge Planets in the Doge Space. The 阅读全文
posted @ 2017-05-06 09:51 Dilthey 阅读(193) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others) Input There are several test cases. Please process till EOF.For ea 阅读全文
posted @ 2017-05-05 23:30 Dilthey 阅读(277) 评论(0) 推荐(0) 编辑
摘要:原本是数据结构课的作业……到后来没查,放着占内存,删了有点浪费,干脆扔在博客上吧…… 阅读全文
posted @ 2017-05-05 09:58 Dilthey 阅读(172) 评论(0) 推荐(0) 编辑
摘要:RMQ应用题。 引用别人的解题思路: 阅读全文
posted @ 2017-05-04 23:21 Dilthey 阅读(233) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3368 RMQ应用题。 解题思路参考:http://blog.csdn.net/libin56842/article/details/46482803 附一个网上的数据生成器: 阅读全文
posted @ 2017-05-03 13:13 Dilthey 阅读(149) 评论(0) 推荐(0) 编辑