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 1934. Black Spot

TLE
Posted by Viktor 17 Dec 2012 20:19
Don't use cin/cout or Scanner in java.
Re: TLE
Posted by Andrew Sboev [USU] 17 Dec 2012 23:02
Seriously? 10^5, it's so few! Only cin, only hardcore!
You shoudn't use cin/cout in every problem, in which n is big enough(n > 1000, for example)

Edited by author 17.12.2012 23:02
Re: TLE
Posted by ASK 15 Feb 2014 15:21
cin/cout is not TLE, as long as you do
cin.sync_with_stdio(false);
Re: TLE
Posted by jacketinsysu 1 Sep 2015 07:26
Yes, you may think that the number of edge can be as large as n * (n - 1) / 2, which is O(n^2), where n is the number of vertex of the graph. (10^5)^2 = 10^10. is a rather large scale data for 1 second.