|
|
вернуться в форумGetting WA on first test even after doing binary search I tried everything: 1. Reading long long and then casting as needed to long double 2. Reading and doing operations with long double 3. Searching root with binary search #include <cstdio> #include <vector> #include <algorithm> #include <cmath> #include <climits> using namespace std; int main() { long double a; vector<long double> v; while (scanf("%lf", &a) != EOF) { v.push_back(a); } reverse(v.begin(), v.end());
for (vector<long double>::iterator it = v.begin(); it != v.end(); ++it) { printf("%.4lf\n", sqrt(*it)); } return 0; } |
|
|