| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:HAHA HEHE 输出YES 怎么A的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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator