Page 1 of 8

Internal compiler error

Posted: Thu Feb 17, 2005 12:57 pm
by Sedefcho
I am trying to submit my Java program.

I have solved many problems using Java ( not that many but
enough to be aware of how should I form my Java file ).

Well, now I have a problem I have never seen before.

I get a Compile Error and I receive an email
which says only this:

Here are the compiler error messages:
gcj: Internal compiler error: program jc1 got fatal signal 11


Well, I have a main class, it is not public and
I have a main function in it.

Anybody has an idea what the reason could be ?!

Posted: Thu Feb 17, 2005 12:57 pm
by Sedefcho
My Java program is trying to solve problem 10815 by the way.

10815 - Andy's First Dictionary

Posted: Wed Feb 23, 2005 12:00 am
by w k
Hi,

What is correct answer to the input:

"Andy's" ?

Is it:

andy
s

or

andy's

or andys ?


Wojciech

Posted: Wed Feb 23, 2005 12:48 am
by Krzysztof Duleba
Problem statement makes it pretty clear: "a word is defined as a consecutive sequence of alphabets". In your case, "Andy" and "s" are two separate words and the right output is the first one.

Posted: Wed Feb 23, 2005 8:55 am
by Observer
Hi,

I prepared the judge input, and I can tell you that there are NO apostrophes in the file. :wink:

10815 -Andy's First Dictionary-Runtime Error

Posted: Fri Feb 25, 2005 9:41 pm
by birdegg
Hi~
I try this problem several time, but always got "runtime error" less
than 0.5sec. I use array of size 5000*5000 to store.
I think it's quite sufficient. Can somebody give me a hint.
thanks.~ :wink:

Code: Select all

#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>

#define MAXLEN 5000
#define MAXWORD 5000

void removeNonAlpha(char t[],int len);
int compare(const void *a, const void *b);

char store[MAXWORD][MAXLEN];
char t[MAXLEN];
long globali=0;

int main(){
        code removed.
}

Posted: Fri Feb 25, 2005 11:50 pm
by misof
In the process when splitting the current "token" into alphabetic parts your current number of words may exceed 5000.

Posted: Tue Mar 01, 2005 3:59 am
by birdegg
misof wrote:In the process when splitting the current "token" into alphabetic parts your current number of words may exceed 5000.
thank you,misof
finally I got AC.
I use getchar() rather than scanf()
but still need a large array to store and then sort.
I am wondering how those guys solve this problem with only 64KB of memeories.

Posted: Tue Mar 01, 2005 6:33 am
by Larry
The memory usage for very short programs are known to be inaccurate - ignore them.

10815 - Andy's First Dictionary

Posted: Wed Mar 16, 2005 3:40 pm
by Sakib
Can anyone tell me what will be the array size that will get AC.
:cry:
I am getting either MLE or RTE.
please help!!!!!!!!!!!!

Posted: Wed Mar 16, 2005 4:13 pm
by mf
Depends on what you're using the array for... I needed just a bit above 5000 entries for words, 256 bytes each.

There's much more than 5000 words in the input, but less than 5000 unique ones.

Posted: Wed Mar 16, 2005 4:16 pm
by sumankar
Hi,

Use a linked list, a binary tree to be precise.That'll give a good performance as well.

Regards,
Suman.

10815 - Andy's dictionary

Posted: Thu Mar 17, 2005 1:13 pm
by taborda
i keep receiving wrong answer...any critical input i can't remembr??...

Posted: Thu Mar 17, 2005 3:14 pm
by sumankar
Few things:

1) please use an already existing thread for a given problem, if there's one that is.
2) check your method that extracts words, some bug there possibly
3) the array or whatever data structure you are using to store the words,
is probably small
4) maybe some problem with lexicographic ordering of words,
...
I can go on, throwing stones, until and unless you come up with your algo.

Regards,
Suman.

Posted: Fri Mar 18, 2005 4:44 am
by lord_burgos
My idea

string a[MAX+1];
string b[MAX*MAX];
for x = 1 to n begin read(a[x]);
nc = 0;
for x = 1 to n begin
for y = 0 to n-1 begin if(!leter(a[x][y])) a[x][y] = ' ';
buf = strtok(a[x], " \n");
while(buf != NULL){
b[nc++] = buf;
buf = strtok(NULL , " \n");
}
endfor

sort(b[x]);
print(b[0])
for x = 1 to nc-1 begin if(b[x] != b[x-1]) print(b[x]);