会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Fy1999
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
15
16
17
18
19
2018年4月3日
A - Til the Cows Come Home
摘要: 题目链接:https://vjudge.net/contest/215608#problem/A Dijkstra算法 1 #include <iostream> 2 #include <cstdio> 3 const int inf=0x3f3f3f3f; 4 const int maxn=1<<
阅读全文
posted @ 2018-04-03 11:06 Somnus、M
阅读(135)
评论(0)
推荐(0)
2018年4月1日
Dijkstra算法
摘要: 邻接矩阵版 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 const int maxn=1010; 6 const int INF=0x3f3f3f3f; 7 int n,m,s,G[maxn][maxn];//n为顶点数,m为边数,
阅读全文
posted @ 2018-04-01 15:42 Somnus、M
阅读(96)
评论(0)
推荐(0)
2018年3月27日
[AtCoder Beginner Contest 091]B - Two Colors Card Game(STL map)
摘要: 题目链接:https://abc091.contest.atcoder.jp/tasks/abc091_b #include <iostream> #include <map> using namespace std; int n, m, mx; string s[105], t; map<stri
阅读全文
posted @ 2018-03-27 11:35 Somnus、M
阅读(131)
评论(0)
推荐(0)
[kuangbin] M - Find a way(简单广搜)
摘要: 题目链接:https://vjudge.net/contest/215603#problem/M 其中三维数组dis将两个广搜合并到了一起
阅读全文
posted @ 2018-03-27 11:28 Somnus、M
阅读(187)
评论(0)
推荐(0)
2018年3月15日
子集生成-增量构造法||位向量法
摘要: 位向量法:
阅读全文
posted @ 2018-03-15 20:07 Somnus、M
阅读(320)
评论(0)
推荐(0)
2018年2月6日
7622:求排列的逆序数 C++
摘要: 题目链接http://noi.openjudge.cn/ch0204/7622/ 该题只需先进行归并排序,因为如果a[p1]>a[p2]说明a[p2]比区间[p1,m]中的任何元素都小,且p1在p2之前,所以能得出m-p1+1个逆序对。所以在合并区间时加上tot+=mid-i+1; 即可 参考代码:
阅读全文
posted @ 2018-02-06 23:17 Somnus、M
阅读(2928)
评论(0)
推荐(0)
2018年1月4日
素数打表法
摘要: 素数打表法适合求一个区间内素数的范围,防止超时
阅读全文
posted @ 2018-01-04 17:03 Somnus、M
阅读(457)
评论(0)
推荐(0)
2017年12月26日
埃式筛选法求素数
摘要: #include #include #define max 10000000 #define bool char //定以bool类型 #define true 1 #define false 0 //规定1为对0为错(c语言中没有bool函数) int prime[max]; bool is_prime[max]; int sieve(int n) { int...
阅读全文
posted @ 2017-12-26 11:18 Somnus、M
阅读(537)
评论(0)
推荐(0)
上一页
1
···
15
16
17
18
19
公告