fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define Aseer_Elahzan ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  4. #define yes cout<<"YES";
  5. #define no cout<<"NO";
  6. #define endl cout<<"\n";
  7. #define ll long long
  8. #define loop(a) for (int i = 0; i < a; ++i)
  9. int freq[int(1e3+2)];
  10. void print();
  11. int testCase();
  12. int main() {
  13. Aseer_Elahzan
  14. print();
  15. }
  16. void print(){
  17. ll sum=1;
  18. int q;cin>>q;
  19. int arr[q];
  20. loop(q){
  21. cin>>arr[i];
  22. }
  23. loop(q){
  24. sum*=arr[i];
  25. }
  26. double z= ::pow(sum,(1.0/q));
  27. if(int(z)==z){
  28. cout<<z+1;
  29. }else{
  30. cout<<::ceil(z);
  31. }
  32. }
  33.  
  34.  
Success #stdin #stdout 0.01s 5364KB
stdin
Standard input is empty
stdout
2