随笔分类 - 思维题
摘要:话说现在猪肉价格这么贵,著名的ACBoy 0068 也开始了养猪生活。说来也奇怪,他养的猪一出生第二天开始就能每天中午生一只小猪,而且生下来的竟然都是母猪。不过光生小猪也不行,0068采用了一个很奇特的办法来管理他的养猪场:对于每头刚出生的小猪,在他生下第二头小猪后立...
阅读全文
摘要:有一口井,井的高度为N,每隔1个单位它的宽度有变化。现在从井口往下面扔圆盘,如果圆盘的宽度大于井在某个高度的宽度,则圆盘被卡住(恰好等于的话会下去)。 盘子有几种命运:1、掉到井底。2、被卡住。3、落到别的盘子上方。 盘子的高度也是单位高度。给定井的宽度和每个盘子的...
阅读全文
摘要:Polycarpus has a sequence, consisting of n non-negative integers: a1, a2, ..., an.Let's define function f(l, r) (l, r are integer, 1 ≤...
阅读全文
摘要:You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length a...
阅读全文
摘要:AtCoDeer is thinking of painting an infinite two-dimensional grid in a checked pattern of side K. Here, a checked pattern of side K is...
阅读全文