20ptsWA 求调
查看原帖
20ptsWA 求调
685964
shuqiang楼主2024/10/26 22:54

为啥特殊性质 B 不对

#include<iostream>

using namespace std;

const int N = 1e5 + 10;
int t, n, m, L, V, d[N], v[N], a[N], p[N], ans1, ans2;
bool b[N];

int main(){
	cin >> t;
	while(t--){
		cin >> n >> m >> L >> V;
		for(int i = 0; i < N; i++) b[i] = 0;
		ans1 = ans2 = 0;
		for(int i = 0; i < n; i++){
			cin >> d[i] >> v[i] >> a[i];
		}
		for(int i = 0; i < m; i++){
			cin >> p[i];
		}
		for(int i = 0; i < n; i++){
			if(a[i] == 0){
				if(d[i] <= p[m-1] && v[i] > V){
					ans1++;
					b[m-1] = 1;
				}
			}
			else if(a[i] > 0){
				if(d[i] + (long double)(V * V - v[i] * v[i]) / a[i] / 2 <= p[m-1]){
					ans1++;
					b[m-1] = 1;
				}
			}
		}
		for(int i = 0; i < m; i++) if(b[i] == 0) ans2++;
		cout << ans1 << ' ' << ans2 << '\n';
	}
	return 0;
}

2024/10/26 22:54
加载中...