
找规律
龍木
若人生为棋,我愿为卒,漫漫征途,谁曾见我后退半步
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C 序列卷积之和
给出一个长度为{n}n的数组{a_1,a_2,...,a_n}a1,a2,...,an,计算{\sum_{l=1}^n\sum_{r=l}^n\sum_{i=l}^r\sum_{j=i}^r}a_i*a_j∑l=1n∑r=ln∑i=lr∑j=irai∗aj{mod}mod{1e9+7}1e9+7并输出。输入描述:第一行一个整数{n}n。第二行{n}n个整数{a_1,a_2,...,a_n}a1,a2,...,an。输出描述:输出一行一个整数表示答案...原创 2020-05-23 13:03:15 · 534 阅读 · 0 评论 -
A. Sequence with Digits
链接:https://codeforces.com/contest/1355/problem/ALet's define the following recurrence:an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an).HereminDigit(x)minDigit(x)andmaxDigit(x)maxDigit(x)are the minimal and maximal digits in the...原创 2020-05-17 11:39:35 · 511 阅读 · 0 评论 -
A 张老师和菜哭武的游戏
题目描述天才程序员菜哭武和张老师有一天到一个城市旅游,旅途中菜哭武觉得无聊就想和张老师玩一个游戏。菜哭武有n个石子,每个石子都标有1到n之间到数,且各不相同,一开始他们会随机从这堆石子选一个石子放置到一个集合中,张老师选的数是a,菜哭武选的是b(a和b不相同)。接下来菜哭武和张老师轮流按照如下规则拿走一个石子:当石子x能被拿走时,当且仅当集合存在y和z,满足x等于y+z或者y-z,当x被拿走时,把它放到集合中。谁完成最后一轮操作时,谁获胜。张老师总是先手,于是张老师就好奇当决定好a和b时,他是否总是能.原创 2020-05-10 18:40:12 · 270 阅读 · 0 评论 -
C 答题卡
牛牛即将要参加考试,他学会了填答题卡。可惜他竖着的答题卡填成了横着的 : (好奇的他想知道对于 n 道题,每道题 n 个选项的答题卡 ( n * n 的矩阵 ),满足横答题卡和竖答题卡图形一致的方案数有多少种。注:每道题只能选择一个选项,即 n * n 的矩阵中只能涂黑 n 个空。求横竖对称的方案数。输入描述:第一行给出 n。输出描述:输出方案数,...原创 2020-05-02 13:04:40 · 628 阅读 · 0 评论 -
E. Count The Blocks
链接:https://codeforces.ml/contest/1327/problem/EYou wrote down all integers from00to10n−110n−1, padding them with leading zeroes so their lengths are exactlynn. For example, ifn=3n=3then you wr...原创 2020-03-24 08:34:46 · 676 阅读 · 0 评论 -
A 牛牛与序列计数
链接:https://ac.nowcoder.com/acm/contest/4381/A牛牛特别羡慕那些会计数的选手,作为一个计数非常菜的选手,牛牛也想计数变得这么厉害,然而实在是太菜了。 牛牛最近又被一个简单计数题难住了,这个题目是这样的,现在有红,蓝,黑,白四种颜色的球无数种。牛牛现在想数有多少种长度为nn的序列满足红色和蓝色的球的数量都是偶数个,黑色和白色的球的数量都是奇数...原创 2020-02-21 23:58:20 · 2439 阅读 · 6 评论 -
C. New Year and Permutation
链接:https://codeforces.ml/contest/1284/problem/CRecall that the permutation is an array consisting ofnndistinct integers from11tonnin arbitrary order. For example,[2,3,1,5,4][2,3,1,5,4]is a p...原创 2020-02-18 19:41:16 · 286 阅读 · 0 评论 -
B. Motarack's Birthday
链接:https://codeforces.ml/contest/1301/problem/BDark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an arrayaaofnnnon-negative integers.Da...原创 2020-02-14 05:13:53 · 594 阅读 · 0 评论 -
F 树上博弈
链接:https://ac.nowcoder.com/acm/contest/3005/F现有一个 n 个点,n-1条边组成的树,其中 1 号点为根节点。牛牛和牛妹在树上玩游戏,他们在游戏开始时分别在树上两个不同的节点上。在游戏的每一轮,牛牛先走一步,而后牛妹走一步。他们只能走到没有人的空节点上。如果谁移动不了,就输掉了游戏。现在牛牛和牛妹决定随机选择他们分别的起点,于是他们想知道,有...原创 2020-02-11 18:32:07 · 491 阅读 · 0 评论 -
I 牛牛的汉诺塔
链接:https://ac.nowcoder.com/acm/contest/3004/I汉诺塔是一个经典问题,相传在古印度圣庙中,有一种被称为汉诺塔(Hanoi)的游戏。该游戏是在一块铜板装置上,有三根杆(编号A、B、C),在A杆自下而上、由大到小按顺序放置n个金盘。游戏的目标:把A杆上的金盘全部移到C杆上,并仍保持原有顺序叠好。操作规则:每次只能移动一个盘子,并且在移动过程中三根杆上都始终...原创 2020-02-08 18:17:09 · 631 阅读 · 0 评论