Bugs in pascal compiler ? (problem 348)

Write here if you have problems with your Pascal source code

Moderator: Board moderators

Post Reply
Sanya
New poster
Posts: 5
Joined: Mon Oct 27, 2003 3:05 pm
Location: Ukraine

Bugs in pascal compiler ? (problem 348)

Post by Sanya » Tue Dec 16, 2003 3:12 am

Hello. I don't understand one thing.
I've posted Problem 348 in Pascal and C versions. For Pascal ver. reply is Wrong Answer and for C ver. is Accepted :o
Is this due to bugs in Free Pascal or have I made some mistakes?
[pascal]
var
t:integer;
q:longint;
n,i,j,k,l:byte;
p:array[0..10] of integer;
a:array[1..10,1..10] of longint;
b:array[1..10,1..10] of byte;

... { removed by fpnc }
[/pascal]

[c]
#include <stdio.h>
int t,q,n,i,j,k,l;
int p[11];
int a[11][11],b[11][11];

... /* removed by fpnc */
[/c]

fpnc
System administrator
Posts: 201
Joined: Sun Oct 07, 2001 2:00 am
Location: Valladolid, Spain

Post by fpnc » Fri Dec 26, 2003 7:51 pm

It is not a bug. The programs are not exactly the same. You've used byte's instead of integer or longints... Try to change this... AC isn't it?

Avoid using bytes or short ints specially when you allocate few Kb (in this program, the arrays are quite small, so why should you want to reduce the memory so much?)
Best regards,

Fernando N

Post Reply

Return to “Pascal”