本人真名: 马一逍
日记本:
2022-07-04: 入坑洛谷
2022-07-10 13:32:43: 第1次提交
2022-07-10 13:32:43: 第1次CE
2022-07-10 13:37:27: 第1次AC
2022-07-10 13:37:27: 第1次AC入门 (呵呵)
2022-07-10 14:46:28: 第1次WA
2022-07-16 13:32:27: 10次提交
2022-07-17 13:17:06: 10次AC
2022-07-24 14:52:10: 第1次AC普及+/提高(在练背包…)
2022-07-24 15:23:08: 第1次AC普及-
2022-07-30 17:53:48: 100次提交
2022-11-12 21:04:47: 第1次AC提高+/省选- (我生日)
2022-11-17: CSP-J画线, 分数150, 成都215 1=(第二题爆零了好烦)
2022-11-19: 估值130
2022-12-17 14:50:40:第100次AC(一道UVA的题)
2023-07-19 估值105祭
2024-06-23 估值152祭
javascript:localStorage.cp6_player_id=“2f6a5c4b-6b6f-47a7-89ef-3890b7369d6d”
18293f9a-5f8c-438c-8182-a655afbe0da8
javascript:localStorage.cp6_player_id=“fa8bf3a2-b4d3-423e-baed-3f66971b7bdc”
dc28e36926bcf73909a74cefa1bd738904ae47ca1e6b4b137dd43c72741c9946
Atcoder题单 https://www.kdocs.cn/l/ccFkEAanKIu1
https://www.geogebra.org/classic?lang=zh_CN
https://www.kdocs.cn/l/ccFkEAanKIu1
Issac_hzc password_easy
#include <bits/stdc++.h>
using namespace std;
using LD=long double;
using PII=pair<int, int>;
#define cst const
#define sttc static
#define FOR(i, s, e) for (int i=int(s);i<=int(e);i++)
#define _FOR(i, s, e) for (int i=int(s);i>=int(e);i--)
cst PII mpt={-1, -1};
int n, m, L, V;
vector<int> s, v0, a, p;
inline PII set_period(cst LD &le, cst int &ri, cst bool &can_devide, cst int &itle){
if (can_devide)return {itle+1, ri};
else return {ceil(le), ri};
}
inline PII set_period(cst int &le, cst LD &ri, cst bool &can_devide, cst int &itri){
if (can_devide)return {le, itri-1};
else return {le, floor(ri)};
}
PII get_period(cst int &s, cst int &v0, cst int &a){
if (!a){
if (v0>V)return {s, L};
else return mpt;
}
sttc LD S, d; S=LD(V*V-v0*v0)/(a*2), d=s+S;
sttc int itd; itd=(V*V-v0*v0)/(a*2)+s;
sttc bool can_devide; can_devide=!((V*V-v0*v0)%(a*2));
if (a>0){
if (v0>V)return {s, L};
if (L<d) return mpt;
else return set_period(d, L, can_devide, itd);
}
else{
if (v0<V)return mpt;
if (L<d) return {s, L};
else return set_period(s, d, can_devide, itd);
}
}
PII get_check(cst int &i){
sttc PII period; period=get_period(s[i], v0[i], a[i]);
if (period==mpt)return mpt;
sttc int id1, id2; id1=lower_bound(p.begin(), p.end(), period.first)-p.begin();
id2=prev(upper_bound(p.begin(), p.end(), period.second))-p.begin();
if (p[id1]>period.second || p[id2]<period.first || id1>id2)return mpt;
// cerr<<id1<<" "<<id2<<endl;
return {id1, id2};
}
vector<PII> cur;
void solve(){
cin>>n>>m>>L>>V, s.resize(n+1), v0.resize(n+1), a.resize(n+1), p.resize(m+1), cur.clear();
FOR (i, 1, n)cin>>s[i]>>v0[i]>>a[i];//, cerr<<"debug "<<get_period(s[i], v0[i], a[i]).first<<" "<<get_period(s[i], v0[i], a[i]).second<<endl;
FOR (i, 1, m)cin>>p[i];p[0]=-1, sort(p.begin(), p.end());
sttc PII c;
FOR (i, 1, n){
c=get_check(i);
if (c==mpt)continue;
else cur.push_back(c);
}
printf("%lu ", cur.size());
// sort(cur.begin(), cur.end());
// cerr<<endl<<"debug:"<<endl;
// for (cst auto &c:cur)cerr<<c.first<<" "<<c.second<<endl;
// cerr<<endl<<endl;
sttc int last, ans;last=-1, ans=0;
for (cst auto &c:cur){
if (c.first>last)last=c.second, ans++;
}
printf("%lu\n", n-ans);
}
int main(){
freopen("detect2.in", "r", stdin);
cin.tie(0)->sync_with_stdio(false);
int T;cin>>T;
while (T--)solve();
}
/*
1
5 5 15 3
0 3 0
12 4 0
1 1 4
5 5 -2
6 4 -4
2 5 8 9 15
*/