Hello, Can you please explain how the solution is 22 to the given sample example in the problem description. Click to view problem description
Thanks in advance
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 151 |
Hello, Can you please explain how the solution is 22 to the given sample example in the problem description. Click to view problem description
Thanks in advance
Name |
---|
Hi! For each triplet of columns it is sufficient to explain spottiness if its patterns only appears on spotty cows or if its patterns only appears on plain cows.
The triplet {1, 4, 7} is sufficient
The triplet {1, 2, 7} isn't sufficient because the pattern AAT appears on spotty cows and plain cows
The solution to the given sample example are the triplets:
I am having hard time understanding as to how to generate patterns through triplets for each type of cows. This is causing big trouble from my side.
From the below example
For spotty cows, the pattern formed by triplet 1,2,3 which is AAT can also be formed by spotless cows through triplet 1,7,3.
Please correct me if I am wrong?
You should consider triplets independently. The AAT pattern does not appear in the triplet {1,2,3} of any plain cow
thanks alot. I think I am getting the point now. I will do a bit of analysis on my side and keep you posted.
I was able to come up with a solution but the time complexity was not as good as O(N*M^3) and I had issues with my solution acceptance. Now, finally I was able to finally I was able to come up with O(N*M^3) solution and my solution now is accepted.
Thanks for your quick response.
You're welcome! :D
who can give me a hint, because I don't have any idea
Refer to this usaco.guide Video
Thanks, I will watch it and I hope I get an idea for the silver edition