submission link, problem link, Could someone please help me understand the cause of the error? Additionally, i would appreciate general insights into which operations in C++ are typically slow and tips on how to optimize them. Thank You
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3885 |
3 | jqdai0815 | 3682 |
4 | Benq | 3580 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3506 |
7 | ecnerwala | 3505 |
8 | Radewoosh | 3457 |
9 | Kevin114514 | 3377 |
10 | gamegame | 3374 |
# | User | Contrib. |
---|---|---|
1 | cry | 170 |
2 | -is-this-fft- | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 153 |
8 | luogu_official | 152 |
8 | awoo | 152 |
10 | maomao90 | 148 |
submission link, problem link, Could someone please help me understand the cause of the error? Additionally, i would appreciate general insights into which operations in C++ are typically slow and tips on how to optimize them. Thank You
Name |
---|
Auto comment: topic has been updated by Ryan22oct (previous revision, new revision, compare).
In C++ generally loops run upto O(10^7) in 1 second ,that's why inputs are given such that there complexity is given upto atmost (1~5)*10^7.
Your solution runs O(n*1023), i.e max can reach > 10^8. Which may require like 10 seconds.
Also you are initializing your arrays a and p which is not required.
Also yor inv is input independant so you can precompute it before the loop of testcases.
bhai nhi ho rha AC :(