会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Running_Time
新博客地址:https://sea96.github.io/
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
28
29
30
31
32
33
34
35
36
···
47
下一页
2015年6月23日
Tarjan UVALive 6511 Term Project
摘要: 题目传送门 1 /* 2 题意:第i个人选择第a[i]个人,问组成强联通分量(自己连自己也算)外还有多少零散的人 3 有向图强联通分量-Tarjan算法:在模板上加一个num数组,记录每个连通分量的点数,若超过1,则将连通点数相加 4 用总点数-ans则是零散的点 5...
阅读全文
posted @ 2015-06-23 16:46 Running_Time
阅读(176)
评论(0)
推荐(0)
2015年6月21日
DP UVALive 6506 Padovan Sequence
摘要: 题目传送门/* 题意:两行数字,相邻列一上一下,或者隔一列两行都可以,从左到右选择数字使和最大 DP:状态转移方程:dp[i][j] = max (dp[i][j], dp[1-i][j-1] + a[i][j], dp[i/1-i][j-2] + a[i][j]); 要从前面一个...
阅读全文
posted @ 2015-06-21 21:37 Running_Time
阅读(163)
评论(0)
推荐(0)
找规律 UVALive 6506 Padovan Sequence
摘要: 题目传送门 1 /* 2 找规律:看看前10项就能看出规律,打个表就行了。被lld坑了一次:( 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #includ...
阅读全文
posted @ 2015-06-21 21:29 Running_Time
阅读(191)
评论(0)
推荐(0)
2015年6月19日
水题 Codeforces Round #308 (Div. 2) A. Vanya and Table
摘要: 题目传送门 1 /* 2 水题:读懂题目就能做 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #includ...
阅读全文
posted @ 2015-06-19 11:44 Running_Time
阅读(145)
评论(0)
推荐(0)
数学 Codeforces Round #308 (Div. 2) B. Vanya and Books
摘要: 题目传送门 1 /* 2 水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:) 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 ...
阅读全文
posted @ 2015-06-19 11:41 Running_Time
阅读(115)
评论(0)
推荐(0)
暴力/进制转换 Codeforces Round #308 (Div. 2) C. Vanya and Scales
摘要: 题目传送门 1 /* 2 题意:问是否能用质量为w^0,w^1,...,w^100的砝码各1个称出重量m,砝码放左边或在右边 3 暴力/进制转换:假设可以称出,用w进制表示,每一位是0,1,w-1。w-1表示砝码与物品放在一起,模拟判断每位是否ok 4 详细解释:http:/...
阅读全文
posted @ 2015-06-19 11:36 Running_Time
阅读(134)
评论(0)
推荐(0)
我的ACM 之大一
该文被密码保护。
阅读全文
posted @ 2015-06-19 00:25 Running_Time
阅读(51)
评论(1)
推荐(0)
2015年6月15日
暴力/图论 hihoCoder 1179 永恒游戏
摘要: 题目传送门 1 /* 2 暴力:也是暴力过了,无语。无向图,两端点都要加度数和点 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 typedef long...
阅读全文
posted @ 2015-06-15 10:37 Running_Time
阅读(210)
评论(0)
推荐(0)
暴力 hihoCoder 1178 计数
摘要: 题目传送门 1 /* 2 暴力:这题真是醉了,直接暴力竟然就可以了!复杂度不会分析,不敢写暴力程序。。 3 枚举x,在不重复的情况下+ans,超过范围直接break 4 */ 5 #include 6 #include 7 #include 8 #include...
阅读全文
posted @ 2015-06-15 10:33 Running_Time
阅读(147)
评论(0)
推荐(0)
模拟 hihoCoder 1177 顺子
摘要: 题目传送门 1 /* 2 模拟:简单的照着规则做就可以了,把各种情况考虑到,虽然比赛写的丑了点,但能1Y还是很开心的:) 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace st...
阅读全文
posted @ 2015-06-15 10:28 Running_Time
阅读(255)
评论(0)
推荐(0)
2015年6月13日
Kuskal/Prim POJ 1789 Truck History
摘要: 题目传送门题意:给出n个长度为7的字符串,一个字符串到另一个的距离为不同的字符数,问所有连通的最小代价是多少分析:Kuskal/Prim: 先用并查集做,简单好写,然而效率并不高,稠密图应该用Prim而且要用邻接矩阵,邻接表的效率也不高。裸题但题目有点坑爹:(Kruskal:#include #in...
阅读全文
posted @ 2015-06-13 16:58 Running_Time
阅读(210)
评论(0)
推荐(0)
字符串处理/贪心 Codeforces Round #307 (Div. 2) B. ZgukistringZ
摘要: 题目传送门 1 /* 2 题意:任意排列第一个字符串,使得有最多的不覆盖a/b字符串出现 3 字符串处理/贪心:暴力找到最大能不覆盖的a字符串,然后在b字符串中动态得出最优解 4 恶心死我了,我最初想输出最多的a,再最多的b,然而并不能保证是最多的:( 5 */ 6 #inc...
阅读全文
posted @ 2015-06-13 14:23 Running_Time
阅读(188)
评论(0)
推荐(0)
水题 Codeforces Round #307 (Div. 2) A. GukiZ and Contest
摘要: 题目传送门 1 /* 2 水题:开个结构体,rk记录排名,相同的值有相同的排名 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #in...
阅读全文
posted @ 2015-06-13 14:22 Running_Time
阅读(182)
评论(0)
推荐(0)
2015年6月11日
图论/位运算 Codeforces Round #285 (Div. 2) C. Misha and Forest
摘要: 题目传送门 1 /* 2 题意:给出无向无环图,每一个点的度数和相邻点的异或和(a^b^c^....) 3 图论/位运算:其实这题很简单。类似拓扑排序,先把度数为1的先入对,每一次少一个度数 4 关键在于更新异或和,精髓:a ^ b = c -> a ...
阅读全文
posted @ 2015-06-11 19:50 Running_Time
阅读(160)
评论(0)
推荐(0)
字符串处理 Codeforces Round #285 (Div. 2) B. Misha and Changing Handles
摘要: 题目传送门 1 /* 2 题意:给出一系列名字变化,问最后初始的名字变成了什么 3 字符串处理:每一次输入到之前的找相印的名字,若没有,则是初始的,pos[m] 数组记录初始位置 4 在每一次更新时都把初始pos加上去,那么就保证更新了初始的名字,这也...
阅读全文
posted @ 2015-06-11 19:48 Running_Time
阅读(180)
评论(0)
推荐(0)
上一页
1
···
28
29
30
31
32
33
34
35
36
···
47
下一页
公告