Open Credit System (UVA — 11078), how to do it in O(n)?

Revision en1, by gauti786, 2017-06-09 19:55:05

https://uva.onlinejudge.org/external/110/11078.pdf

Please go through the link..

How can i solve this problem with linear scan. O(n^2) solution is very obvious to me. But linear scan solution o(n), i have no idea,Please help?

Tags uva, problem solving, analysis of problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gauti786 2017-06-09 19:55:05 289 Initial revision (published)