fork download
  1. #include<bits/stdc++.h>
  2. using namespace std ;
  3. const float N = sqrt(2)+1 ;
  4. double x[3000];
  5. int main(){
  6. ios_base::sync_with_stdio(0) ; cin.tie(0) ;
  7. x[1] = 2014.000 ;
  8. for(int i = 2 ; i < 3000 ; i++){
  9. x[i] = ((N*x[i-1])-1)/(N + x[i-1]) ;
  10. }
  11. cout << x[2015] ;
  12. }
Success #stdin #stdout 0s 5424KB
stdin
Standard input is empty
stdout
-1.00094