Page 2 of 2
Re: Problem 067
Posted: Sat May 07, 2011 11:42 pm
by jaap
Please remove that number from your post because that is actually the correct answer. It should be accepted if you type it in correctly.
Re: Problem 067
Posted: Mon May 09, 2011 4:03 am
by matts1
Sorry about that
Re: Problem 067
Posted: Thu Jun 23, 2011 6:20 pm
by alvoha
I have a problem. I read the input from a text file, but i get a wrong solution when i read from the 'triangle.txt' file. I, however, get the right solution when i copy the content of triangle.txt over in a new file, and read from that one instead. I can see that triangle.txt is 100 Bytes bigger than my new file.
Can anyone tell me what those 100 bytes are? As I'm sure that's what caused all my headache

. Thanks!
Re: Problem 067
Posted: Thu Jun 23, 2011 7:28 pm
by jaap
alvoha wrote:I have a problem. I read the input from a text file, but i get a wrong solution when i read from the 'triangle.txt' file. I, however, get the right solution when i copy the content of triangle.txt over in a new file, and read from that one instead. I can see that triangle.txt is 100 Bytes bigger than my new file.
Can anyone tell me what those 100 bytes are? As I'm sure that's what caused all my headache

. Thanks!
Are you working on a non-Windows machine maybe? If so, it could the the line endings. Windows uses 2-byte line endings (ascii 10 and 13), whereas Linux and most other operating systems use only 1-byte endings (ascii 10 only). A file with those extra endline characters may cause your program to fail.
Re: Problem 067
Posted: Fri Jun 24, 2011 3:40 am
by rayfil
Effectively, the lines endings in the subject file is the single-byte ascii 10. Some programs can handle such files (regardless if under Windows or other) as you have experienced with the one you used to read the file before saving it back. However, your programming environment seems to require a two-byte ending in order to process the file correctly.
In the future, you may want to check the type of line ending of any text file you need before trying to process it. There are many free hex editors on the internet.
Re: Problem 067
Posted: Sat Jun 25, 2011 3:51 pm
by alvoha
Thanks! I'm using Linux and Vim so it was definitely the 2 byte newlines in triangle.txt that caused trouble. Thanks for the hex-editor tip.
Re: Problem 067
Posted: Sun Aug 07, 2016 6:51 pm
by Sahexa
Hello,
I'm trying to submit this problem couple of hours, but every time i'm seeing "Incorrect answer".I think my algorithm is right.
I tested it with Problem 18 and 1-2 another triangles and it returned every time right answer except Problem 67.
Is there a problem with Problem 67?
Re: Problem 067
Posted: Sun Aug 07, 2016 7:13 pm
by hk
No, there isn't.