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

千万不要在循环中调用strlen()!!!!

Posted by 1300012766 at 2014-09-06 18:47:46 on Problem 3461
每次调用strlen时都会把字符串扫一遍,在循环中使用的话时间复杂度就会由O(n)上升到O(n^2)...
因为这个TLE了近十次  (T . T)

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