841B

Revision en1, by asdfghjl, 2017-08-19 11:49:10

For my first solution I was expecting WA because of integer overflow (int sum) but I got TLE instead which is odd because my time complexity is O(n) and it should work for the maximum value of n(10^6)!! Then I just tried the same code with scanf/printf and got AC :| I also changed the type of sum to long long and used cin/cout like the first time and got AC! Can someone tell me WHYYYY?

link to my second solution ink to my third solution

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English asdfghjl 2017-08-19 11:49:38 3 Tiny change: '9589520)\n[ink to my ' -> '9589520)\n\n[link to my '
en1 English asdfghjl 2017-08-19 11:49:10 626 Initial revision (published)