做 leetcode 时,加上以下代码能够使时长和空间得到优化。(大多数情况)
1 | std::ios::sync_with_stdio(false); cin.tie(NULL); |
编号 | 题目 | 时间 | 空间 | 语言 |
---|---|---|---|---|
1 | Tow Sum | 12 ms | 10.3 MB | E |
2 | Add Two Numbers | 40ms | 18.6 MB | M |
3 | Longest Substring Without Repeating Characters | 最坏 O(n^2) | O(1) | M |
4 | Median of Two Sorted Arrays | H | ||
6 | ZigZag Conversion | O(n) | O(n) | M |
7 | Reverse Integer.md | E | ||
8 | String to Integer (atoi) | M | ||
9 | Palindrome Number | E | ||
75 | Sort Colors | n/ nlogn | M | |
1020 | Partition Array Into Three Parts With Equal Sum | O(n) | E | |
1023 | Binary String With Substrings Representing 1 To N | M |
题目参考 haoel/leetcode