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

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

I've been trying to solve this problem — 385C - Медведь и простые числа , Bear and Prime Numbers. My solution gives a completely expected runtime error on Testcase#4. Can someone please explain to me as to why this is happening?

My solution: http://mirror.codeforces.com/contest/385/submission/12629174

Any help would be greatly appreciated.

Thanks in advance.

EDIT: Solved. I had not taken into consideration that even l could be greater than 10000000.

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

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

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

Hello Codeforces community! I recently took part in the July 2015 long challenge on www.codechef.com . There was a problem called Masterchef( Problem code: MCHEF). I used a multiset as a priority queue to calculate the minimum cost for each dish. In the author's solution, they used a set instead of a multiset. The complexities are the same but my solution TLEs for the second subtask. Could someone please help me out here?

This is my solution: https://www.codechef.com/viewsolution/7352429 This is the editorial: http://discuss.codechef.com/questions/71856/mchef-editorial

Thanks in advance.

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

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