Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

ronak037's blog

By ronak037, history, 4 years ago, In English

In today's contest during submission of my solution of B question then I got runtime error again and again and not able to understand the reason for it because I don't get any error in my VSCode IDE. I am putting a link of my solution and also commented that line which gives an error so, please tell me why it is giving runtime error? Thanks for your help.

Question link: https://codeforces.com/contest/1350/problem/B Solution link: https://codeforces.com/contest/1350/submission/79905645

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

My guess is that you get runtime error from

factor.size()-2

The size() function returns an unsigned int. You can guess what happens if

factor.size() < 2
  • »
    »
    4 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Ohh I forgot to consider that fact. Thanks a lot for your information bro. This help me to take care next time.