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 1102. Strange Dialog

getc(stdin) is pretty slow,much slower than scanf
Posted by Gumyamy 29 Jul 2011 11:13
I use DFA algorithm
at first I tried the getc() method and parse letter one by one , and got AC -0.65 s
then, I use scanf() method to scan in the whole text and then use the same algorithm
,got AC -0.093
quite confusing??

Edited by author 29.07.2011 11:16

Edited by author 29.07.2011 11:17
Re: getc(stdin) is pretty slow,much slower than scanf
Posted by daftcoder [Yaroslavl SU] 29 Jul 2011 12:17
What about getchar?