- 博客(113)
- 资源 (13)
- 问答 (7)
- 收藏
- 关注
原创 POJ 2236并查集
#include"stdio.h"#include"iostream"#include"map"#include"set"using namespace std;const int maxn=1050;double d;int pre[maxn];struct point{double x,y;}a[maxn];void init(int n){ for(int i
2016-08-31 18:43:13 293
原创 poj 1308 并查集
树的定义:1.空树也是树。也就是说0 0也是树2.树中没有自环。 也就是说有1 1 2 2 这种数据的肯定不是树3.树中没有多重边或者双向边。 用并查集判断两个点是否在同一个连通分量中,如果在同一个分量中说明这条边是多出来的,肯定不是树4.森林的判断。如果输入的数据组成的连通分量不是唯一的则不是树,而是森林。5.节点的记录可以使用set。#include"stdio.h"
2016-08-31 17:21:06 525
原创 POJ2033 动态规划
一共三种状态:1。当前数是0的话,只能和之前的数组合,dp[i]=dp[i-2]; 例如11110: 111 102。当前不为0,之前的数不为0并且组合产生的字母不超出范围(11-26),说明这个数既可以和之前组合,也可以不组合,dp[i]=dp[i-2]+dp[i-1] 例如1111有两种分割:11 11 ,111 1。3。当前数不为0,但之前的数为0,之前的
2016-08-31 08:42:05 657
原创 POJ 3233 矩阵运算,等比数列二分求和,矩阵
#include"iostream"#include"stdio.h"#include"string.h"using namespace std;struct Mat{ int res[45][45]; Mat(){memset(res,0,sizeof(res));}}I;int n,m,k;Mat mut(Mat a,Mat b) //矩阵乘法{ Mat
2016-08-31 00:26:51 392
原创 线性表
#include"stdio.h" //非顺序结构 链表#include"stdlib.h"#include"time.h"struct node{ int val; node *next;};int Length(node *head) //长度{ int cnt; node*p=head->next; for(cnt=0;p;p
2016-08-30 21:44:58 207
原创 POJ 1007 排序
#include"stdio.h"#include"iostream"#include"math.h"#include"algorithm"#include"string"using namespace std;typedef long long ll;struct sb{ string a; int t; friend bool operator < (s
2016-08-30 21:42:17 243
原创 POJ 1061 扩展欧几里得
#include"stdio.h"#include"iostream"#include"math.h"#include"algorithm"using namespace std;typedef long long ll;void gcd(ll a,ll b,ll &d,ll &x,ll &y){ if(b==0){d=a;x=1;y=0;return;} ll
2016-08-30 18:29:32 247
原创 我爱...
数学老师写下一句话,“我爱你”,要求改成逆否命题。 我们都说,“你不爱我” “不是的”老师说。 他先把它变成了这种形式,“如果有一个人是我,那么这个人爱你。” 老师接着开始改逆否命题了。 最后一刻,他停笔的瞬间,教室很安静。 “如果一个人不爱你,那么,这个人,不是我”
2016-08-30 15:08:21 384
原创 poj 1565 题目说啥你就做啥!
#include#include"cstdio"#include"string.h"#include"cmath"using namespace std;typedef long long ll;int main(){ char a[1000]; ll ans=0; while(scanf("%s",a)!=EOF) { if(a[0]=
2016-08-30 04:53:54 491
原创 poj 1036 n!/(n-m)!*m!
#include#include"cstdio"using namespace std;typedef long long ll;int main(){ int n,m; while(scanf("%d%d",&n,&m),(n+m)) //n!/(n-m)!m! = 1...m,m+1...n 消 1...m 剩下 m+1...n/1...n-m
2016-08-30 04:43:43 526
原创 POJ 1401 JB蛋疼
#include typedef long long ll;int main(){ int n; int t; scanf("%d",&t); while(t--) { scanf("%d",&n); ll cnt=0; while(n/5) { cnt+=n/
2016-08-29 17:22:04 349
原创 POJ 1845 唯一分解定理
#include using namespace std;typedef unsigned long long llong;const int mod=9901;int p[4000],len=0,top[32][2],tlen;bool s[7072]={true,true};void split(llong n){ tlen=0; int i; for(i
2016-08-29 14:58:08 373
原创 微机原理【一】基本组成
1.存储器:也就是平时说的内存,指令和数据在存储器中存放,CPU核心部件,PC中重要性仅次于CPU,如果CPU相当于电脑的大脑,那么内存就相当于记忆。外存的话感觉就像是书籍,他能保存程序和数据,如果没有内存的话是无法读入CPU。2.指令和数据这个是应用上产生的概念,在内存与外存中指令与数据没有区别,都是二进制信息。但在CPU工作时候,有的信息看做是指令,有的看做是数据,就像
2016-08-29 03:29:14 1469
原创 线段树
#include"stdlib.h"#include"stdio.h"struct tree{ int val; int low,high; tree *lt,*rt;};void build(int left,int right,tree *root)//这棵树是left...right{ root->low=left;root->high=right
2016-08-28 02:23:19 331
原创 二叉树的构造
#include"stdlib.h"#include"stdio.h"struct node{ node* rchild; node *lchild; int val;};void build(node *root) //递归 想法就是建一棵树{ int val; scanf("%d",&val); //输入一个数 如果是0那颗个节点就是空
2016-08-28 01:08:07 420
原创 微积分还是有用的
出处微积分(Calculus)是研究函数的微分、积分以及有关概念和应用的数学分支.微积分是建立在实数、函数和极限的基础上的.微积分最重要的思想就是用"微元"与"无限逼近",好像一个事物始终在变化你不好研究,但通过微元分割成一小块一小块,那就可以认为是常量处理,最终加起来就行. 微积分学是微分学和积分学的总称. 它是一种数学思想,‘无限细分’就是微分,‘无限求和’就是积分.无限就是极限,极限
2016-08-27 22:15:20 1034
原创 UVA 10635 LIS
#include"iostream"#include"stdio.h"#include"vector"#include"functional"#include"string"#include"cstring"#include"algorithm"#include"queue"#include"set"#define f1 cout<<"fuck1"<<endl;#define
2016-08-27 20:55:04 393
原创 POJ 3517 找规律、递推
#include"iostream"#include"stdio.h"#include"vector"#include"functional"#include"string"#include"cstring"#include"algorithm"#include"queue"#include"set"#define f1 cout<<"fuck1"<<endl;#define
2016-08-27 05:09:41 455
原创 POJ 1386 欧拉回路
#include"iostream"#include"stdio.h"#include"vector"#include"functional"#include"string"#include"cstring"#include"algorithm"#include"queue"#include"set"#define f1 cout<<"fuck1"<<endl;#define
2016-08-27 03:59:52 409
原创 UVA 10305 拓扑排序
Ordering TasksTime Limit: 3000MS 64bit IO Format: %lld & %lluSubmit Status uDebugDescriptionProblem descriptions:System Crawler 2016-08-23Ini
2016-08-26 23:07:19 421
原创 VIJOS 1391 SPFA
#include"iostream"#include"stdio.h"#include"vector"#include"functional"#include"string"#include"cstring"#include"algorithm"#include"queue"using namespace std;typedef pair pii;typedef vector
2016-08-26 07:48:35 387
原创 uva 11374 Dijkstra
#include"iostream"#include"stdio.h"#include"vector"#include"functional"#include"string"#include"cstring"#include"algorithm"#include"queue"using namespace std;typedef pair pii;typedef vector
2016-08-26 05:14:16 253
原创 uva 10382 贪心 区间覆盖问题
#include"stdio.h"#include"cmath"#include"algorithm"#include"iostream"using namespace std;struct sgm{ double l; double r; friend bool operator < (const sgm&a,const sgm&b){ if(
2016-08-26 02:16:41 937
原创 VIJOS 1046 Floyd 求最小环
P1046观光旅游Accepted标签:[显示标签]背景湖南师大附中成为百年名校之后,每年要接待大批的游客前来参观。学校认为大力发展旅游业,可以带来一笔可观的收入。描述学校里面有N个景点。两个景点之间可能直接有道路相连,用Dist[I,J]表示它的长度;否则它们之间没有直接的道路相连。这里所
2016-08-24 09:14:11 288
原创 POJ MPI Maelstrom 1502 Dijkstra
MPI MaelstromTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8517 Accepted: 5257DescriptionBIT has recently taken delivery of their new supercomputer, a
2016-08-24 08:37:03 197
原创 UVA 11572尺取法
Unique SnowflakesTime Limit: 2000MS 64bit IO Format: %lld & %lluSubmit Status uDebugDescriptionProblem descriptions:System Crawler 2016-08-22
2016-08-24 02:51:40 424
原创 UVA 10375 唯一分解定理
Choose and divideTime Limit: 3000MS 64bit IO Format: %lld & %lluSubmit Status uDebugDescriptionProblem descriptions:System Crawler 2016-08-19
2016-08-24 02:25:00 315
原创 51NOD 1432 贪心
传送门__________1432 独木舟基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注n个人,已知每个人体重。独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两个人。显然要求总重量不超过独木舟承重,假设每个人体重也不超过独木舟承重,问最少需要几只独木舟?
2016-08-24 00:36:20 222
原创 UVA 524 素数环
简单DFS #include"iostream"#include"stdlib.h"#include"string.h"using namespace std;typedef long long ll;int n;int a[50];int res[50];int visit[50];bool Miller_Rabbin(ll x){ for(int i=2;i*
2016-08-23 22:43:01 387
原创 UVA 10976 枚举
Fractions Again?!Time Limit: 3000MS 64bit IO Format: %lld & %lluDescriptionProblem descriptions:System Crawler 2016-08-19
2016-08-23 22:13:33 392
原创 UVA 11059 枚举
Maximum ProductTime Limit: 3000MS 64bit IO Format: %lld & %lluGiven a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of themaximum p
2016-08-23 21:41:18 673
原创 UVA 725 DFS
DivisionTime Limit: 3000MS 64bit IO Format: %lld & %lluWrite a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0through 9
2016-08-23 21:23:34 354
原创 计蒜客 最大子矩阵
26.65% 1000ms 65536K在一个数组中找出和最大的连续几个数。(至少包含一个数)例如:数组A[] = [−2, 1, −3, 4, −1, 2, 1, −5, 4],则连续的子序列[4,−1,2,1]有最大的和6.输入格式第一行输入一个不超过1000的整数n。第二行输入n个整数A[i]。输出格式第一行输出一个整数,表示最大的和。样例
2016-08-23 08:20:17 846
原创 计蒜客 18题 跳跃游戏
#include"iostream" //无脑的简单枚举 操蛋的地方就是题目上说是停在最后一个下标,其实是包括最后一个下标之后的位置#include"vector"#include"cstdio"using namespace std;int main(){ int n; while(cin>>n) { vectora; a.r
2016-08-23 08:11:26 353
原创 NYOJ 题目14 贪心
会场安排问题时间限制:3000 ms | 内存限制:65535 KB难度:4描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m每组
2016-08-23 07:47:14 466
阿帕奇tomcat8.5
2018-01-22
《模糊数学》.pdf
2016-09-02
android为什么会运行出错
2016-07-20
android中运行程序出错
2016-07-20
为什么new int[4]== new int[4]的boolean值为flase
2016-04-10
hdoj 1007 两点之间最短距离的二分之一 提交之后超时了 求c语言解法 感激不敬
2015-12-04
HDOJ1004 用C语言做的不知道哪错了帮忙看一下问题出在哪里
2015-12-03
为什么 我就将gets换成了scanf就不会出现这样的问题了
2015-11-28
怎么用C语言设计分子量计算例如C6H8O12
2015-11-28
TA创建的收藏夹 TA关注的收藏夹
TA关注的人