339 - SameGame Simulation

All about problems in Volume 3. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

minskcity
Experienced poster
Posts: 199
Joined: Tue May 14, 2002 10:23 am
Location: Vancouver

Post by minskcity » Fri Jul 08, 2005 1:28 am

Post your code, I'll have a look at it.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Fri Jul 08, 2005 6:44 pm

Here is the code...

Code: Select all

Cut after Accepted...
Why I m getting WA? :-?
Last edited by Jan on Mon Jul 11, 2005 9:11 pm, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage

minskcity
Experienced poster
Posts: 199
Joined: Tue May 14, 2002 10:23 am
Location: Vancouver

Post by minskcity » Mon Jul 11, 2005 4:26 am

Run your code on the following input:

Code: Select all

9 31
1 0 0 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 
0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 1 
1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 0 0 0 
0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 1 0 0 0 1 
1 1 0 0 0 0 0 0 1 1 0 1 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 
1 1 1 1 0 0 1 1 0 1 0 0 1 0 1 0 0 1 1 1 1 1 1 1 0 0 1 0 1 1 1 
1 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 0 1 1 
0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 
0 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 0 0 0 1 1 1 0 
1 27 
-6 23 
27 -17 
-4 19 
-19 -31 
18 -17 
-31 20 
-21 16 
13 -22 
-9 15 
-25 20 
29 4 
8 -21 
-20 -13 
-15 20 
-21 -3 
23 -9 
4 -25 
25 -1 
9 -14 
-12 14 
-23 -1 
24 -25 
23 -3 
-1 -7 
-2 -31 
19 25 
13 12 
18 -11 
-12 -15 
14 15 
26 5 
-6 1 
19 16 
30 7 
12 -1 
0 0

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Mon Jul 11, 2005 9:18 pm

Thank u very much minskcity. After testing your input set I found my bug and managed to get accepted. I changed my code a little bit and got it!!

Thank u again :D.
Ami ekhono shopno dekhi...
HomePage

yiuyuho
A great helper
Posts: 325
Joined: Thu Feb 21, 2002 2:00 am
Location: United States
Contact:

Post by yiuyuho » Sun Mar 12, 2006 9:09 am

Hmm... I thought the UVa Judge is generous with spacing, such that if the output are differ by spacing, then it will give PE, which is treated as problem solved. Why is it different with this problem?

User avatar
tmdrbs6584
Learning poster
Posts: 98
Joined: Sat Jan 21, 2006 12:45 pm
Location: Busan,Corea(Republic of)

qq

Post by tmdrbs6584 » Tue Mar 14, 2006 10:55 am

?w

User avatar
gradientcurl
New poster
Posts: 16
Joined: Mon Jun 26, 2006 9:33 am
Contact:

samegame simulation: PE all the way

Post by gradientcurl » Thu Dec 21, 2006 6:07 pm

I've use minskcity previous input and the following is the output:

Code: Select all

Grid 1.
           
           
           
    1      

Grid 2.
    0

Grid 3.
    0    
    0 0 0

Grid 4.
    Game Won
exactly the same spacing, blank lines only between separate test cases, yet i cant seem to figure out why pe :P

below is my coding.. (im not sure whether posting PE coding is allowed now, since PE is now considered as "not correct");

Code: Select all

removed after AC
Last edited by gradientcurl on Thu Dec 21, 2006 8:23 pm, edited 1 time in total.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Thu Dec 21, 2006 7:16 pm

Use

Code: Select all

   printf("\n"); // added
   return 0; // I think you know where it is :-)
Hope you get accepted.
Ami ekhono shopno dekhi...
HomePage

User avatar
gradientcurl
New poster
Posts: 16
Joined: Mon Jun 26, 2006 9:33 am
Contact:

thanks

Post by gradientcurl » Thu Dec 21, 2006 8:24 pm

thanks jan, it was useful.

jordi fierro
New poster
Posts: 1
Joined: Fri Jun 01, 2007 12:51 pm

Post by jordi fierro » Fri Jun 01, 2007 1:10 pm

Hi! I've tried all your i/o you write in this post and i get the same results as you, and i still get WA. :(
Can anybody post more sample inputs or tell me which are the difficult inputs? Thank you a lot and sorry about my english!!

