上一页 1 2 3 4 5 6 7 8 ··· 22 下一页
摘要: 链接:https://codeforces.com/contest/670 A - Holidays - [水] AC代码: B - Game of Robots - [水] AC代码: C - Cinema - [离散化+排序] AC代码: D - Magic Powder - [二分] 题解: 阅读全文
posted @ 2019-03-10 00:14 Dilthey 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 链接:https://codeforces.com/contest/1137 A - Skyscrapers 题解:对于每一段 $1$ 和每一段 $2$,统计他们的长度。因此对于相邻的两段长度求较小值,就有可能成为答案,维护所有的可能是答案的最大值即可。 AC代码: B - Circus - [暴力 阅读全文
posted @ 2019-03-09 11:15 Dilthey 阅读(751) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1114/E 题意: 交互题,有一个 $n$ 个整数的打乱顺序后的等差数列 $a[1 \sim n]$,保证公差为正整数,你可以询问不超过 $60$ 次来找到该等差数列的首项和公差。 你可以做的询问有两种: 阅读全文
posted @ 2019-03-08 16:50 Dilthey 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1096/D 题意: 给出一个小写字母组成的字符串,如果该字符串的某个子序列为 $hard$,就代表这个字符串是不好的。 现在你要删掉若干字母,使得字符串是好的,同时删除第 $i$ 个字母会使得歧义程度增加 阅读全文
posted @ 2019-03-07 22:55 Dilthey 阅读(505) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1038/D 题意: 给出 $n$ 个史莱姆,每个史莱姆有一个价值 $a[i]$,一个史莱姆可以吃掉相邻的史莱姆,此时其自身的价值就要减掉被吃掉的那个史莱姆的价值。 史莱姆会不断的互相吞噬直到最后只剩一个,要 阅读全文
posted @ 2019-03-07 21:50 Dilthey 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/279/C 题意: 给出 $n$ 个整数 $a[1 \sim n]$,$m$ 个查询,对于一个查询 $[l_i,r_i]$,对应于子段 $a[l_i], a[l_i+1], \cdots, a[r_i]$,需 阅读全文
posted @ 2019-03-07 20:23 Dilthey 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1132/problem/C 题意: 栅栏有 $n$ 个节,有 $q$ 个人可以雇佣来涂栅栏,第 $i$ 个人可以涂第 $l_i$ 节到第 $r_i$ 节。 但是现在预算紧张,所以只能雇佣 $q-2$ 个人,你想确认雇佣哪 $q 阅读全文
posted @ 2019-03-07 14:24 Dilthey 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/977/F 题意: 给定一个长度为 $n$ 的整数序列 $a[1 \sim n]$,要求你找到一个它最长的一个子序列,该子序列满足单调连续递增。 子序列可以不连续,单调连续递增即例如 $[4,5,6,7]$ 阅读全文
posted @ 2019-03-06 21:22 Dilthey 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/219/C 题意: 给你 $n$ 个方块排成水平一排,每个方块都涂上 $k$ 种颜色中的一种。要求对尽量少的方块进行重新涂色,使得任意两个方块的颜色不同。 题解: $dp[i][x]$ 表示前 $i$ 个方块 阅读全文
posted @ 2019-03-06 17:58 Dilthey 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 链接:http://codeforces.com/contest/1132 A - Regular Bracket Sequence - [水] 题解:首先 "()" 这个的数量多少是没有关系的,但是 "((" 和 "))" 的数量必须是相等的,再然后如果存在 ")(" 的话,"((" 和 "))" 阅读全文
posted @ 2019-03-06 17:33 Dilthey 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/660/C 题意: 给你一个长度为 $n$ 的 $01$ 串 $a$,记 $f(a)$ 表示其中最长的一段连续 $1$ 的长度。 现在你最多可以将串中的 $k$ 个 $0$ 变成 $1$,求操作后的 $f(a 阅读全文
posted @ 2019-03-04 22:50 Dilthey 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/603/A 题意: 给定一个 $01$ 串,我们“交替子序列”为这个串的一个不连续子序列,它满足任意的两个相邻的数字不相等。 现在,我们要对这个 $01$ 串的某一段非空连续子串进行反转操作,即将这一段上的所 阅读全文
posted @ 2019-03-04 21:31 Dilthey 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/777/C 题意: 给定 $n \times m$ 的一个数字表格,给定 $k$ 次查询,要你回答是否存在某一列 $j$,其对应于询问区间 $[l,r]$ 的 $a[l][j], a[l+1][j], \cd 阅读全文
posted @ 2019-03-04 20:34 Dilthey 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 链接: A - Vanya and Fence - [水] AC代码: B - Vanya and Food Processor - [模拟] 应该就是https://www.cnblogs.com/dilthey/p/6804187.html我这篇远古文章中记录的这道题目的来源。 模拟的时候注意不 阅读全文
posted @ 2019-03-02 17:33 Dilthey 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/677/D 题意: 有 $n \times m$ 的网格,每个网格上有一个棋子,棋子种类为 $t[i][j]$,棋子的种类数为 $p$。 现在出发点为 $(1,1)$,必须按照种类 $1 \sim p$ 进行 阅读全文
posted @ 2019-03-02 17:20 Dilthey 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/835/C 题意: 在天空上划定一个直角坐标系,有 $n$ 颗星星,每颗星星都有坐标 $(x_i,y_i)$,星星初始亮度为 $s_i$,所有星星的亮度有个上限 $c$。 在时刻 $0$,每颗星星都是初始亮度 阅读全文
posted @ 2019-03-02 12:10 Dilthey 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/44/E 题意: 给一个字符串,让你分割成 $k$ 行,每行的字母数在 $[a,b]$ 之间。 题解: 这是1500difficulty的DP题? AC代码: 阅读全文
posted @ 2019-03-02 10:53 Dilthey 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/180/C 题意: 有一段字符串,包含大小写字母,每次可以将其中一个字母由大写变成小写,或者小写变成大写。要求这个字符串最终变成任意大写字母都在任意小写字母的前面的情况。问最少变换多少个字母可达到要求。 题解 阅读全文
posted @ 2019-03-02 10:20 Dilthey 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/698/A 题意: 有 $n$ 天假期,每天有四种情况:0、体育馆不开门,没有比赛;1、体育馆不开门,有比赛;2、体育馆开门,没有比赛;3、体育馆开门,有比赛。 每天都可以选择一件事做:休息、去体育馆运动、打 阅读全文
posted @ 2019-03-02 09:44 Dilthey 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1108/D time limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standar 阅读全文
posted @ 2019-02-28 23:59 Dilthey 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P1309 题解: 每次比赛前,每个人都是按照分数降序排好的,那么比赛完后,将选手按输赢分成两组,顺序依然按照原顺序,那么显然组内的分数依然是降序的。只要将两个组重新 $O(n)$ 合并即可。 这种合并类似于归并排 阅读全文
posted @ 2019-02-28 23:32 Dilthey 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://zhixincode.com/contest/14/problem/D?problem_id=206 样例输入 1 5 5 1 2 1 1 3 1 2 4 1 2 5 1 1 5 1 样例输出 1 20 样例输入 1 5 5 1 2 1 1 3 1 2 4 1 2 5 1 阅读全文
posted @ 2019-02-28 22:31 Dilthey 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 链接:http://codeforces.com/contest/1114 A - Got Any Grapes? 题意:甲乙丙三个人吃葡萄,总共有三种葡萄:绿葡萄、紫葡萄和黑葡萄,甲乙丙三个人至少要各自吃 $x,y,z$ 个葡萄,又甲只吃绿葡萄,乙不吃黑葡萄,丙三种颜色都吃。现在总共有 $a$ 个 阅读全文
posted @ 2019-02-26 22:10 Dilthey 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://zhixincode.com/contest/14/problem/I?problem_id=211 样例输入 1 样例输出 1 27 9 6 样例输出 1 题解: 首先,比较明显地是,每进行一次操作 $1$,对于目前的卡牌分配情况的种数,其中的 $1/3$ 种是被撤掉位子 阅读全文
posted @ 2019-02-25 22:53 Dilthey 阅读(433) 评论(1) 推荐(0) 编辑
摘要: 题目链接:https://zhixincode.com/contest/14/problem/A?problem_id=203 time limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard input 阅读全文
posted @ 2019-02-25 20:25 Dilthey 阅读(146) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 22 下一页