Weird issue with "String Hashing"

Revision en1, by night.watchman, 2025-11-03 08:52:51

Recently after solving this problem with Polynomial Hashing. I got TLE.

I thought my solution would be AC well within 2000 ms. I changed the vector size from 1600 to 1e4 [Even Increased]. But then the problem got AC.

See these two submissions (TLE) VS Accepted. [99.9999999% same]

Can anybody share the reason? Have you faced these type of things?

Tags string, hashing, #string-hashing, tle, time complexity, programming languages

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English night.watchman 2025-11-03 08:52:51 637 Initial revision (published)