c'c'c
2026-09-11 17:28:18
发布于:广东
12阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(9);
int c,T;
cin >> c >> T;
while(T--){
int n;
long long x,y,v0;
cin >> n >> x >> y >> v0;
double a;
if(x == y){
a = 0;
}else if(v0 == 0){
a = 1e18;
}else{
a = (double)(y - x) / v0;
}
for(int i = 0;i < n;i++){
long long t,v;
cin >> t >> v;
double b = (double)t + (double)y / v;
if(b < a){
a = b;
}
}
cout << fixed << setprecision(9) << a << '\n';
}
return 0;
}#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(9);
int c,T;
cin >> c >> T;
while(T--){
int n;
long long x,y,v0;
cin >> n >> x >> y >> v0;
double a;
if(x == y){
a = 0;
}else if(v0 == 0){
a = 1e18;
}else{
a = (double)(y - x) / v0;
}
for(int i = 0;i < n;i++){
long long t,v;
cin >> t >> v;
double b = (double)t + (double)y / v;
if(b < a){
a = b;
}
}
cout << fixed << setprecision(9) << a << '\n';
}
return 0;
}#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(9);
int c,T;
cin >> c >> T;
while(T--){
int n;
long long x,y,v0;
cin >> n >> x >> y >> v0;
double a;
if(x == y){
a = 0;
}else if(v0 == 0){
a = 1e18;
}else{
a = (double)(y - x) / v0;
}
for(int i = 0;i < n;i++){
long long t,v;
cin >> t >> v;
double b = (double)t + (double)y / v;
if(b < a){
a = b;
}
}
cout << fixed << setprecision(9) << a << '\n';
}
return 0;
}
这里空空如也






有帮助,赞一个