题意:有h×w大的公告板.有n条公告要写入,每条公告高度都是1,宽度是wi,每次从最上最左的空位写,假设有空位输出第几行.假设没有足够空位输出-1. 题解:注意h最大1e9.但事实上是看n的大小.由于假设有n条公告最多占n行,所以线段树最大是min(h,n). #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 200005; int h…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13382 Accepted Submission(s): 5770 Problem Description At the entrance to the university, there is a huge rectangular billboard of s…
Billboard Time Limit:8000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 2795 Appoint description: System Crawler (2015-04-10) Description At the entrance to the university, there is a huge rectangular billb…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19225 Accepted Submission(s): 8042 Problem Description At the entrance to the university, there is a huge rectangular billboard of…
Billboard Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2795 Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795 Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13050 Accepted Submission(s): 5651 Problem Description At the entrance to the un…
h*w的木板,放进一些1*L的物品,求每次放空间能容纳且最上边的位子. 每次找能放纸条而且是最上面的位置,询问完以后可以同时更新,所以可以把update和query写在同一个函数里. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; + ; ]; int h, w, n, qL, qR, v; void build(int o, int L, int R) { i…
题目大意:有一个h*w的公告榜,可以依次在上面添加信息.每个信息的长度为x,高为1. 优先在最上面加入,如果空间足够的话,然后优先放在最左面.统计每条公告最终的位置,即它所在的行数. 这里是线段树来存储 当前区间(i,j)的所有位置,剩余的最大空间. 初始化即为w,公告榜的宽. Problem Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is…