- 博客(33)
- 资源 (2)
- 收藏
- 关注
原创 php登录验证及代码实现 含数据库设计 亲测有效
深夜调代码 试过无数种方法终于见了成效login.php内容如下管理员后台登录 管理员后台登录 用户名 密码
2014-08-31 00:21:24 2558
原创 Redhat 6配置本地Yum源
注明:我的方法适用于iso镜像(光盘或光盘镜像:iso9660)1.挂载(mount)其他的mount方法可参见此链接 http://www.jb51.net/os/RedHat/1109.html#mkdir /mnt/vcdrom说明:创建一个目录作为挂接点#mount -o loop -t iso9660 /home/sunky/mydisk.iso /mnt/vcd
2014-07-09 23:07:28 937
原创 [Data Structure][Tree][Binary Tree]POJ 2255----Tree Recovery
非常经典的一道二叉树题目运用递归建立二叉树1.前序序列中pre[0]为二叉树的根节点2.中序序列中root所在位置的两侧分别为左子树和右子树3.运用递归建立以结构体为节点的二叉树,指针域包含左孩子和右孩子题目链接:http://poj.org/problem?id=2255#include#includeusing namespace std;struct n
2013-07-31 19:48:04 895
原创 【poj】1003
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int MAXN = 300;float cards[MAXN];int main(){ memset(cards, 0, siz
2013-07-29 18:45:24 718
原创 Game Outcome
A - Game OutcomeTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSherlock Holmes and Dr. Watson played some game on a checkered
2013-07-25 14:16:59 898
原创 Interval Intersections
Interval IntersectionsTime Limit: 1000 MS Memory Limit: 65536 KbTotal Submission: 484 Accepted: 178Description给定x 轴上n 个闭区间。去掉尽可能少的闭区间,使剩下的闭区间都不相交。给定n 个闭区间,编程计算去掉
2013-06-05 15:26:04 712
原创 Program storage
Program storageTime Limit: 1000 MS Memory Limit: 65536 KbTotal Submission: 701 Accepted: 298Description设有n 个程序{1,2,…, n }要存放在长度为L的磁带上。程序i存放在磁带上的长度是 Li,程序存储问题要求确定这n 个程序在磁带上的一个存储方案,使得能够在磁带上存储尽可能多的程
2013-06-05 15:24:15 736
原创 Oil Car
Oil CarTime Limit: 1000 MS Memory Limit: 65536 KbTotal Submission: 1492 Accepted: 361Description一辆汽车加满油后可行驶n公里。旅途中有若干个加油站。设计一个有效算法,指出应在哪些加油站停靠加油,使沿途加油次数最少。对于给定的n
2013-06-05 15:21:58 923
原创 [Dynamic Programming]Route choices
//国际大学生程序设计竞赛例题解(三) //动态规划 //Page 110#include #include using namespace std;const int MAXSIZE = 100;int f[MAXSIZE][MAXSIZE];int main(){ int x, y; for(int i = 0; i < MAXSIZE
2013-05-13 16:38:09 693
原创 [Dynamic Programming]Recursion/Non-recursion to find the max number
//国际大学生程序设计竞赛例题解(三) //动态规划 //Page107Recursion Version#include #include using namespace std;int data[100];int getMax(int left, int right){ if(left == right) { retu
2013-05-13 16:03:47 705
原创 [Dynamic Programming]Example 3.1.2-Permutation of Number Sequence
//国际大学生程序设计竞赛例题解(三) //动态规划 //Page106///例题3.1.2#include #include using namespace std;void swap(int &x, int &y){ int temp = x; x = y; y = temp;}int n;int data[100];void s
2013-05-13 15:23:43 819
原创 [Dynamic Programming]Example 3.1 Recursion Programming - About the Stairs
//国际大学生程序设计竞赛例题解(三)//动态规划//Page104Version 1.0#include #include using namespace std;int f(int n){ int ret; if(n == 0) ret = 1; else if(n == 1) ret = 1; else {
2013-05-13 14:34:59 705
原创 [Templates That Are Usually Used]Header Files Include and Pre-Process(ToBeContinued)
#include #include #include #include #include #include #include #include #include #define LL long long#define rep(i, n) for(int i = 0; i < n; i++)
2013-05-13 13:10:54 893
原创 [Templates That Are Usually Used]Least Common Multipler
#include #include #include using namespace std;int gcd(int a, int b){ int ans; if(a < b) swap(a, b); if(b == 0) ans = a; else ans = gcd(b, a%b); return ans;}
2013-05-13 13:09:30 637
原创 [Templates That Are Usually Used]Greatest Common Divisor
#include #include #include using namespace std;int gcd(int a, int b){ int ans; if(a < b) swap(a, b); if(b == 0) ans = a; else ans = gcd(b, a%b); return ans;}
2013-05-13 13:07:44 649
原创 [UML]2-History
This is an Extract from Wikipedia - a free encyclopediaKeep it for my ownHistoryHistory of object-oriented methods and notation.UML has been evolving since the second half of
2013-04-24 13:17:18 866
原创 [水题一枚][BOJ]1018-Campus Singing Contest
非常简单的题,输入之后统计一下就行。。。#include#includeusing namespace std;struct cand{ string name; int vote;}cand[110];int main(){ int n; while(cin >> n) { for(int i = 1; i <= n;
2013-04-24 13:13:48 964
原创 [递归与分治算法][BOJ]1032-邮局选址问题
其实这个题和上一个输油管道问题是异曲同工,只不过这个题目要分别求出横坐标和纵坐标的中位数。#include#include#includeusing namespace std;const int MAX_SIZE = 10000 + 10;bool cmp(const int &a, const int &b){ if(a < b) return true; els
2013-04-23 23:56:03 3531
原创 [递归与分治算法][BOJ]1031-输油管道问题
这个题目其实很水。只需要求出所给坐标的纵坐标的中位数就解决了。没什么难度的说。#include #include #include using namespace std;const int MAX_SIZE = 10010;bool cmp(const int& a, const int& b){ if(a < b) return true; el
2013-04-23 23:54:55 2166
原创 [POJ][3517]-Joseph Circle-01
#includeusing namespace std;int dp;int main(){ int n, k, m, i; while(scanf("%d%d%d", &n, &k, &m)){ if(n == 0 && m == 0 && k == 0) break; dp = 0; for(i = 2; i < n; i+
2013-03-19 21:27:31 633
原创 [Brief Introduction to Data Structure]Linear Table- 线性表
线性表分为顺序存储结构和链式存储结构。1.顺序存储结构特点:逻辑结构和存储结构(物理结构一致) 可以随机存取,访问每个元素所用时间相同 插入或删除效率低2.链式存储结构特点:逻辑结构和存储结构不一定相同。 不能随机存取,访问每个元素时间不同 插入或删除效率高。
2013-03-13 18:01:25 734
原创 [UML]1-Overview of UML
Note : This is an extract from Wikipedia, the free encyclopediaOverview of UMLA collage of UML diagrams.Unified Modeling Language (UML) combines techniques from data modeling (e
2013-03-03 15:54:48 625
原创 [UML]0-Introduction to UML
Note:This is an extract from Wikipedia, the free encyclopedia.Unified Modeling Language (UML)is a standardized general-purpose modeling language in the field of object-oriented software
2013-03-03 15:48:07 352
原创 [Java]Points in Invoking Constructors in Super Class - Java Programming Language
• To invoke a parent constructor, you must place a call to super in the first line of the constructor.• You can call a specific parent constructor by the arguments that you use in the call to super.
2013-03-03 09:45:35 397
原创 [Java]the Keywords in Java Programming Language
abstract assertboolean break bytecase catch char classconst continuedefault
2013-03-01 23:51:16 427
原创 [Data Structure Primary][stack and queue]Rujia Liu-6.1.12-铁轨-栈和队列应用2
(1)使用STL模板方法///STL#include#includeusing namespace std;const int MAXN = 1000 + 10;int n, target[MAXN];int main(int argc, char** argv){ while(scanf("%d", &n) == 1) { stack s;
2013-02-23 12:02:27 524
原创 [Data Structure Primary][stack and queue]Rujia Liu-6.1.1-卡片游戏-栈和队列应用1
#include#includeusing namespace std;queue q;int main(int argc, char** argv){ int n; scanf("%d", &n); for(int i = 0; i < n; i++) q.push(i + 1); //初始化队列 while(!q.empt
2013-02-23 10:55:21 817
原创 [UVa]10300-Ecological Premium
#includeusing namespace std;int main(int argc, char** argv){ int m; cin >> m; int n; while(cin >> n) { if(n == 0) break; int size, num, ef;
2013-02-22 17:17:56 518
原创 [UVa]494-Kindergarten Counting Game
#include#include#include#define N 10000char a[N];int main(){ while(gets(a) != NULL) { int count = 0; int found; int n = strlen(a); for(int i = 0; i < n;
2013-02-22 17:15:40 375
原创 [ZOJ]1295
#include#include#include#includeusing namespace std;int main(int argc, char** argv){ int n; string s; cin >> n; getchar();//吸收掉一个换行符 while(n--) { getline(cin , s)
2013-02-22 16:24:17 412
原创 [ZOJ]1048-水题一枚-注意数据类型转换的技巧
#include#includeusing namespace std;int main(int argc, char** argv){ double sum = 0, balance, ave; for(int i = 0; i < 12; i++) { cin >> balance; sum += balance; }
2013-02-22 15:53:05 393
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人