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 1510. Order

Levan Arabuli [Tbilisi SU] got AC, STL :: map [7] // Problem 1510. Order 29 Jul 2011 23:39
use printf and scanf instead of cin,cout;
IgorKoval [PskovSU] Re: got AC, STL :: map // Problem 1510. Order 2 Oct 2011 18:53
Thank you.
Taras Vasylyshyn Re: got AC, STL :: map // Problem 1510. Order 19 Nov 2011 01:02
Thank you!
[SPB SU of Telecom] Valdemar Re: got AC, STL :: map // Problem 1510. Order 7 Jan 2012 16:16
Thank you! Very useful hint
with cin,cout my programm get TLE on test 21
galymzhan Re: got AC, STL :: map [3] // Problem 1510. Order 30 Apr 2013 12:17
Or use
cin.sync_with_stdio(false);
Nekto89 Re: got AC, STL :: map [2] // Problem 1510. Order 11 Jun 2014 12:23
sync doesn't help. scanf_s/printf got me through time limit.
PS unordered_map gives little speed boost too.

Edited by author 11.06.2014 12:31
ELDAN Re: got AC, STL :: map // Problem 1510. Order 30 Nov 2015 23:43
1) http://ideone.com/miJcAU <= I used quick-sort and got answer on [n/2]
2) http://ideone.com/6YMukb <= Use same STL::map and just check to max;
Haloom Re: got AC, STL :: map // Problem 1510. Order 27 Sep 2018 12:34
ios_base::sync_with_stdio(false);
cin.tie(0);
with map 0.249s.with unorderd_map 0.171s.