CSES help: Distinct Numbers TLE using Python set

Revision en1, by WaifuSlayer, 2023-12-03 23:17:28

I solved this problem using both sorting and a set; but the sorting solution passes but the set solution TLEs. I'm curious if this is by design since the problem is marked under "sorting" or if hashing is just that much slower in this case.

problem: https://cses.fi/problemset/task/1621/

my code: https://cses.fi/paste/e9ace6fc0fc91742778f0f/

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English WaifuSlayer 2023-12-03 23:17:28 401 Initial revision (published)