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 1827. Indigenous Wars

I use double hash but still tle. and i do not know how to use fread, fwrite in online judge,please help
Posted by muhammad 27 Mar 2011 22:48
my algo should be n*50*order of hash
probably large input is causing problem

i can use fread and fwrite but don't know how to do it in online judge submission.
please provide me with some code segment that utilize fread and fwrite.
better be some eg problem as 1000. a+b problem

thanks in advance.
Re: I use double hash but still tle. and i do not know how to use fread, fwrite in online judge,please help
Posted by tracyzhu 28 Mar 2011 12:17
So did i. did you find some methods to solve it? please help me.thx a lot.
Re: I use double hash but still tle. and i do not know how to use fread, fwrite in online judge,please help
Posted by muhammad 29 Mar 2011 22:26
yes. my hash was correct. but i used long long for calculation. i replaced with int except for one case and got ac. anyway my mod value for double hash was 499979. hash using just those 3 integers in 2e8 radix system and avoid long long as much as possible. good luck. anyway i still want to know the fread, fwrite magic. as so many problems i got ac in 0.015 sec but best timing was 0.001 sec. if u know, please help.

Edited by author 29.03.2011 22:28