fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <climits>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8. int n;
  9. cin >> n;
  10. double sqrtOfHeight = 0;
  11. for(int i = 0; i < n; i++){
  12. int square;
  13. cin >> square;
  14. sqrtOfHeight += sqrt(square);
  15. }
  16. cout << (unsigned long long) (1000 * sqrtOfHeight * sqrtOfHeight);
  17. return 0;
  18. }
Success #stdin #stdout 0s 4312KB
stdin
Standard input is empty
stdout
Standard output is empty