码迷,mamicode.com
首页 > 其他好文
poj 2352 Stars
题意就是一颗星星的左下方有多少颗星星就是几级; 把每级的星星个数统计好输出就ok; 但不能用二维树状数组,会超内存,, #include #include #include #define maxn 32001 using namespace std; int a; int arr[maxn]; int low(int x) { return x&(-x); } void u...
分类:其他好文   时间:2014-07-21 13:38:26    阅读次数:213
HDU 1069 Monkey and Banana (动规)
HDU 1069 Monkey and Banana (动规) 题意比较难吧。。。。。Orz...
分类:其他好文   时间:2014-07-21 13:31:47    阅读次数:285
HDUJ 3177 Crixalis's Equipment 贪心
Crixalis's Equipment Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2568    Accepted Submission(s): 1059 Problem Description Crixalis ...
分类:其他好文   时间:2014-07-21 11:21:44    阅读次数:212
UVA - 10537 The Toll! Revisited (最短路变形逆推)
Description Problem G Toll! Revisited Input: Standard Input Output: Standard Output Time Limit: 1 Second   Sindbad the Sailor sold 66 silver spoons to the Sultan of Samarkand. The selling...
分类:其他好文   时间:2014-07-21 13:35:07    阅读次数:263
hdu4632Palindrome subsequence (求回文数,区间DP)
Problem Description In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, ...
分类:其他好文   时间:2014-07-21 11:13:44    阅读次数:270
hdu 1873看病要排队(优先队列)
# include # include # include using namespace std; struct node { int y; int val; int num; friend bool operatorn2.num;//从小到大 return...
分类:其他好文   时间:2014-07-21 11:36:44    阅读次数:203
hdu 1896 Stones(优先队列)
# include # include # include using namespace std; struct node { int pos; int d; int num; friend bool operator n2.d;//仍的距离从小到大 return...
分类:其他好文   时间:2014-07-21 11:43:44    阅读次数:180
编程算法 - 堆(heap) 代码(C)
堆(heap) 代码(C)本文地址: http://blog.csdn.net/caroline_wendy堆(heap)作为二叉树的重要应用, 时间复杂度O(logn), 需要熟练的写出其代码, 基本代码如下, 需要背写.代码:/* * main.cpp * * Created on: 2014.7.20 * Author: spike */ /*eclipse cdt,...
分类:其他好文   时间:2014-07-21 11:47:44    阅读次数:223
计算机操作系统学习笔记_10_文件管理 --文件系统实现
(1)用户调用接口 文件系统为用户提供与文件及目录有关的调用,如新建、打开、读写、关闭、删除文件,建立、删除目录等。此层由若干程序模块组成,每一模块对应一条系统调用,用户发出系统调用时,控制即转入相应的模块。 (2)文件目录系统 主要功能是管理文件目录,其任务有:管理活跃文件目录表、管理读写状态信息表、管理用户进程的打开文件表、管理与组织在存储设备上的文件目录结构、调用下一级存取控制模块。 (3)存取控制验证 实现文件保护主要由该级软件完成,它把用户的访问要求与文件控制块中指示的...
分类:其他好文   时间:2014-07-21 11:13:44    阅读次数:503
函数参数传递方式详解
1. 函数参数传递方式之一:值传递   (1)值传递的一个错误认识 先看如下的一个问题: void Exchg1(int x, int y) /* 定义中的x,y变量被称为Exchg1函数的形式参数 */ {   int tmp;   tmp = x;    x= y;    y= tmp;   printf("x = %d, y = %d.\n", x, y); } 问:...
分类:其他好文   时间:2014-07-21 11:24:44    阅读次数:264
计算机操作系统学习笔记_11_文件管理 --磁盘组织与管理
1、磁道(柱面) 2、扇区 3、磁盘 注:相邻磁道以及相邻扇区间通过一定的间隙分隔开,以避免精度错误! 二、磁盘调度算法 读写一次磁盘所需的时间可分为以下几种: (1)设备等待:设备或总线忙,需要等候。 (2)寻道时间:将读/写磁头移动到相应的柱面所花费的时间。 (3)旋转延迟时间:扇区转到磁头位置所需的时间。 (4)传输时间:数据写入磁盘或从磁盘读出的时间。...
分类:其他好文   时间:2014-07-21 11:28:44    阅读次数:298
poj3056The Bavarian Beer Party (不交差配对,区间DP)
Problem Description The professors of the Bayerische Mathematiker Verein have their annual party in the local Biergarten. They are sitting at a round table each with his own pint of beer. As a ceremo...
分类:其他好文   时间:2014-07-21 11:31:44    阅读次数:252
01背包水题篇之HDU1864——最大报销额
这个题目好果的01,只要把每个数乘以100,就能解决下标的问题了 继续贴代码环节(自己的代码好丑啊~~~) #include #include #include #include #define maxn 3100000 using namespace std; int dp[maxn]; int p[31]; int main() { double Q; int n,...
分类:其他好文   时间:2014-07-22 00:32:35    阅读次数:213
最长公共递增子序列【模板】
虽然很多人说记模板提升空间有限,但是对于我这种菜鸟级别的人来说。能做的也只有记记模板了! 希望这个模板能帮到你,如果有更好的模板记得告诉我哦!!谢谢。 二维代码: #include #include #include using namespace std; int n,m,a[505],b[505],dp[505][505]; int LICS() { int max,i,j; mem...
分类:其他好文   时间:2014-07-21 11:42:44    阅读次数:192
排序算法-冒泡、插入、归并、希尔、快速、选择--代码总结
冒泡排序代码: #include #include using namespace std; template void bubbleSort(ItemType theArray[], int n) { bool sorted = false; // False when swaps occur int pass = 1; while (!sorted && (pass...
分类:其他好文   时间:2014-07-22 00:32:35    阅读次数:363
Intent 用法全面总结
调用拨号程序      // 给移动客服10086拨打电话 Uri uri = Uri.parse("tel:10086"); Intent intent = new Intent(Intent.ACTION_DIAL, uri); startActivity(intent); 发送短信或彩信      // 给10086发送内容为“Hello”的短信 Uri uri = Uri.par...
分类:其他好文   时间:2014-07-21 11:34:44    阅读次数:285
POJ 2485 Highways 最小生成树
Highways Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 21545   Accepted: 9935 Description The island nation of Flatopia is perfectly flat. Unfortunately, F...
分类:其他好文   时间:2014-07-21 11:23:44    阅读次数:246
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!