fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long n=0, x=1, k=1, s=1;
  6. cin>>n;
  7. while (s<n) {
  8. k++;
  9. x=x*2+k;
  10. s=s+x;
  11. }
  12. cout<<k;
  13. return 0;
  14. }
Success #stdin #stdout 0s 4532KB
stdin
100
stdout
6