随笔分类 -  思维题

摘要:Black & White · 题解: 阅读全文
posted @ 2019-05-05 20:54 *starry* 阅读(208) 评论(2) 推荐(0)
摘要:蓝桥杯 表格计算 某次无聊中, atm 发现了一个很老的程序。这个程序的功能类似于 Excel ,它对一个表格进行操作。不妨设表格有 n 行,每行有 m 个格子。每个格子的内容可以是一个正整数,也可以是一个公式。公式包括三种:1. SUM(x1,y1:x2,y2) 表示求左上角是第 x1 行第 y1 阅读全文
posted @ 2019-04-19 16:21 *starry* 阅读(558) 评论(0) 推荐(0)
摘要:Query on A Tree HDU - 6191 Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 1732 Accepted Subm 阅读全文
posted @ 2019-04-14 09:38 *starry* 阅读(280) 评论(0) 推荐(0)
摘要:CSL 的字符串 题解: 从前往后扫一遍 如果当前这个字符本身就是到当前为止第一次出现的,那肯定要留下它吧,就把它放到ans数组里面,并且把这个字母的个数减一(最开始统计的每个字母出现的个数相当于每个字母的剩余个数)然后从这个字母开始遍历ans数组中该字母前面的所有字母 ,如果前面的字母的字典序大于 阅读全文
posted @ 2019-04-01 16:29 *starry* 阅读(259) 评论(0) 推荐(0)
摘要:美食 链接:https://ac.nowcoder.com/acm/contest/332/D 题目描述 小B喜欢美食。 现在有n个美食排成一排摆在小B的面前,依次编号为1..n,编号为i的食物大小为 a[i] ,即足够小B吃 a[i] 口。 小B每次会吃两口,这两口要么是编号相同的美食,要么是编号 阅读全文
posted @ 2019-02-13 23:41 *starry* 阅读(427) 评论(0) 推荐(0)
摘要:区间或和 链接:https://ac.nowcoder.com/acm/contest/332/G 题目描述 求a|(a+1)|(a+2)|...|(b-1)|b。 其中|表示[按位或](https://baike.baidu.com/item/%E6%8C%89%E4%BD%8D%E6%88%96 阅读全文
posted @ 2019-02-13 23:36 *starry* 阅读(137) 评论(0) 推荐(0)
摘要:Applese 的回文串 链接:https://ac.nowcoder.com/acm/contest/330/I 题目描述 自从 Applese 学会了字符串之后,精通各种字符串算法,比如……判断一个字符串是不是回文串。 这样的题目未免让它觉得太无聊,于是它想到了一个新的问题。 如何判断一个字符串 阅读全文
posted @ 2019-02-13 14:51 *starry* 阅读(181) 评论(0) 推荐(0)
摘要:处女座与复读机 链接:https://ac.nowcoder.com/acm/contest/327/G 题目描述 一天,处女座在牛客算法群里发了一句“我好强啊”,引起无数的复读,可是处女座发现复读之后变成了“处女座好强啊”。处女座经过调查发现群里的复读机都是失真的复读机,会固定的产生两个错误。一个 阅读全文
posted @ 2019-02-13 14:31 *starry* 阅读(293) 评论(0) 推荐(0)
摘要:处女座的砝码 链接:https://ac.nowcoder.com/acm/contest/327/C 题目描述 处女座热爱做物理实验,为了实验,处女座必须要精确的知道物品的质量。处女座准备自己设计一套砝码,每一个砝码都是正整数,这套砝码必须能够精确测量出n以内所有正整数的质量,处女座想要知道至少需 阅读全文
posted @ 2019-02-13 14:26 *starry* 阅读(221) 评论(0) 推荐(0)
摘要:A Dangerous Maze LightOJ - 1027 You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for 阅读全文
posted @ 2019-02-11 13:30 *starry* 阅读(407) 评论(0) 推荐(0)
摘要:Dice (III) LightOJ - 1248 Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at 阅读全文
posted @ 2019-02-11 13:26 *starry* 阅读(482) 评论(0) 推荐(0)
摘要:The Dominant Color 链接:https://www.nowcoder.com/questionTerminal/0495013675774f008541ea371eb5af17来源:牛客网Behind the scenes in the computer's memory, colo 阅读全文
posted @ 2019-02-08 11:43 *starry* 阅读(263) 评论(0) 推荐(0)
摘要:Resistors in Parallel 题目: ACM-ICPC Jiaozuo Onsite 2018 题解:因为题目数据范围很大,所以猜测应该是一个区间一个固定的最小值。问题转换成了如何求某个最小值影响的区间。坤神一眼看出,应该通过素数求,因为一个数的因子有很多,但是所有的因子都可以通过该数 阅读全文
posted @ 2018-12-10 09:11 *starry* 阅读(392) 评论(0) 推荐(0)
摘要:CS Course HDU - 6186 Little A has come to college and majored in Computer and Science. Today he has learned bit-operations in Algorithm Lessons, and h 阅读全文
posted @ 2018-12-07 17:41 *starry* 阅读(322) 评论(0) 推荐(0)
摘要:Ilya Muromets Gym - 100513F Силачом слыву недаром — семерых одним ударом! From the Russian cartoon on the German fairy tale. Силачом слыву недаром — с 阅读全文
posted @ 2018-12-05 11:52 *starry* 阅读(514) 评论(0) 推荐(0)
摘要:Election of a Mayor Gym - 100513E The Berland capital is preparing for mayoral election. There are two candidates for the position: the current mayor 阅读全文
posted @ 2018-12-05 11:30 *starry* 阅读(299) 评论(0) 推荐(0)
摘要:Beauty of Array ZOJ - 3872 Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the a 阅读全文
posted @ 2018-12-03 20:03 *starry* 阅读(317) 评论(0) 推荐(0)
摘要:小乐乐和25 链接:https://ac.nowcoder.com/acm/contest/301/J来源:牛客网 题目描述 小乐乐特别喜欢25这个数字,他想把所有的数字都变成25的倍数。 现在小乐乐得到一个数字,想问问你最少用几次操作才可以把这个数字改造成25的倍数。 对于一次操作我们可以把相邻的 阅读全文
posted @ 2018-12-02 16:45 *starry* 阅读(160) 评论(0) 推荐(0)
摘要:Team Formation ZOJ - 3870 For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students 阅读全文
posted @ 2018-11-29 11:51 *starry* 阅读(357) 评论(0) 推荐(0)
摘要:Polo the Penguin and XOR operation CodeForces - 288C Little penguin Polo likes permutations. But most of all he likes permutations of integers from 0  阅读全文
posted @ 2018-11-25 11:06 *starry* 阅读(258) 评论(0) 推荐(0)