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

一开始还以为是搜索……后来发现其实只要验证一下就好了……

Posted by dashashi at 2010-09-29 13:47:05 on Problem 1063
规则是如果总数是奇数就输出yes,如果总数是偶数就统计一下奇数位置的1的个数和偶数位置的1的个数,如果两者相差小于等于1就输出yes,不然输出NO……
原理大概就是对于偶数的情况,每一次交换都不会改变那个差值,而对于奇数,shift之后就能够实现奇偶的互换

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