![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
文章平均质量分 64
池南生苍龙
NOTANYONE
展开
-
ZJ1 附加题
题目描述 存在n+1个房间,每个房间依次为房间1 2 3…i,每个房间都存在一个传送门,i房间的传送门可以把人传送到房间pi(1<=pi<=i),现在路人甲从房间1开始出发(当前房间1即第一次访问),每次移动他有两种移动策略: A. 如果访问过当前房间 i 偶数次,那么下一次移动到房间i+1; B. 如果访问过当前房间 i 奇数次,那么移动到房间pi; 现在路人甲想知道移动到房间n+1一共需要多少次移动; 输入描述: 第一行包括一个数字n(30%数据1<=n<=100,100%数据原创 2021-03-05 13:39:09 · 148 阅读 · 0 评论 -
F - Fairy, the treacherous mailman
菜鸡复健 F. Fairy, the treacherous mailman time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Fairy is a very excentric mailman. Every now and then, he likes to change some correspondences that he is respon原创 2021-03-04 16:34:46 · 133 阅读 · 1 评论 -
Brackets Sequence POJ - 1141(经典区间DP)
Let us define a regular brackets sequence in the following way: Empty sequence is a regular sequence. If S is a regular sequence, then (S) and [S] are both regular sequences. If A and B are regular s...原创 2019-08-19 09:59:08 · 121 阅读 · 0 评论 -
Bad Hair Day POJ - 3250 (dp)
Some of Farmer John’s N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top of ...原创 2019-09-02 20:29:35 · 152 阅读 · 0 评论