Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:3617一直WA

Posted by Difei at 2014-05-06 12:22:23
In Reply To:3617一直WA Posted by:Difei at 2014-05-05 22:39:14
总算找到错误了,就是判断首尾顺序的时候要把=算到单独一类循环:
if(ca[starti + i] < ca[endi-i])
			{
				putchar(ca[starti ++]);count++;
				break;
			}
			else if(ca[starti + i] > ca[endi-i])
			{
				putchar(ca[endi --]);count++;
				break;
				
			}
			else
			{
				if (starti + i == endi)
				{
					if(ca[starti + i] <= ca[endi-i])
					{
						putchar(ca[starti ++]);count++;
						break;
					}
					else if(ca[starti + i] > ca[endi-i])
					{
						putchar(ca[endi --]);count++;
						break;
				
					}
				}
			}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator