TLE + Segment Fault on struct

Правка en1, от foundnt_Alice, 2024-01-06 06:09:35

Hi all!

Recently, I tried to implement a HLD struct. However, my local computer shows Segmentation Fault verdict as soon as I set the constraint of N to 1e5, the online judge shows TLE verdict btw. Small constraint on N works just fine. Here is the code:

Segmentation Fault Code

So, I tried to rewrite the same code without using struct. This time my local computer ran smoothly and the online judge showed AC verdict.

The AC code:

Could someone plz explain why's there a difference verdict in my codes? Where did I get it wrong? I much appreciate it!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский foundnt_Alice 2024-01-06 06:09:35 8108 Initial revision (published)