fork download
  1. #include<iostream>
  2. #include<cmath>
  3. #include<cstdio>
  4. using namespace std;
  5.  
  6. int n;
  7. long long x[200005], y[200005], t[200005];
  8. double dp[200005][2];
  9. double dis(int P, int Q){
  10. return sqrt((x[P]-x[Q])*(x[P]-x[Q])+(y[P]-y[Q])*(y[P]-y[Q]))/(t[Q]-t[P]);
  11. }
  12. int main(){
  13. dp[0][0]=dp[0][1]=0;
  14. cin >> n;
  15. for (int l=0; l<n; ++l){
  16. cin >> t[l] >> x[l] >> y[l];
  17. if (l==0) continue;
  18. dp[l][0]=max(dp[l-1][0], dis(l-1, l));
  19. dp[l][1]=max(dp[l-1][1], dis(l-1, l));
  20. if (l==1) continue;
  21. //cout << dis(l-1, l) << endl;
  22. dp[l][1]=min(dp[l][1], max(dp[l-2][0], dis(l-2, l)));
  23. }
  24. cout << dp[n-1][1];
  25. //printf("%.8lf", dp[n-1][1]);
  26. return 0;
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
10 4 16
14 7 13
20 11 8
23 11 10
24 10 10
compilation info
prog.cpp:1:2: error: stray ‘#’ in program
 t#include<iostream>
  ^
prog.cpp:1:1: error: ‘t’ does not name a type
 t#include<iostream>
 ^
In file included from /usr/include/c++/6/cmath:43:0,
                 from prog.cpp:2:
/usr/include/c++/6/ext/type_traits.h:162:35: error: ‘__gnu_cxx::__is_null_pointer’ declared as an ‘inline’ variable
   __is_null_pointer(std::nullptr_t)
                                   ^
/usr/include/c++/6/ext/type_traits.h:162:35: error: ‘bool __gnu_cxx::__is_null_pointer’ redeclared as different kind of symbol
/usr/include/c++/6/ext/type_traits.h:157:5: note: previous declaration ‘template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)’
     __is_null_pointer(_Type)
     ^~~~~~~~~~~~~~~~~
/usr/include/c++/6/ext/type_traits.h:162:21: error: ‘nullptr_t’ is not a member of ‘std’
   __is_null_pointer(std::nullptr_t)
                     ^~~
prog.cpp: In function ‘int main()’:
prog.cpp:14:5: error: ‘cin’ was not declared in this scope
     cin >> n;
     ^~~
prog.cpp:18:45: error: ‘max’ was not declared in this scope
         dp[l][0]=max(dp[l-1][0], dis(l-1, l));
                                             ^
prog.cpp:22:60: error: ‘min’ was not declared in this scope
         dp[l][1]=min(dp[l][1], max(dp[l-2][0], dis(l-2, l)));
                                                            ^
prog.cpp:24:5: error: ‘cout’ was not declared in this scope
     cout << dp[n-1][1];
     ^~~~
stdout
Standard output is empty