06 2013 档案

欧拉路与欧拉回路
摘要:对无向图:定义:给定无孤立结点图G,若存在一条路,经过图中每条边一次且仅仅一次,该条路称欧拉路,若存在一条回路,经过图中每边一次且仅仅一次,该回路称为欧拉回路。具有欧拉回路的图称为欧拉图,不是柏拉图。定理:无向图G具有一条欧拉路,当且仅当G是连通的,且有0个或者是两个奇数度得结点。推论:无向图G具有... 阅读全文

posted @ 2013-06-29 17:22 Stomach_ache 阅读(258) 评论(0) 推荐(0) 编辑

HDU1059
摘要:/** 母函数+优化*/#include#include#define max 20000int c1[max],c2[max];int a[7];int main(){ for(int i=1;;i++){ int sum=0; for(int j=1;j<7;j++){ scanf("... 阅读全文

posted @ 2013-06-29 17:00 Stomach_ache 阅读(99) 评论(0) 推荐(0) 编辑

HDU2056
摘要:/** 指数型母函数*/#include#define mod 100typedef long long LL;//杭电需用int64int powerMod(int a,LL b){ LL ans=1; while(b){ if(b%2){ ans=(ans*a)%mod; } a=(... 阅读全文

posted @ 2013-06-29 16:58 Stomach_ache 阅读(98) 评论(0) 推荐(0) 编辑

HDU1709
摘要:/** 好奇怪的母函数*/#include#include#include#includeusing namespace std;#define max 100*100+10int c1[max],c2[max],a[max];int main(){ int n; while(~scanf("%d... 阅读全文

posted @ 2013-06-29 16:52 Stomach_ache 阅读(105) 评论(0) 推荐(0) 编辑

ubuntu忘记root密码
摘要:解决办法:选择GRUB第2个选项(恢复模式)按e进入编辑模式将ro recovery nomodeset修改成rw single init=/bin/bash然后再按F10进入单用户模式,进入命令行的时候passwd修改密码最后按神键ctrl+alt+del重启即可。 阅读全文

posted @ 2013-06-29 14:14 Stomach_ache 阅读(138) 评论(0) 推荐(0) 编辑

告别水题
摘要:突然发现大一美好的时光马上就要结束了,自己也将成为学长。。。此刻心情无比悲痛,更重要的是似乎期末考试有挂科的风险,可能是花了大量时间在算法学习上,导致成为了一枚学渣,不过还有十天呢哈哈,要努力复习了,同时对于即将步入大二的我来说,也该是和水题说拜拜的时候了。。。暑假集训继续加油!!!!!!!!!!... 阅读全文

posted @ 2013-06-26 16:10 Stomach_ache 阅读(129) 评论(0) 推荐(0) 编辑

POJ2823 单调队列
摘要:#include#define max 1000000+5int a[max],q1[max]/*单调递增*/,q2[max]/*单调递减*/,ans1[max],ans2[max];int n,k,h1,t1,h2,t2;void q1_in(int i){ //入队 while(h1=a[i]... 阅读全文

posted @ 2013-06-26 16:03 Stomach_ache 阅读(98) 评论(0) 推荐(0) 编辑

HDU2699 扩展欧几里德
摘要://赤裸裸,不解释#includetypedef long long LL; //hdu需用int64void gcd(int a,int b,LL& d,LL& x,LL& y){ if(!b){ d=a;x=1;y=0; } else{ gcd(b,a%b,d,y,x); y-=x*(a/... 阅读全文

posted @ 2013-06-26 13:01 Stomach_ache 阅读(120) 评论(0) 推荐(0) 编辑

HDU4355 三分查找
摘要:/** 三分查找*/#include#include#define eps 1e-6//typedef __int64 LL;int n;double x[50005], w[50005];double func(double y){ double res=0; for(int i=0;ieps)... 阅读全文

posted @ 2013-06-25 17:32 Stomach_ache 阅读(115) 评论(0) 推荐(0) 编辑

HDU4004 二分答案
摘要:第一道二分答案。。。今天看了大牛的博客,突然发现有个叫“二分枚举答案”的方法好像很牛,于是便搜了些资料。。发现并不是很难,可能是我了解的只是冰山一脚罢了。。。加油ACMer!!!!#include#include#includeusing namespace std;#define max 5000... 阅读全文

posted @ 2013-06-24 16:25 Stomach_ache 阅读(117) 评论(0) 推荐(0) 编辑

NYoj 613 免费馅饼
摘要:#include#include#define Max(a,b) (a>b?a:b)#define max 100000+5int dp[max][11]; //dp[i][j]表示在i秒时站在j点处可得到的馅饼个数的最大值int map[max][11]; //把每秒钟每个坐标的馅饼个数存储在m... 阅读全文

posted @ 2013-06-23 17:22 Stomach_ache 阅读(102) 评论(0) 推荐(0) 编辑

UVA11549
摘要:在UVA刷的第一题,floyd判圈。。。。。。。#include#includetypedef long long LL;int next(int n,int k){if(!k) return 0;long long k3=(long long)k*k;int a[15],l=0;while(k3>... 阅读全文

posted @ 2013-06-12 22:55 Stomach_ache 阅读(133) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 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 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示