Bugs in pascal compiler ? (problem 348)

Write here if you have problems with your Pascal source code

Moderator: Board moderators

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

Bugs in pascal compiler ? (problem 348)

Post by Sanya »

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?
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 }

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

... /* removed by fpnc */

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

Post by fpnc »

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”