|
|
вернуться в форумWA25, help me please Please help me, guys, I don't know what's the problem:( #include <iostream> using namespace std; int lft[320], rght[320]; double timeleft[320], timeright[320]; double const eps = 0.0000001; int main(){ int n,m; cin >> n; for(int i = 1; i <= n; i++){ cin >> lft[i]; timeleft[i] = (lft[i] + 5.000)*9/50; } cin >> m; for(int i = 1; i <= m; i++){ cin >> rght[i]; timeright[i] = (rght[i]+5.000)*9/50 - 36.000/25; } double ans = 1000000000; if(lft[1] >= 8 && (rght[1] >= 16 || (rght[1] <= 3 && (rght[2] >= 16 || m == 1)))){ cout << 0; return 0; } for(int i = 1; i <= n; i++){ double cur = timeleft[i]; bool b = 0; if(lft[i+1] - lft[i] >= 13 || lft[i+1] == 0){ for(int j = 1; j <= n; j++){ double temp = rght[j] - (cur + 36.000/25)*200.000/36; if(temp > -5 + eps && temp + eps < 8) b = 1; } } else b = 1; if(!b && cur + eps < ans) ans = cur; } for(int i = 1; i <= m; i++){ double cur = timeright[i]; bool b = 0; if(rght[i+1] - rght[i] >= 13 || rght[i+1] == 0){ for(int j = 1; j <= n; j++){ double temp = lft[j] - cur*200.000/36; if(temp - eps > -5 && temp + eps < 8) b = 1; } } else b = 1; if(!b && cur + eps < ans) ans = cur; } printf("%.9f",ans); return 0; } |
|
|