Runtime error cause

Source: Internet
Author: User

1. Brackets

I found it by accident when I was doing the question!

(For details, seeElse if (arefriends(X, Y)=-1)

4.Endless loop

I just found another one. It was so bad luck that I met.

(For details, seePoj 2236 Wireless Network)

 

If (X! = Y) // -------- there must be no less judgment here. Otherwise, an endless loop occurs and a runtime error occurs during submission.
Set [x] = y;

This question is a tree-based and query-set question,

Because the set [] array saves the parent node, if no judgment condition is added,

It is equivalent to pointing to itself. an endless loop will appear in the function of the compression path, and the end condition (that is, the root) cannot be found)


 





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.