自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 收藏
  • 关注

原创 python 邮件发送

很长时间没法博客了,以后有空还是总结一下每天的收获,虽然最近比较懒,但是不记下来太容易忘记了,以后主要当做学习笔记来用。今天学习了一下用Python发送纯文本邮件,明天我尝试一下发送带有图片和附件的形式。主要是利用QQ邮箱的SMTP服务器去发送,所以需要获取QQ邮箱的授权码,这里的授权码不是简单的密码,一开始我还以为是QQ密码。import smtplibfrom email.mime.text...

2018-03-26 20:30:25 158

原创 HDU - 5242 贪心,DFS

这个题比赛的时候没做出来,看到题解的时候说是什么数链抛分,本菜鸟真的没看懂啊,看了看榜首就用一个dfs做的大佬,看了半天都没看懂,写得很难读,不过看了看别的博客的题解,突然就理解了。题意:给你n个节点的值,n - 1条边,然后让找你k条路径,从树根开始(就是1),找出每条路径之和为最大值,但是如果之前走过这个节点,那么这个节点的值就变成了0,这是我第二次看到要正方两次dfs的题,第一个好像是u

2017-04-29 21:46:46 285

原创 [HDU-5241] 大数乘法

找规律。。当时写出了等于1的可能是32个,就感觉是一个规律题,可是值比较大,就用到了大数乘法,然后可以看一看模板。#include #include #include #include #include #include #include #include #include #include using namespace std;struct Node{

2017-04-29 20:08:59 572

原创 HDU-5237 模拟

这个题最重要的就是读懂题意,就是把给的字母Aascii值换为8位二进制,如果换成的总个数不是6的倍数,就在最后加上0变为0的倍数,然后再6位代表一个字符,如果不是4的倍数就加上“=”凑成4的倍数,然后循环k次,注意每次加上的“=”也要计算。#include#include#include#include#include#include#include#include#inclu

2017-04-29 20:05:13 260

原创 HDU-5240

一个简单的贪心,就是判断是否他有足够时间复习,可以间断的复习。#include#include#include#include#include#include#include#include#includeusing namespace std;struct node{ int r, e, l;}edge[500000 + 10];bool cmp(nod

2017-04-29 20:03:38 314

原创 POJ - 2031

题意:给你n个球,如果两个球是接触的那么连接就不花费,如果不是接触的那么就是接触的距离,很容易看出是个最小生成树的。最近对ACM有点迷茫,不知道为什么,感觉看到每个题都感觉很难,也不愿意去思考,有点脑子疼。。很无奈,不知怎么取舍,毕竟我的专业不是专攻这个的。。哎,有点无奈。#include #include #include #include #include #include #

2017-04-26 21:47:11 202

原创 CodeForces-450B

最近想学html,所以做了题也没有写道博客上,今天看了一个及其简单的数学题,不算是找规律题,我都没做出来,心态真的炸了,虽然我也没动笔去找,最近有点懒了,可能跟身体难受有点关系。#include using namespace std;long long a[6];int main(){ int x, y; cin >> x >> y; a[0] = x;

2017-04-25 15:20:50 247

原创 HDU 1241 简单的DFS

题意:寻找连续的@,可以从八个方向寻找,简单的DFS。#include #include #include #include using namespace std;int m, n;int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};int vis[101][101];c

2017-04-22 22:56:29 166

原创 POJ - 1426 思维BFS

题意:就是只有1和0组成的一个数,能整除N.因为答案不唯一,所以可以暴力的用BFS求出来很简单。#include #include #include using namespace std;typedef unsigned long long ull;void bfs(ull n){ queue q; q.push(1); while(!q.empty(

2017-04-22 22:31:25 182 1

原创 POJ-3984 BFS

题意很简单,中文题,我就不解释了,直接看看代码吧,很水的一个BFS题。#include #include #include using namespace std;struct node{ int x, y, father;}edge[60];int dx[] = {0, 0, 1, -1};int dy[] = {1, -1, 0, 0};int s[6][6],

2017-04-22 22:30:07 186

原创 UVA - 1572

对这个题一开始一点思路就没有,钻研了一天别人的代码,真的学到了不少。题意就是给你一定的正方形,然后拼成一个

2017-04-20 15:21:36 402

原创 POJ - 2513 并查集,欧拉回路,字典树

参考博客:http://blog.csdn.net/lyy289065406/article/details/6647445题意:就是给你一些棍棒,每段都有颜色,然后把它们连成一条直线,要求首位相接的两个棍棒颜色要相同。这是个人训练赛的一个题,当时感觉挺简单的,感觉就是一个无向图,但是对于渣渣的我来说根本不知道从哪开始做,后来看了看大佬们的博客才恍然大悟,运用到了不少我不怎么会的知识点,这

2017-04-18 16:04:35 250

原创 HDU - 2074

