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 1126. Magnetic Storms

My solution is O(N * 17) but it fits in memory only on C++. Can anyone give me better solution? My mailbox is vlad_veselov@mail.ru.
Posted by Vlad Veselov 20 Apr 2004 21:08
Re: My solution is O(N * 17) but it fits in memory only on C++. Can anyone give me better solution? My mailbox is vlad_veselov@mail.ru.
Posted by Oberon (Yura Znovyak) 21 Apr 2004 00:01
It is solvable in PASCAL too.
AC in 0.046s with 489 KB of memory.

But here is Delphi report:
"
Mine is on
Borland Delphi Version 15.0
Copyright (c) 1983,2002 Borland Software Corporation

MAGNSTOR.PAS(1)
MAGNSTOR.PAS(1)
MAGNSTOR.PAS(1)
MAGNSTOR.PAS(137)
138 lines, 0.02 seconds, 11564 bytes code, 113813 bytes data.
"

It uses only 113813 bytes of memory. If I am not mistaken (I have solved it a long time ago) my solution is O(N log N).
Re: My solution is O(N * 17) but it fits in memory only on C++. Can anyone give me better solution? My mailbox is vlad_veselov@mail.ru.
Posted by Romanchik Vitaly 14 Jul 2004 05:32
Use Hash-table to store the results !!!!
Re: My solution is O(N * 17) but it fits in memory only on C++. Can anyone give me better solution? My mailbox is vlad_veselov@mail.ru.
Posted by Romanchik Vitaly 14 Jul 2004 05:34
There is O(n) algorithm !!!!!
If you want to know more mail me VRomanchik@Tut.by