echobfy

博客园 首页 新随笔 联系 订阅 管理

2014年2月13日 #

摘要: Before the Android system can start an app component, the system must know that the component exists by reading the app'sAndroidManifest.xmlfile (the "manifest" file). Your app must declare all its components in this file, which must be at the root of the app project directory. The man 阅读全文
posted @ 2014-02-13 21:33 小白哥哥啊 阅读(264) 评论(0) 推荐(0) 编辑

摘要: 今天准备开始毕业设计--做一个android应用。无奈android基础木有一点,以前做过一个蓝牙应用,不过对android各方面的知识还是不懂啊,今天在android主页上看英文的android开发介绍,那么爽啊!特地摘录一点。 网址(http://developer.android.com/guide/index.html) Android apps are written in the Java programming language. The Android SDK tools compile your code—along with any data and ... 阅读全文
posted @ 2014-02-13 20:44 小白哥哥啊 阅读(258) 评论(0) 推荐(0) 编辑

2014年2月12日 #

摘要: 分析: 考察归并排序,用简单的快排会超时。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 11 using namespace std;12 13 // 归并排序14 15 int a[1000005];16 int b[1000005];17 int c[2000005];18 19 int merge(int n, int m)20 {21 int i = 0, j = 0, k = 0;22 ... 阅读全文
posted @ 2014-02-12 14:40 小白哥哥啊 阅读(136) 评论(0) 推荐(0) 编辑

摘要: 分析: 考察最短路,可以使用Dijkstra算法,关键在于有相等路径时的判断。 特别注意:题目要求的是the number of different shortest paths 和the maximum amount of rescue teams you can possibly gather。 1 #include 2 #include 3 #include 4 #include 5 //#include 6 7 using namespace std; 8 9 const int Max_required = 505; 10 const int Ma... 阅读全文
posted @ 2014-02-12 14:38 小白哥哥啊 阅读(808) 评论(0) 推荐(0) 编辑

摘要: 分析: 考察BST + 完全二叉树的性质,注意: (1):先用排序排好,然后由于是完全二叉树,我们使用中序来建树。 (2):建好之后,层次遍历可以采用队列。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 vector vect;12 vector result;13 14 struct Node15 {16 int value;17 Node *left;18 Node *r... 阅读全文
posted @ 2014-02-12 14:22 小白哥哥啊 阅读(396) 评论(0) 推荐(0) 编辑

摘要: 分析: 考察树状数组 + 二分, 注意以下几点: 1.题目除了正常的进栈和出栈操作外增加了获取中位数的操作, 获取中位数,我们有以下方法: (1):每次全部退栈,进行排序,太浪费时间,不可取。 (2):题目告诉我们key不会超过10^5,我们可以想到用数组来标记,但不支持快速的统计操作。 (3):然后将数组转为树状数组,可以快速的统计,再配上二分就OK了。 2.二分中我们需要查找的是一点pos,sum(pos)正好是当前个数的一半,而sum(pos - 1)就不满足。 1 #include 2 #include 3 #inclu... 阅读全文
posted @ 2014-02-12 14:07 小白哥哥啊 阅读(243) 评论(0) 推荐(0) 编辑

摘要: 分析: 考察二分,简单模拟会超时,优化后时间正好,但二分速度快些,注意以下几点: (1):如果一个序列D1... Dn,如果我们计算Di到Dj的和, 那么我们可以计算D1到Dj的和sum1,D1到Di的和sum2, 然后结果就是sum1 - sum2; (2): 那么我们二分则要搜索的就是m + sum[i]的值。#include #include #include #include #include #include #include #include #include #include using namespace std;const int Max_Int = 0x7ff... 阅读全文
posted @ 2014-02-12 13:55 小白哥哥啊 阅读(289) 评论(0) 推荐(0) 编辑

摘要: 分析: 考察并查集,注意中间合并时的时间的合并和人数的合并。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std; 11 12 const int Max_Int = 0x7fffffff; 13 const int Max_required = 500; 14 15 struct Node //记录gang的信息 16 { 17 in... 阅读全文
posted @ 2014-02-12 13:45 小白哥哥啊 阅读(330) 评论(0) 推荐(0) 编辑

摘要: 分析: 模拟题,提交无数次WA,注意几点: 1.如果某人没有有效通话记录,则不输出该人的信息,在此WA15次,题目看了N遍也没出现啊。 2.通话时间钱的计算:假设我们计算time1到time2的账单; (1)我们可以采用从起点(即00:00:00)开始计算,结果就是get_money(time2) - get_money(time1), 这样计算方便。 (2)我们也可以采用从time1开始递增直到time2, 这样比较烦。 3.有效的通话记录是指:如果某人的通话记录为1.on;2.on;3.off;,则其中1.on将被抛弃,匹配到2.on;3... 阅读全文
posted @ 2014-02-12 13:21 小白哥哥啊 阅读(758) 评论(0) 推荐(0) 编辑