需要的时候,就把一个个大小差一圈的筐叠上去,使得从上往下看时,边筐花色交错。这个工作现在要让计算机来完成,得看你的了。Input输入是一个个的三元组,分别是,外筐尺寸n(n为满足0Output输出叠在一起的筐图案,中心花色与外筐花色字符从内层起交错相叠,多筐相叠时,最外筐的角总是被打磨掉。叠筐与叠筐之间应有一行间隔。Sample Input11 B A5 @ WSa

2017-04-17 22:38:06 186

原创 HDU 2043

网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。 首先,我们就要设置一个安全的密码。那什么样的密码才叫安全的呢?一般来说一个比较安全的密码至少应该满足下面两个条件: (1).密码长度大于等于8,且不要超过16。 (2).密码中的字符应该来自下面“字符类别”中四组中的至少三组。 这四个字符类别分别为: 1.大写

2017-04-17 22:35:41 194

原创 一些经典的ACM模板

ACM模板

2017-04-17 22:32:28 1491

原创 UVA 1590

#include#include#includeint cmp(const void* a, const void *b){ return *(int *)a - *(int *)b;}int ip[2000][2000] = { 0}, IP[4],A[4];int ta[9] = {255, 254, 252, 248, 240, 224, 192, 128, 0};i

2017-04-16 21:20:35 255

原创 UVA-12108

#include#include#includeint student[200][200]={0};int main(){ int n,kase = 0; while(~scanf("%d", &n)&&n) { int sum = 0; for(int i = 0; i < n; i++) {

2017-04-16 21:19:16 177

原创 UVA 815

#include#includedouble a[2000];int cmp( const void * a, const void *b){ return ((*(double *) a - *(double*)b > 0)?1 : -1);}int main(){ int m, n, kase = 0; while(scanf("%d %d", &n,

2017-04-16 21:18:04 212

原创 POJ 1035

注意:不要用string, 否则超时超的怀疑人生,当时还以为是cin>>的问题后来发现是string导致的,血一样的教训,不要因为方便用stirng!!#include #include #include #include #include using namespace std;char s[10010][70];char exist[10010][70];bool cmp1

2017-04-16 20:53:07 144

原创 POJ - 2251 BFS

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south

2017-04-16 20:47:33 195

原创 CodeForces - 707C (找规律)

Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right tri

2017-04-16 20:44:06 229

原创 HDU - 1875 最小生成树

#include #include #include #include #include #include using namespace std;int fa[1000];typedef pair p;struct edge{ int come, to; double d; bool operator <(const edge &p1)

2017-04-13 21:48:18 170

原创 POJ - 1287 最小生成树 krusal

#include #include #include using namespace std;int fa[1000];struct edge{ int come, to, cost;}d[3000];bool cmp(edge p1, edge p2){ return p1.cost < p2.cost;}int getf(int x){ if(x

2017-04-13 21:13:46 137

原创 POJ - 1321 简单的暴力搜

DFS

2017-04-12 22:13:47 606

原创 POJ - 2236 简单的并查集

并查集简单应用

2017-04-12 21:33:45 200

原创 CodeForces - 767A

According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. She said that at some time n snacks of distinct sizes will fall on the city

2017-04-10 20:01:33 196

原创 kruskal算法模板

#include using namespace std;const int maxn = 66666;int fa[maxn];struct edge{ int from, to, value; bool operator < (const edge & p) { return value < p.value; }}edges[maxn

2017-04-06 21:59:40 154

原创 POJ - 1251 最小生成树

The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so

2017-04-06 21:49:09 158

原创 HDU - 1213

Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a

2017-04-06 21:06:07 147

原创 HDU - 5547

Yi Sima was one of the best counselors of Cao Cao. He likes to play a funny game himself. It looks like the modern Sudoku, but smaller.Actually, Yi Sima was playing it different. First of all, h

2017-04-05 22:27:33 289

原创 HDU - 5546

Yu Zhou likes to play Go with Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go.Here is the rules for ancient go they wer

2017-04-05 22:08:39 188

原创 ZOJ-3878

#include #include #include #include #include #include #include #include using namespace std;char s[] ="~`!1@2#3$4%5^6&7*8(9)0_-+=QqWwEeRrTtYyUuIiOoPp{[}]|\\AaSsDdFfGgHhJjKkLl:;\"\'ZzXxCcVvBbN

2017-04-05 19:51:38 280

原创 ZOJ - 3876

#include#include#include#includeusing namespace std;int year[10000];int panduan(int x){ if(x % 400 == 0 || x % 4 == 0&& x % 100 != 0 ) return 1; return 0;}int main(){ in

2017-04-05 19:49:14 256

原创 ZOJ - 3880

#include #include #include #include #include #include #include using namespace std;int a[2000];int main(){ int cases; int sum = 0; int t; int x; cin >> cases; while(cases

2017-04-05 19:48:21 184

原创 ZOJ - 3869

#include #include #include #include #include #include #include using namespace std;int a[2000];int main(){ int n; cin >> n; int m; for(int i = 1; i <= n; i++) { m

2017-04-05 19:47:09 295

原创 ZOJ - 3870

这个题主要思路就是把每个数的二进制存到一个数组里存起来,因为瞎搞,瞎爆就是超时,当时在场上没做出来,后来看到题解后发现很简单,就是比较考验思路,当然我很菜,在场上没做出来。#include#include#include#include#include#include#include#include#includeusing namespace std;const int ma

2017-04-05 19:45:19 194

原创 UVALive - 7423

比赛的一个水题,英语不好,一开始把题意都错了, 后来改了下就对了,很简单的一个算是贪心的吧,代码如下#include #include #include #include #include #include using namespace std;struct people{ int come, go; bool operator < (const people &

2017-04-04 14:03:10 265 2

原创 并查集模板

#include using namespace std;const int maxn = 66666;// 根据提议去更改int fa[maxn];void inin(){ for(int i = 0; i < maxn; i++) // 数组书初始化,在使用并查集前进行初始化 fa[i] = i;}int find_father(int x) // 获得父

2017-04-01 19:34:18 161

原创 UVA - 294

#includeusing namespace std;const int maxn = 40000;int a[maxn],b[maxn];int sss(int t, int n){ int sum = 1,tt; for(int i = 0; i < n; i++) { tt = 1; if(t%b[i] == 0)

2017-04-01 19:28:02 155

原创 [UVA-11971]

#includeusing namespace std;int yue(long long int tt,long long int t){ if(t == 0) return tt; yue(t, tt% t);}int main(){ long long int n,m ,k; //freopen("222.txt", "

2017-04-01 19:26:06 216

空空如也

空空如也

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

TA关注的人

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