https://codeforces.net/contest/1237/submission/62742100
Looks N^3, but seems to be N^2 after constructing many cases. Any proofs/can you hack it?
# | User | Rating |
---|---|---|
1 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 158 |
5 | atcoder_official | 157 |
6 | Qingyu | 155 |
7 | djm03178 | 151 |
7 | adamant | 151 |
9 | luogu_official | 150 |
10 | awoo | 147 |
https://codeforces.net/contest/1237/submission/62742100
Looks N^3, but seems to be N^2 after constructing many cases. Any proofs/can you hack it?
Name |
---|
You can try this input:
Something like this makes your algorithm work in $$$O(n^3)$$$ time. You need $$$O(n)$$$ points on each diagonal:
In contest I submitted the same idea but I was sorting first.
my submission
I tried (CUSTOM INVOCATION) it passed your testcase in 31ms, I also believe that it remains O(N^3). How it pass all testcases and your testcase ? mnbvmar