Josephus again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 741 Accepted Submission(s): 210 Problem Description In our Jesephus game, we start with n people numbered 1 to n around a circle…
题目链接:http://poj.org/problem?id=3517 And Then There Was One Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5014 Accepted: 2685 Description Let’s play a stone removing game. Initially, n stones are arranged on a circle and numbered 1, ……
Description Recently you must have experienced that when too many people use the BBS simultaneously, the net becomes very, very slow.To put an end to this problem, the Sysop has developed a contingency scheme for times of peak load to cut off net acc…
Description: 小 D 的家门口有一片果树林,果树上果实成熟了,小 D 想要摘下它们. 为了便于描述问题,我们假设小 D 的家在二维平面上的 (0, 0) 点,所有坐标范围的绝对值不超过 N 的整点坐标上都种着一棵果树.((0, 0) 这个点没有果树) 小 D 先站在 (0, 0) 处,正对着 (1, 0) 的方向. 每次摘果实时,小 D 会逆时针选择他能看到的第 K 棵还未摘取果实的果树,然后向着这个方向走去,在行走的过程中摘下沿路的所有的果树上的果树果实,直到走到果树林的边缘. 接…
UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题) Description Let's play a stone removing game. Initially, n ston…
前两题不想写了 数位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…