I have to say if you are not a LLM,please add "{}" after "if",this is very important

Revision en1, by OtterZ, 2025-09-17 10:06:17

In fact,I don't want to use this to detect LLMs,but it's very important to say that because something wrong might happen if you don't do that.

In fact when I trying to find a mistake in a code,I saw:

for(int i = 1; i <= n; i ++){
	if(p[i].x > p[i - 1].x)
		if(p[i - 1].x != 0)
			f2 ++;
	else{
                dt2 ++;
		if(!gt[dt2 + cnt1])
			f2 ++;
	}
}

And found the code with same result is this:

for(int i = 1; i <= n; i ++){
	if(p[i].x > p[i - 1].x){
		if(p[i - 1].x != 0)
			f2 ++;
	        else{
                        dt2 ++;
		        if(!gt[dt2 + cnt1])
			        f2 ++;
	        }
        }
}

This will lead to WA and make you cost a long time to find mistake.So please write like this:

for(int i = 1; i <= n; i ++){
	if(p[i].x > p[i - 1].x){
		if(p[i - 1].x != 0){
			f2 ++;
                }
        }
	else{
                dt2 ++;
		if(!gt[dt2 + cnt1]){
			f2 ++;
                }
	}
}

To make sure the structure is right.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English OtterZ 2025-09-17 10:06:17 1120 Initial revision (published)