We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我用了hash的方法也还是TLE,请问你有什么好的方法么?
The text was updated successfully, but these errors were encountered:
你好,这题我是用sort+two pointer夹逼来做的,第一次提交的时候跑了160ms,加上各种剪枝优化后24ms,time O(n^3)。哈希的方法复杂度应该也是time O(n^3) space O(n^2)的,因为一个值可能会对应多个pair,并且要考虑去重的问题,理论上也是可以过的,但是hash的话查询过程中常数会比较大,因此TLE的可能性比较大。
Sorry, something went wrong.
No branches or pull requests
我用了hash的方法也还是TLE,请问你有什么好的方法么?
The text was updated successfully, but these errors were encountered: