Блог пользователя iamstg

Автор iamstg, история, 8 лет назад, По-английски

With reference to the problem, http://codeforces.net/contest/721/problem/C

http://codeforces.net/contest/721/submission/21096367 -> This submission with memset giving value of 1e9+7 to 2D array gives WA on test10

whereas the same code with memset removed and the 2D array given value manually of 1e9+7 ->http://codeforces.net/contest/721/submission/21096181 gives AC.

I am completely not able to understand why?? Does anyone have any idea??

Полный текст и комментарии »

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

Автор iamstg, история, 8 лет назад, По-английски

I was submitting the solution for Round #362 Div2 Problem E :

http://codeforces.net/contest/697/problem/E

I got WA on Test#4 on this submission : http://codeforces.net/contest/697/submission/19150824 I had typecasted every possible places where I felt overflow could occur with long long. I submitted many times but it gave wrong answer with typecast.

Then I submitted using 1ll in multiplication instead of typecast in this submission and it got accepted: http://codeforces.net/contest/697/submission/19150943

My question is why does typecasting not work and what is the difference between typecasting and 1ll?? Also when to use which because many of the solutions I coded before used typecasts and it worked well on various judges including Codeforces until I encountered this case for the first time.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится