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:一个O(N)复杂度的解法,欢迎评论

Posted by wwylele at 2015-09-23 15:06:58 on Problem 1007 and last updated at 2015-09-23 15:07:24
In Reply To:一个O(N)复杂度的解法,欢迎评论 Posted by:njuallen at 2015-02-08 23:39:52
感觉measure还是些麻烦了吧,我这么写的:
...
int measure=0
int A,C,G,T;
A=C=G=T=0;
for(char* p=str;*p;p++){
    switch(*p){
    case 'A':
        measure+=C+G+T;
        ++A;
        break;
     case 'C':
        measure+=G+T;
        ++C;
        break;
     case 'G':
        measure+=T;
        ++G;
        break;
     case 'T':
         ++T;
         break;
     }
}

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