mukund007's blog

By mukund007, history, 3 years ago, In English

Recently I was going through a good problem 1538D - Another Problem About Dividing Numbers where I had used long long int which gave me TLE then I switched to int which gave AC. Then I thought of trying out the int_fast32_t which usually pops up as a suggestion in my VS Code whenever I type int but haven't tried it until now. I submitted the same code just by changing long long int to int and then to int_fast32_t and I noticed slight improvement in the execution time when I switched onto int_fast32_t. Here are the submissions using : - long long int : 120003544 -> TLE. - int : 120003641 -> 1637 ms. - int_fast32_t : 120004041 -> 1466 ms.

I googled a lot but haven't understood why and how int_fast32_t is faster or does it just claims to be faster? If it is faster then why very less people use it? Does it have any drawbacks? [I'm bad at googling stuff apologies :( ] I couldn't find any side by side comparison for these. Any helpful links/answers would be helpful! Thanks!

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it