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

不用scanf也可以过

Posted by hmh0512 at 2011-05-17 15:19:20 on Problem 1171
>用了cin 、cout、struct、vector string,还是过了,485ms。优化在于:
>边输入边计算分数和各字母出现的次数
>1不是由第一行字符串的各字母组成的pass,比如profile中f。
>2各字母出现的次数大于第一行字符串的各字母出现的次数的pass,比如profile中的f也可以认为是次数1大于0,所以pass掉,非有效单词。
>3一趟循环下来找出了单个有效单词的最高分,与此同时把有效单词中字母个数<=4的存下来。再用两重循环判断两两组合中符合条件(字母出现次数之和不大于字符串的各字母出现次数)的组合的分数之和是否大于当前maxScore……

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