2 solutions

  • -1
    @ 2025-7-18 17:03:12

    #include <bits/stdc++.h>

    using namespace std; int a[25005], b[25005];

    int main() { double x, n, a = 1.0; cin >> x >> n; for (int i = 1; i <= n; i++) { a = (a + x / a) / 2; }

    cout << fixed << setprecision(3) << a;
    return 0;
    

    }

    Information

    ID
    205
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    2
    Tags
    # Submissions
    55
    Accepted
    35
    Uploaded By