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

枚举也能1AC!

Posted by xiao_si at 2009-09-12 01:57:42 on Problem 2965 and last updated at 2009-09-12 02:05:15
首先应该明白两点:
1 不论翻转执行的先后序列如何,结果都一样。
2 每一个点(i,j)最多做一次翻转。(由1不难得到)
所以结果可以转化为一个只包含0、1的十六位字符串,枚举所有的字符串逐个检验,取包含1最少的串(若果1代表翻转的话)。

枚举 一种实现为 for(int i=1;i<(1<<16);++i)Test(i)

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