Greetings to all.
I started to solve "10081. 6-Coloring of Planar Graphs" problem.
Unfortunately data which is given there is longer then 255 characters.
When i use such code:
for i:=1 to t do
begin
Readln(S); //<-- line shorter then 255 characters
S:=Copy(S,12,Length(S));
n:=StrToInt(Copy(S,1,Pos(' ',S)-1));
S:=Copy(S,Pos(' ',S)+1,Length(S));
S:=Copy(S,11,Length(S));
e:=StrToInt(Copy(S,1,Pos(' ',S)-1));
Readln(S); //<-- line longer then 255 characters
for i2:=1 to e do
begin
p:=Pos(',',S);
v1:=StrToInt(Copy(S,2,p-2)); //<-- line which causes the NZEC error
end;
end;
I get NZEC error, i figured out that its a error caused by lines longer then 255 characters. Perhaps the string is cutted in the midle when its readed, and I am trying to convert some "not-number" characters.
So i changed S: String, to S: AnsiString;
But then a running time drasticly increases. This is maximum 10 second task and i get "time limit exceeded" message. I am SURE that i caused by S:AnsiString, because i am only reading the data as it's showed above. Program do not process any algorithms...
I also tried {$H+} and {$MODE Delphi} directives but i get the same message. What should I do to use long strings?
The windows version of this program works fine.
I will be greatfull for any help,
Best Regards,
Wodzu / Marcin Czernow