ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1915. Titan Ruins: Reconstruction of Bygones

about TLE (spoilers)
Posted by Gerasimov Alexander Dmitrievich 23 Mar 2022 01:48
In C#, I was getting TLE using LinkedList, so I rewrote everything using an array of 2*10^6 elements. It passed in 1.7s (thank god), but that's still very slow. How do people get times like 0.2s?
Re: about TLE (spoilers)
Posted by Hristo Nikolaev (B&W) 23 Dec 2022 01:32
It can be much faster if implemented in C/C++. (Edit: I just saw that you have submitted a faster solution in C++)

A simple trick I used is to ignore 0 (copy the entire stack) if its elements are > 10^6

Edited by author 23.12.2022 01:43