fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double E, logarithm=0, ai, x;
  7. int i=2;
  8. cin >> x >> E;
  9. if(x!=0){
  10. ai=(-x*x);
  11. logarithm=ai;
  12. while(abs(ai/2)>E){
  13. ai*=x*x;
  14. logarithm+=ai/i;
  15. i++;
  16. }
  17. }
  18. cout << logarithm;
  19.  
  20. return 0;
  21. }
Time limit exceeded #stdin #stdout 5s 3412KB
stdin
1 0.03
stdout
Standard output is empty