自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 资源 (3)
  • 收藏
  • 关注

原创 合数乘积

点击打开链接合数乘积TimeLimit: 1 Second   MemoryLimit: 32 MegabyteTotalsubmit: 9   Accepted: 2  DescriptionThala教授在我 们学院中最受欢迎. 尽管选择Thala教授意味着你今后的学习任务将很多很艰难, 但鉴于当前的世界形势, 学生们需要掌握更多

2014-02-19 14:56:44 747

原创 填充管道

点击打开链接TunnelsTimeLimit: 1 Second   MemoryLimit: 32 MegabyteTotalsubmit: 86   Accepted: 33  DescriptionWater can flow around, does not it? And it can also flow along a tun

2014-02-18 15:37:51 644

原创 欧拉图

点击打开链接Eular GraphTimeLimit: 1 Second   MemoryLimit: 32 MegabyteTotalsubmit: 53   Accepted: 38  DescriptionEular graph is a graph that you can start from one vertex X

2014-02-18 15:18:03 496

原创 Minimum time

点击打开链接Minimum timeTimeLimit: 1 Second   MemoryLimit: 64 MegabyteTotalsubmit: 140   Accepted: 52  DescriptionTom gets up late today. In order to go to work faster, Tom

2014-02-18 15:05:47 573

原创 Sum It Up

点击打开链接Sum It UpTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3446    Accepted Submission(s): 1739Problem Description

2014-02-17 20:49:13 491

原创 骑士移动

点击打开链接Play againTimeLimit: 1 Second   MemoryLimit: 32 MegabyteTotalsubmit: 104   Accepted: 23  DescriptionEveryone knows the "knight move" problem. Today you are goin

2014-02-17 17:32:48 714

原创 宝石游戏

点击打开链接JewelryTimeLimit: 1 Second   MemoryLimit: 32 MegabyteTotalsubmit: 77   Accepted: 25  DescriptionThe jewelry game is an interesting game. this game is run in a box

2014-02-17 16:34:47 1266 5

原创 无线网络

点击打开链接本题只要能正确建图(是否通信的关系),再通过并查集的知识就可以解题了,初始时每一台计算机都是损坏的。1,根据坐标建立每对计算机的连通关系。2,当操作为维修时,把本台计算机标记为好的,并将其与其可以通信的且完好的计算机进行合并操作,此时它们具有相同的根结点。3,当操作为询问时,若两台计算机具有相同的根结点则可通信,否则不可通信 。#includ

2014-02-17 14:41:08 785

原创 宗教信仰

点击打开链接并查集的应用。#include#includeint f[50005],sum;int find(int x){ if(f[x]!=x){ f[x] = find(f[x]); } return f[x];}void make(int a,int b){ int f1 = find(a);

2014-02-17 14:14:51 701

原创 敌兵布阵

点击打开链接树状数组的应用。#include#includeint a[50010],c[50010];int cnt = 1;int lowbit(int x){ return x&(-x);}void insert(int k,int d,int maxs){ while(k<=maxs){ c[k] += d;

2014-02-17 14:04:32 535

原创 人工湖工路

点击打开链接首先,用广度优先搜索肯定会超时。所以,考虑用树状数组。用一个数组记录ma[i]表示第i条到第i+1条路是边通的。那么就可以计算顺里针或者逆时针1的和数是否与城市的数目相等即可。这可以用快速求和的方法——树状数组。#include#includeint c[100010],ma[100010];int lowbit(int x){

2014-02-17 13:08:14 617

原创 新连连看

点击打开链接边枚举,边搜索。#include#includetypedef struct { int x,y;}Queue;Queue queue[500];char map[11][11],ans[11];int visit[11][11];int dir[4][2]={1,0,0,1,-1,0,0,-1};int bfs(int x,int y

2014-02-16 20:09:32 708

原创 石油合并

点击打开链接往四个方向深搜索即可。重点理解递归就可,递归是系统自己调用一个栈。它会1,将所有的实在参数,返回地址等信息给调用函数保存。2,为被调用的函数分配内存。3,转移到调用函数的入口。#include#includeint n,m,many;int map[55][55];char s[55][55];int dfs(int i,int j){

2014-02-16 18:08:39 1045

原创 树木品种-Qsort

点击打开链接为什么还会是Qsort,说明它很重要吧。#include#include#include#include#includetypedef struct s{ char str[32];}Str;Str c[101000];int counts[101000];int times = 1;int cmp(const void *

2014-02-16 16:05:22 532

原创 寻找副本-Qsort

点击打开链接还是Qsort的运用。#include#include#includetypedef struct s{ char str[22];}Str;Str c[21000];int counts[21000];int times = 1;int cmp(const void *a,const void *b){ Str *f1 =

2014-02-16 15:34:34 475

原创 字符串计数-Qsort

点击打开链接主要是考察Qsort函数的用法。#include#include#includetypedef struct s{ char str[22];}Str;Str c[110000];int counts[110000];int times = 1;int cmp(const void *a,const void *b){ Str

2014-02-16 15:17:56 502

原创 A公司的烦恼-贪心

因为一个公司的每一个月是既有盈利,又有亏损的,所以可以先求出至少有多少个月是亏损的。然后根据亏损的月运用贪心思想。如i == 4  则必然12个月的情况为 sddddsddddsd    而且还有判断3*S-9*D>=0? 如果都满足,则有最大盈利。否则无。 i ==3  ssdddssdddss.i==2 sssddsssddssi==1 ssssdssssdss.

2014-02-16 14:22:28 847

原创 木棒三角形-枚举

点击打开链接因为长度是从小到大输入的,而且木棒的条数最大不会超过100 ,所以可以直接枚举。#includeint main(){ int n; int i,j,k; double ans; double a[110]; while(scanf("%d",&n)!=EOF){ ans = -1;

2014-02-16 14:04:31 894

原创 汉诺塔-递归

题目很简单。#includevoid Move(int n,char x,char y){ printf("move %d from %c to %c\n",n,x,y);}void Hannoi(int n,char a,char b,char c){ if(n==1) Move(1,a,c); else { Hannoi(n-1,a

2014-02-16 13:55:06 482

原创 计数问题-分治

要求出a,b两个数中1出现的次数,可以先求出大者出现的1 的个数,然后求出小者1出现的个数,两者相减即可。以0,197为例   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  3

2014-02-16 13:45:28 574

php中国象棋

这是用php代码写的一个 中国象棋,可以看源码。如果有更多兴趣,可以自己改进与实现。

2014-09-16

计算机算法设计与分析PPT

计算机算法设计与分析PPT

2013-04-25

必背经典程序

这是一些初学者的必背程序代码,是一个好的DOC文档资料

2013-04-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除