Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

diligentnoob's blog

By diligentnoob, history, 5 weeks ago, In English,
 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

I am not familiar with Java but what you are using Hash table. A Hash table in worst case takes O(n) operation for search, delete and insertion(See Blowing Up Hash Tables). This happens when there are multiple chains(collisions) in the hash table(See Hash table chaining). I'd suggest to use Arrays and Vectors instead! Give me feedback if this helped or not!

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank You so much for your help :)