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:HAHA HEHE 输出YES 怎么A的

Posted by asterix314 at 2009-01-13 19:56:22 on Problem 2159
In Reply To:Re:HAHA HEHE 输出YES 怎么A的 Posted by:longpo at 2009-01-13 10:41:58
首先扫描字符串,统计不同字符出现次数是:

a = {2,2} (2H, 2E)
b = {2,2} (2H, 2A)

然后计算特征值:

sum(a^0) = sum(2^0, 2^0) = 1+1 = 2 = sum(b^0)
sum(a^1) = sum(2^1, 2^1) = 2+2 = 4 = sum(b^1)
sum(a^2) = sum(2^2, 2^2) = 4+4 = 8 = sum(b^2)

所以 a = b,输出 "YES"。

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