Flowers
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1076 Accepted Submission(s): 535
Problem Description
As is known to all, the blooming time and duration varies between different kinds of flowers. Now there is a garden planted full of flowers. The gardener wants to know how many flowers will bloom in the garden in a specific time. But there are too many flowers in the garden, so he wants you to help him.
Input
The first line contains a single integer t (1 For each case, the first line contains two integer N and M, where N (1 In the next N lines, each line contains two integer S
i and T
i (1 i i i, T
i].
In the next M lines, each line contains an integer T
i, means the time of i-th query.
Output
For each case, output the case number as shown and then print M lines. Each line contains an integer, meaning the number of blooming flowers.
Sample outputs are available for more details.
Sample Input
2
1 1
5 10
4
2 3
1 4
4 8
1
4
6
Sample Output
Case #1:
0
Case #2:
1
2
1
Author
Cloud
Source
2012 Multi-University Training Contest 3
Recommend
zhoujiaqi2010
线段树使用hash,这次编程犯了个极其低级的错误,
f[j]写成了f[i]
导致调了一下午,还有build()里面的初始化。
#include
#include
#include
#include
#define N 100300
using namespace std;
class node
{
public:
int l,r,lazy,val;
}root[Npos)
{
r=mid-1;mid=(l+r)/2;
}
else {l=mid+1;mid=(l+r)/2;}
}
}
void build(int t,int l,int r)
{
root[t].l=l;root[t].r=r;
root[t].lazy=0;root[t].val=0;//就是这原先没加上WA
if(root[t].l==root[t].r){root[t].lazy=0;root[t].val=0;return;}
build(t=r)update(t=pos)
query(t
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: 问鼎CodeXGLUE榜单,华为云UniXcoder-VESO-v1算法取得突破
摘要:华为云PaaS技术创新团队基于UniXcoder模型,在公开测试数据集(CodeXGLUE)上的代码搜索任务评测结果上取得突破,在CodeXGLUE榜单上排名中第一。 本文分享自华为云社区《代码语义搜索算法哪家强?华为云UniXcoder-VESO-v1…