Page 1 of 1

Posted: Wed Apr 16, 2003 4:34 am
I get WA for this one, here's my code
hopefully someone will tell me what's wrong

[c]

cut , got AC now

[/c]

Posted: Mon May 26, 2003 9:31 am
i also got WA...
what u do to get AC deddy??
help me please i've stucked for this one

Posted: Mon May 26, 2003 2:14 pm
I only increase the array size with no further change in my code
and it get Accepted.

I think something funny like this could
happen, like when they say you that
the max row and col is 10 , but actually
you need to initialize more than that.

In this case, just declare abundant array size
like

char words[10] == > into char words[10000]
or
char map [10][10] == > into char map [200][200]

something like this ussually lead to Runtime Error
try to sacrifice memory and if you still got
WA , maybe you made little mistake
in the algorithm, like when numbering the map.

hope that helps.

Posted: Mon May 26, 2003 2:46 pm
i've increase the array, but still get WA
here is my code :

Code: Select all

``````#include <stdio.h>

char buffer[100][110];
char number[100][110];

void accross(int h, int w) {
int i,j,flag;
printf("Across\n");
for(i=0;i<h;i++)
for(j=0;j<w;j++) {
if(number[i][j]!='0') {
flag=0;
if(j==0) flag=1;
else if(buffer[i][j-1]=='*') flag=1;
if(flag) {
printf("%3d.",number[i][j]-'0');
for(flag=j;buffer[i][flag]!='*'&&flag<w;flag++) putchar(buffer[i][flag]);
printf("\n");
}
}
}
}

void down(int h, int w) {
int i,j,flag;
printf("Down\n");
for(i=0;i<h;i++)
for(j=0;j<w;j++) {
if(number[i][j]!='0') {
flag=0;
if(i==0) flag=1;
else if(buffer[i-1][j]=='*') flag=1;
if(flag) {
printf("%3d.",number[i][j]-'0');
for(flag=i;buffer[flag][j]!='*'&&flag<h;flag++) putchar(buffer[flag][j]);
printf("\n");
}
}
}
}

if(buffer[i][j]=='*') return 0;
if(i==0||j==0||buffer[i][j-1]=='*'||buffer[i-1][j]=='*') return 1;
return 0;
}

void build(int h, int w) {
int i,j,count=1;
for(i=0;i<h;i++)
for(j=0;j<w;j++) number[i][j]='0';
for(i=0;i<h;i++)
}

main () {
int i,j,h,w,count=1;
while(1) {
scanf("%d %d\n",&h,&w);
if(h==0||w==0) return 0;
for(i=0;i<h;i++) {
for(j=0;j<w;j++) buffer[i][j]=getchar();
scanf("\n");
}
if(count!=1) printf("\n");
printf("puzzle #%d\n",count++);
build(h,w);
accross(h,w);
down(h,w);
}
}
``````

Posted: Mon May 26, 2003 4:15 pm
maybe the problem is scanning the input

Code: Select all

`````` while(1) {
scanf("%d %d\n",&h,&w);
if(h==0||w==0) return 0;
for(i=0;i<h;i++) {
for(j=0;j<w;j++) buffer[i][j]=getchar();
scanf("\n");
}
.......
``````
while in my solution

Code: Select all

`````` while (scanf ("%d",&r) == 1) {
if (r==0) break;
scanf ("%d",&c);
for (i=0;i<r;i++)
scanf ("%s",map[i]);
........
``````
I haven't compiled your solution though.

Increase the array size.....

Posted: Thu Dec 11, 2003 3:46 pm
Even though the problem states r<=10 c<=10 Take a large array size i took 100x100
It really frustrated me.................. but i eventually solved it..
Sorry that the code is not commented but is self explanatory.....
Here is my code...
[cpp]
CUT
[/cpp]

Posted: Sun Dec 19, 2004 4:05 pm
I hate this kind of Disgusting problem description.
http://acm.uva.es/p/v2/232.fix.html
it say that problem (output) description has been fixed, my question is where??
in problem it is still r<=10 and c<= 10 and in input file it is still more then 100X100 inputs!!

Posted: Tue Aug 23, 2005 4:43 am
Words in each list must be output one-per-line in increasing order of the number of their corresponding definitions.
What it means and what is the numbering process.

Posted: Mon Sep 07, 2009 6:48 pm
HI GUYS AM STUCK IN THIS PROBLEM FOR 3 HOURS BUT I'M NOT GETTING TO THE RIGHT OUTPUT IMPLEMENTATION

Re: 232 WA -- crosswords answer

Posted: Mon Jun 16, 2014 12:28 pm
This is very easy problem. But i can't get acc. Why wa???

Code: Select all

``removed, after acc..``
I am really full. I was trying to read and write from file.

// #ifndef ONLINE_JUDGE
freopen("input.txt", "rt", stdin);
freopen("output.txt", "wt", stdout);
// #endif

Re: 232 WA -- crosswords answer

Posted: Mon Jun 16, 2014 8:15 pm
Don't read and write to files.