会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Running_Time
新博客地址:https://sea96.github.io/
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
30
31
32
33
34
35
36
37
38
···
47
下一页
2015年6月6日
简单水题 POJ 2291 Rotten Ropes
摘要: 题目传送门 1 /* 2 我校oj的源题,看懂题意就很水,贴出来省的再敲:) 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 9 const int MAXN = 1e3 + 10;10 const int...
阅读全文
posted @ 2015-06-06 16:33 Running_Time
阅读(145)
评论(0)
推荐(0)
2015年6月5日
构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root
摘要: 题目传送门 1 /* 2 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const i...
阅读全文
posted @ 2015-06-05 21:43 Running_Time
阅读(136)
评论(0)
推荐(0)
数学/找规律/暴力 Codeforces Round #306 (Div. 2) C. Divisibility by Eight
摘要: 题目传送门 1 /* 2 数学/暴力:只要一个数的最后三位能被8整除,那么它就是答案;用到sprintf把数字转移成字符读入 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 usin...
阅读全文
posted @ 2015-06-05 17:48 Running_Time
阅读(198)
评论(0)
推荐(0)
DFS Codeforces Round #306 (Div. 2) B. Preparing Olympiad
摘要: 题目传送门 1 /* 2 DFS: 排序后一个一个出发往后找,找到>r为止,比赛写了return ; 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #inc...
阅读全文
posted @ 2015-06-05 17:43 Running_Time
阅读(128)
评论(0)
推荐(0)
水题 Codeforces Round #306 (Div. 2) A. Two Substrings
摘要: 题目传送门 1 /* 2 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11...
阅读全文
posted @ 2015-06-05 17:33 Running_Time
阅读(130)
评论(0)
推荐(0)
2015年6月3日
尺取法 POJ 3320 Jessica's Reading Problem
摘要: 题目传送门 1 /* 2 尺取法:先求出不同知识点的总个数tot,然后以获得知识点的个数作为界限, 更新最小值 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using names...
阅读全文
posted @ 2015-06-03 21:16 Running_Time
阅读(232)
评论(0)
推荐(0)
尺取法 POJ 3601 Subsequence
摘要: 题目传送门 1 /* 2 题意:求连续子序列的和不小于s的长度的最小值 3 尺取法:对数组保存一组下标(起点,终点),使用两端点得到答案 4 1. 记录前i项的总和,求[i, p)长度的最小值,用二分找到sum[p] - s[i] >= s的p 5 2...
阅读全文
posted @ 2015-06-03 20:43 Running_Time
阅读(243)
评论(0)
推荐(0)
图论/暴力 Codeforces Beta Round #94 (Div. 2 Only) B. Students and Shoelaces
摘要: 题目传送门 1 /* 2 图论/暴力:这是个连通的问题,每一次把所有度数为1的砍掉,把连接的点再砍掉,总之很神奇,不懂:) 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 con...
阅读全文
posted @ 2015-06-03 19:00 Running_Time
阅读(276)
评论(0)
推荐(0)
DP Codeforces Round #260 (Div. 1) A. Boredom
摘要: 题目传送门 1 /* 2 题意:选择a[k]然后a[k]-1和a[k]+1的全部删除,得到点数a[k],问最大点数 3 DP:状态转移方程:dp[i] = max (dp[i-1], dp[i-2] + (ll) i * cnt[i]); 4 只和x-1,x-2有关,...
阅读全文
posted @ 2015-06-03 17:46 Running_Time
阅读(151)
评论(0)
推荐(0)
stack(数组模拟) POJ 2559 Largest Rectangle in a Histogram
摘要: 题目传送门 1 /* 2 题意:宽度为1,高度不等,求最大矩形面积 3 stack(数组模拟):对于每个a[i]有L[i],R[i]坐标位置 表示a[L[i]] 7 #include 8 #include 9 #include 10 #include 11 using name...
阅读全文
posted @ 2015-06-03 16:15 Running_Time
阅读(280)
评论(0)
推荐(0)
贪心+stack Codeforces Beta Round #5 C. Longest Regular Bracket Sequence
摘要: 题目传送门 1 /* 2 题意:求最长括号匹配的长度和它的个数 3 贪心+stack:用栈存放最近的左括号的位置,若是有右括号匹配,则记录它们的长度,更新最大值,可以在O (n)解决 4 详细解释:http://blog.csdn.net/taoxin52/article/d...
阅读全文
posted @ 2015-06-03 14:10 Running_Time
阅读(174)
评论(0)
推荐(0)
2015年6月2日
暴力/DP Codeforces Beta Round #22 (Div. 2 Only) B. Bargaining Table
摘要: 题目传送门 1 /* 2 题意:求最大矩形(全0)的面积 3 暴力/dp:每对一个0查看它左下的最大矩形面积,更新ans 4 注意:是字符串,没用空格,好事多磨,WA了多少次才发现:( 5 详细解释:http://www.cnblogs.com/cszlg/p/321...
阅读全文
posted @ 2015-06-02 21:10 Running_Time
阅读(220)
评论(0)
推荐(0)
DFS Codeforces Round #299 (Div. 2) B. Tavas and SaDDas
摘要: 题目传送门 1 /* 2 DFS:按照长度来DFS,最后排序 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std;11 12 const int ...
阅读全文
posted @ 2015-06-02 18:58 Running_Time
阅读(152)
评论(0)
推荐(0)
二分搜索 Codeforces Round #299 (Div. 2) C. Tavas and Karafs
摘要: 题目传送门 1 /* 2 题意:给定一个数列,求最大的r使得[l,r]的数字能在t次全变为0,每一次可以在m的长度内减1 3 二分搜索:搜索r,求出sum 7 #include 8 #include 9 #include 10 using namespace std;11 12...
阅读全文
posted @ 2015-06-02 17:42 Running_Time
阅读(142)
评论(0)
推荐(0)
2015年6月1日
水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas
摘要: 题目传送门 1 /* 2 很简单的水题,晚上累了,刷刷水题开心一下:) 3 */ 4 #include 5 using namespace std; 6 7 char s1[11][10] = {"zero", "one", "two", "three", "four", "five",...
阅读全文
posted @ 2015-06-01 21:25 Running_Time
阅读(125)
评论(0)
推荐(0)
上一页
1
···
30
31
32
33
34
35
36
37
38
···
47
下一页
公告