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

got AC, STL :: map
Posted by Levan Arabuli [Tbilisi SU] 29 Jul 2011 23:39
use printf and scanf instead of cin,cout;
Re: got AC, STL :: map
Posted by IgorKoval(from Pskov) 2 Oct 2011 18:53
Thank you.
Re: got AC, STL :: map
Posted by Taras Vasylyshyn 19 Nov 2011 01:02
Thank you!
Re: got AC, STL :: map
Posted by Valdemar 7 Jan 2012 16:16
Thank you! Very useful hint
with cin,cout my programm get TLE on test 21
Re: got AC, STL :: map
Posted by galymzhan 30 Apr 2013 12:17
Or use
cin.sync_with_stdio(false);
Re: got AC, STL :: map
Posted by Nekto89 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
Re: got AC, STL :: map
Posted by ELDVN 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;
Re: got AC, STL :: map
Posted by Haloom 27 Sep 2018 12:34
ios_base::sync_with_stdio(false);
cin.tie(0);
with map 0.249s.with unorderd_map 0.171s.