King's Order Accepts: 381 Submissions: 1361 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description After the king's speech , everyone is encouraged. But the war is not over. The king needs to give orders…
King's Cake Accepts: 967 Submissions: 1572 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description It is the king's birthday before the military parade . The ministers prepared a rectangle cake of size n×m…
Problem Description It is the king's birthday before the military parade . The ministers prepared a rectangle cake of size n×m(1≤n,m≤10000) . The king plans to cut the cake himself. But he has a strange habit of cutting cakes. Each time, he will cut…
Problem Description After the king's speech , everyone is encouraged. But the war is not over. The king needs to give orders from time to time. But sometimes he can not speak things well. So in his order there are some ones like this: "Let the group-…
King's Game  Accepts: 249  Submissions: 671  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 为了铭记历史,国王准备在阅兵的间隙玩约瑟夫游戏.它召来了 n(1\le n\le 5000)n(1≤n≤5000) 个士兵,逆时针围成一个圈,依次标号 1, 2, 3 ... n1,2,3...n. 第一轮第一个人从 11 开始报数,报…
King's Phone  Accepts: 310  Submissions: 2980  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 阅兵式上,国王见到了很多新奇东西,包括一台安卓手机.他很快对手机的图形解锁产生了兴趣. 解锁界面是一个 3 \times 33×3 的正方形点阵,第一行的三个点标号 1, 2, 31,2,3,第二行的三个点标号 4, 5, 64,5…
国王演讲后士气大增,但此时战争还没有结束,国王时不时要下发命令. 由于国王的口吃并没有治愈,所以传令中可能出现:“让第三军-军-军,到前线去” 这样的命令.由于大洋国在军队中安插了间谍 , 战事紧急,很多时候前线的指挥官不能分清哪些命令真正来自国王.但国王的命令有一个特点,他每次连续重复的字符最多 333 次. 所以说他的命令中没有:“让第三军-军-军-军 , 到前线去”,但是可以有 :“让第三军-军 , 到前线去” . 此时将军找到了你,你需要告诉他,给定命令的长度长度为 n,有多少种不同的命…
前两题不想写了 数位DP 1003 King's Order 考虑i的后缀有j个连续,转移状态很简单,滚动数组优化(其实不用) #include <bits/stdc++.h> const int N = 2e3 + 5; const int MOD = 1000000007; int dp[2][27][4]; void add(int &a, int b) { a += b; if (a >= MOD) a -= MOD; } int main() { int T; scan…
Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 354    Accepted Submission(s): 100 Problem Description ZYB has a tree with N nodes,now he wants you to solve the numbers of nodes distanced no m…
题目链接: http://codeforces.com/problemset/problem/8/C C. Looking for Order time limit per test:4 secondsmemory limit per test:512 megabytes 问题描述 Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready f…