How should I output?
As you can see the task is to output the sequence consists of 1000000
symbols. I output exactly 1000000 symbols one by one (...Write
(sym)...Write(sym)...Write(sym)...), buf after 0.04 seconds I
receive "Output Limit". What does it mean and how should I output the
sequence?
Please, help me!
Re: How should I output?
That simply means that you do NOT output 1 million chars!
I have the same problem, and I can't solve it. But if I decrease the
number of outputs then I get WA.
Re: How should I output?
I used
putchar(buffer[j]);
instead of printf("%s",buffer)
and I got accepted.
I really don't know why.
> As you can see the task is to output the sequence consists of
1000000
> symbols. I output exactly 1000000 symbols one by one (...Write
> (sym)...Write(sym)...Write(sym)...), buf after 0.04 seconds I
> receive "Output Limit". What does it mean and how should I output
the
> sequence?
> Please, help me!
This is my program.Can you make it shorter?
Послано
Tony 29 окт 2002 14:50
var
i:longint;
begin
randomize;
for i:=1 to 1000000 do write(chr(ord('a')+random(26)));
end.
Re: This is my program.Can you make it shorter?
You are GENIUS!!! The god of programming :)) I think your solution is
really perfect!
my program is very like of his :-)
Послано
aaakkk 30 окт 2002 10:36
> You are GENIUS!!! The god of programming :)) I think your solution
is
> really perfect!
I MADE!!!! -->Re: This is my program.Can you make it shorter?<--
I made:
var
i:longint;
begin
randomize;
for i:=1 to 1000000 do write(chr(97+random(26)));
end.
use 97 instead of ord('a')!!!
I still believe u r geinus
Aidin
Re: I MADE!!!! -->Re: This is my program.Can you make it shorter?<--
To make this program shorter one can substistute "1000000" on 1e6.
Re: I MADE!!!! -->Re: This is my program.Can you make it shorter?<--
P.S. To Smilodon_am: You can't use 1e6 with the FOR cycle because it needs only INTEGER expressions.
Edited by author 03.01.2009 01:40
Edited by author 03.01.2009 01:41
Re: I MADE!!!! -->Re: This is my program.Can you make it shorter?<--
I also solved like this but the way I got to this solution was kind of intuitive, so I am not still sure why this solution gets AC, I can't prove it. Do you have any proof why it does so?