fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. string s="";
  5. int main()
  6. {
  7. int old,count=0;
  8. cout<<s.capacity()<<endl;
  9. for(int i=0;i<131043;++i){
  10. old=s.capacity();
  11. s+='.';
  12. if(s.capacity()!=old){
  13. cout<<s.capacity()<<endl;
  14. ++count;
  15. }
  16. }
  17. cout<<count<<endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
0
1
2
4
8
16
32
64
128
256
512
1024
2048
8163
16355
32739
65507
131043
17