题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1081 To The Max Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8839 Accepted Submission(s): 4281 Problem Description Given a two-dimensional ar…
题目链接:https://codeforces.com/contest/1245/problem/F 题意:给定一个区间(L,R),a.b两个数都是属于区间内的数,求满足 a + b = a ^ b 的实数对个数. 题解:看到求区间内满足一定条件的数的个数,应该用数位dp,数位dp基本操作是编写出solve函数调用记忆化搜索,那么考虑solve(R,R)是求0到R满足条件的答案,solve(L-1,R)求a属于0到L-1,b属于0到R满足条件的答案,solve(L-1,L-1)是ab都属于0到L…
先上代码 b站讲解视频 灯神讲背包 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; // 规模 int n, m; // n为件数 m为背包总容量 int f[N][N]; int v[N], w[N]; // 体积v 和 价值w int main() { cin >> n >> m; for…
D. Make The Fence Great Again time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have a fence consisting of nn vertical boards. The width of each board is 11. The height of the ii-th boar…
F - City Game Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1505 Appoint description: Description Bob is a strategy game programming specialist. In his new city building game the gaming enviro…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10961 Accepted Submission(s): 4863 Problem Description At the entrance to the university, there is a huge rectangular billboard of s…
红色来源于山脉,象征着狂躁.愤怒.混乱,血雨腥风,电光火石. 蓝色来源于海岛,象征着控制.幻觉.诡计,运筹帷幄,谋定后动. 绿色来源于树林,象征着生命.蛮力.成长,横冲直撞,生生不息. 黑色来源于沼泽,象征着死亡.贪婪.腐败,追求卓越,不计代价. 白色来源于平原,象征着秩序.公平.正义,携手共进,稳中求胜. 现在,你作为一名新星鹏洛客,找到了一块绝佳的修炼地.这块地方可以被描述成一个 n x m 的矩形.你已经在这块地中的一些位置打好了标记.接下去,就该对整块地赋予你的颜色了.一个…
D. Vanya and Treasure time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room locat…
Mobile phones Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 14391 Accepted: 6685 Description Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The…