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 1196. History Exam

g++ vs visual studio
Posted by Sevak Sargsyan 12 Nov 2014 12:42
the same c++ code was accepted when I used visual studio, but gave TLE 8 with g++ 9 (or g++ 9, C11)
Re: g++ vs visual studio
Posted by slamin 17 Nov 2014 03:48
Same happened to me. I've removed everything from the code except scanf("%d", &t); and it took 1.9 seconds just to read test #8 input using G++. Same code runs in 0.25 seconds under Visual C++ 2010.
Re: g++ vs visual studio
Posted by Andrey Kosmachev 28 Sep 2016 00:02
Thank you. I also scaned with scanf("%d", &t) and got ~1.5+/- sec using G++ and ~0.3 sec using VC++.
Another idea to optimize is to scan with gets() and hex values.

Edited by author 28.09.2016 00:02

Edited by author 28.09.2016 00:02
Re: g++ vs visual studio
Posted by c_pp 11 Jan 2017 10:18
Using buffered i/o, G++ 4.9 C++11,  and  std::unoredered_set :
 http://acm.timus.ru/rating.aspx?space=1&num=1196 !!!