User avatar
LPH
New poster
Posts: 34
Joined: Mon Nov 17, 2003 10:41 am

Post by LPH » Sun Aug 19, 2007 6:28 pm

jordi fierro wrote:Hi! I've tried all your i/o you write in this post and i get the same results as you, and i still get WA. :(
Can anybody post more sample inputs or tell me which are the difficult inputs? Thank you a lot and sorry about my english!!
Do you tried Jan's last post?

As an aside, I think this problem has no PE: because if you don't have spaces in the place of empty cells, you'll get WA. It means that this problem won't get PE at all (or that would be PE rather then WA).
So if you didn't print the last blank line, it will also considered as WA. Jan's last post means this. (Or in other words, this problem requires a blank line after each test case.)
I got WA before applying this, and got Acc after.
LPH [acronym]
= Let Program Heal us
-- New Uncyclopedian Dictionary, Minmei Publishing Co.

anacharsis
Learning poster
Posts: 69
Joined: Mon Feb 09, 2015 1:56 am

Re: 339 - SameGame Simulation

Post by anacharsis » Fri Jun 19, 2015 6:11 pm

Some ( possibly ) helpful test cases

Input:

Code: Select all

4 4
0 0 0 2 
0 1 0 2 
0 0 2 1 
2 2 2 0 
3 4
3 1
3 1
1 1
2 3
1 4
4 1
3 1
0 0
5 4
2 2 1 1 
1 1 0 1 
2 1 2 1 
2 2 2 2 
0 0 0 2 
3 2
3 4
4 4
3 2
4 2
1 3
2 3
5 1
4 2
1 1
0 0
4 5
2 0 2 0 1 
1 0 2 1 0 
2 0 1 1 2 
0 2 2 0 2 
1 1
3 1
3 2
3 3
2 5
2 5
4 3
2 4
2 5
1 3
0 0
4 4
0 1 2 1 
0 1 0 2 
2 1 1 2 
0 0 1 0 
3 2
2 1
1 4
3 2
1 4
3 3
4 2
4 2
0 0
4 4
2 2 1 0 
2 2 0 2 
1 0 1 1 
1 2 0 1 
3 2
2 3
4 4
3 1
2 2
3 4
1 4
1 1
0 0
4 4
2 0 0 1 
2 1 1 2 
0 2 0 2 
1 1 1 1 
4 1
4 3
3 3
2 1
3 3
3 2
4 1
2 4
0 0
4 4
1 1 0 1 
0 1 2 0 
2 0 2 2 
1 1 0 2 
4 2
3 1
4 3
4 3
4 2
3 1
1 4
4 1
0 0
4 5
2 0 1 2 2 
0 0 2 1 1 
1 2 2 1 2 
2 0 1 0 0 
2 1
4 3
1 1
4 2
4 3
1 1
2 1
2 1
2 2
1 3
0 0
5 5
0 0 1 2 0 
1 1 0 0 2 
2 2 2 1 1 
2 0 2 0 1 
1 2 0 0 2 
5 5
4 1
3 1
1 2
1 4
1 1
2 5
4 5
2 4
1 1
3 2
3 5
0 0
4 5
1 2 0 2 0 
0 1 1 1 2 
1 1 2 1 0 
0 1 2 2 0 
1 4
1 5
2 2
3 5
1 1
3 2
4 2
1 1
1 5
1 2
0 0
0 0

Output:

Code: Select all

Grid 1.
           
           
        0  
    2 1 1  

Grid 2.
    Game Won

Grid 3.
             
    0        
    2        
    1 1      

Grid 4.
           
           
    0 0 0  
    2 2 1  

Grid 5.
           
      0    
    2 0 2  
    0 1 0  

Grid 6.
           
      2 0  
      1 1  
    0 0 0 1

Grid 7.
        0 2
    2 0 2 2
    0 1 2 0
    1 1 0 1

Grid 8.
        1 0 0
        2 1 2
    2   2 1 1
    1 0 1 2 2

Grid 9.
          2  
        0 1  
        0 1  
        1 2  
    2 1 2 0  

Grid 10.
             
    0   2    
    0   2 2 2
    1 2 0 2 0


Post Reply

Return to “Volume 3 (300-399)”