[The problem](https://dmoj.ca/problem/apio09p3)↵
↵
The problem is a simple SCC problem, yet I realised a lot of submissions including mine have got RTE as a result.↵
↵
My submission: [submission:345006731] (i sent it to cf to display it here)↵
↵
It gets AC in cases where $N ≤ 3000$ but it gets RTE(std::bad_alloc) in others.↵
↵
Whats the cause of this? Thanks in advance.
↵
The problem is a simple SCC problem, yet I realised a lot of submissions including mine have got RTE as a result.↵
↵
My submission: [submission:345006731] (i sent it to cf to display it here)↵
↵
It gets AC in cases where $N ≤ 3000$ but it gets RTE(std::bad_alloc) in others.↵
↵
Whats the cause of this? Thanks in advance.




