专栏文章

题解:P14129 [SCCPC 2021] True Story

P14129题解参与者 1已保存评论 0

文章操作

快速查看文章及其快照的属性,并进行相关操作。

当前评论
0 条
当前快照
1 份
快照标识符
@minq92r2
此快照首次捕获于
2025/12/02 06:35
3 个月前
此快照最后确认于
2025/12/02 06:35
3 个月前
查看原文

P14129 [SCCPC 2021] True Story题解

这题其实并不难,只需要理解题意就行啦~~~
CPP
#include <iostream>
using namespace std;
const int N=1e5+10;
long long n,k,l,f,t[N],p[N],y[N],ans;
int main() {
	cin>>n>>k>>l>>f;
	int s;
	for(int i=1;i<=n;++i){
		cin>>s;
		t[i]=l/s;
		if(l%s!=0){
			t[i]++;
		}
	}
	for(int i=1;i<=k;++i){
		cin>>y[i];
	}
	for(int i=1;i<=k;++i){
		cin>>p[i];
	}
	y[0]=0;
	p[0]=f;
	long long mx=0;
	for(int i=0;i<=k;++i){
		mx=max(mx,p[i]-y[i]);
	}
	for(int i=1;i<=n;++i){
		if(t[i]<=mx)ans++;
	}cout<<ans;
	return 0;
}

评论

0 条评论,欢迎与作者交流。

正在加载评论...