当前位置:网站首页>Ccf-csp 202203-2 travel plan 100 points difference
Ccf-csp 202203-2 travel plan 100 points difference
2022-06-09 02:43:00 【Confident little screw】
Original link :CCF-CSP 202203-2 Travel plan 
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e5+10;
int a[N];
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n,m,k;
cin>>n>>m>>k;
int ti,c,q;
int num=0;
for(int i=0;i<n;i++)
{
cin>>ti>>c;
int t1=ti+1-k-c>0 ? ti+1-k-c: 0; // First to make nucleic acid
int t2=ti-k>0 ? ti-k:0;// Make nucleic acid at the latest
num=max(num,ti);
if(t1==0 && t2==0) continue;
a[t1]+=1;
a[t2+1]-=1;
}
for(int i=1;i<=num;i++) a[i]+=a[i-1];
while(m--)
{
cin>>q;
cout<<a[q]<<endl;
}
return 0;
}
边栏推荐
- What is a security tag based access control mechanism? What are the characteristics?
- In 2022, along with the Internet layoffs, the digital economy is stepping up. As a digital hub, the Internet of things platform is moving towards the trend of IOT multi system data fusion and integrat
- Leetcode 1352. Product of the last K numbers
- [homeassistant Internet access (cpolar)]
- Period, duration calculation interval
- How does Jerry's SPI slave configure the driver? [chapter]
- Basic usage of flask sqlalmy
- Docker installation redis
- What is the hardware calculation principle of Jerry's ad value? [chapter]
- 杰理之如何修改 ad_key 连接的引脚?【篇】
猜你喜欢

C#中的反射原理及应用

4426 divisible substring (enumeration + number theory)

Jedis tool class, adapting to a single redis and redis cluster

Ccf-csp 201903-2 24:00

Ccf-csp 201803-4 chess game evaluation +dfs

The high-end is weak. Can Yanghe still keep the third place in the industry?
How to implement the project practice of user registration, login and logout in flask + MySQL

Docker安装Redis

21. Class E power amplifier design of ads usage record (medium)

Deux facteurs importants affectant la défaillance de togglerowselection ()
随机推荐
How does Jerry's SPI slave configure the driver? [chapter]
Qt: get sender in slot (the control that triggers signal)
Fight the high vision medical service of HKEx again, the gospel of short-sighted partners?
Exporter les connaissances pertinentes
Dynamic programming / Fibonacci series
C # Fundamentals
Two important influencing factors of togglerowselection() failure
杰理最后io_key 双按键如何使用?【篇】
Rk3399 platform development series explanation (Introduction to kernel) 1.52. Call stack analysis of probe function in platform
杰理之如何修改 ad_key 连接的引脚?【篇】
杰理之SPI 从机如何配置驱动程序?【篇】
The difference between new and newinstance() for creating objects
LeetCode 1155. 擲骰子的N種方法**
动态规划/备忘录方法 n的k拆分 n的最大加数k拆分
Leetcode 974. And K divisible subarray prefix sum
Mysql database connection query join principle
【HomeAssistant外网访问(cpolar)】
Period, duration calculation interval
Binding mode of QT overloaded signal slot function
LeetCode 1155. N ways to roll dice**