SEACO - WA for 50 points!!

Can anyone please help me with a test case or point out why I’m failing the SEACO problem for 50 points!! my solution I tried so many random inputs and it worked but couldn’t find the one it doesn’t work for.

Thanks

1 Like

My code is also giving only 20 points while i have implemented the solution according to the editorial. Please have a look and help.

Here is the plaintext link. And submission result.

There you go.

Input
1
5 10
1 1 1
2 1 1
1 1 1
2 1 3
1 1 1
2 1 5
2 1 6
2 1 7
2 1 8
1 5 5
Your Output
101 0 0 0 1
Expected Output
112 0 0 0 1 

I am not able to understand this piece of code-

for(int h = 0;h<Icount;h++)
       {
        s[i][h] = (int) ((s[i][h]+s[j][h])%Mod);
    }

What does Icount do here?

1 Like

@vijju123

Thanks!! so, this for loop copy the previous 2 type

for ex

3 4
1 2 3
1 1 2
2 1 2
2 1 3 

so when I made the 2d array to store the values of 2 types. I first count the number of 1 types

if(type[i] == 1)

Icount++;

It’s just to save some time!! for example in the above array
It will look something like this when we will store the values in 2 type

s[][]

3rd command 1 1 0 0

4th command 2 2 0 0

so we don’t need to add the 3rd column and 4th column because it will always be zero!!
so just go through the s[][Icount] to store the values

Now our array will look like

3rd command 1 1

4th command 2 2

I hope it going to make sense to you, but if it doesn’t I’m very bad at explaining things

Are you assuming that all type 1 commands are given first? Because thats not guaranteed in input, and that was the first thing in my mind when I made the corner case for your algorithm.

Like, I feel that loop goes from 0 to icount . Is it incrementing value of all type 1 commands correctly? Are you sure that none of them are being left out?

1 Like

you right but I have another for loop at the end that fixes all the stuff, but I’ll try to figure out why my code gives the wrong answer for your input, thanks

I think you right there’s something fishy about the Icount, I’ll check it out after I get done with my classes in few hours

For a moment I forgot that you were from US and was all ಠ_ಠ that which sadistic professor is taking class at midnight XD

1 Like

lol I live in the US but I’m from India - Look at my profile - Vishwajeet Singh is my name haha

Yeah I saw that. :3

Sometimes I pay more attention to name than country XD

oh wow you became the yellow chef with 5 stars congratulations I just saw it lol

Input
1
5 10
1 1 1
2 1 1
1 1 1
2 1 3
1 1 1
2 1 5
2 1 6
2 1 7
2 1 8
1 5 5
Your Output
101 0 0 0 1
Expected Output
112 0 0 0 1
I am not able to understand this piece of code-

for(int h = 0;h<Icount;h++)
{
s[i][h] = (int) ((s[i][h]+s[j][h])%Mod);
}
What does Icount do here?

Hehehehehe. Not a chef yet, just a “cook” :3

1 Like

¯__(ツ)__/¯

you right changed the Icount to “m” and got your test case right but still getting WA for 50 points (-___-)t

When can someone be a chef?