TWINSNOW - Snowflakes

no tags 

Người ta nói rằng không có hai bông tuyết nào giống hệt nhau! Bạn hãy thử viết một chương trình nho nhỏ để kiểm tra xem điều này có đúng không nhé :D Mỗi bông tuyết được nhắc tới ở đây đều có 6 cánh, và hai bông tuyết được gọi là giống nhau nếu chúng có độ dài các cánh tương ứng bằng nhau ;)

Dữ liệu

- Dòng đầu tiên chứa số nguyên n là số bông tuyết cần kiểm tra.
- n dòng tiếp theo, mỗi dòng gồm 6 số nguyên (trong khoảng 0..107) là độ dài các cánh của bông tuyết tương ứng, được liệt kê theo thứ tự vòng quanh bông tuyết.

Kết quả

Nếu không có bông tuyết nào giống nhau, hãy ghi ra:

No two snowflakes are alike.

Nếu tìm được ít nhất một cặp bông tuyết giống nhau, hãy ghi ra:

Twin snowflakes found.

Ví dụ

Dữ liệu:
2
1 2 3 4 5 6
3 4 5 6 1 2

Kết quả:
Twin snowflakes found.

Giới hạn

- 0 < n ≤ 105.

Bài không khó, để hẳn TimeLimit 2s, nhưng AC thì là cả một vấn đề tinh tế ;))


hide comments
olexg: 2020-12-14 21:10:30

Why is having a vector in which there is 12 different snowflakes for 1 given, and then sorting them using custom sort incorrect? It is giving me ac

adrenaleon07: 2020-08-10 18:22:43

Well in my guess the correct logic is whatever u do u cannot change the neighbours of a particular arm.. so think like undirected graph and make nodes and save in vector(size will be 12) and use it as reference to find the duplicate.. in my guess this is the right approach.. neighbouring here is invariant.. eg.. for the above eg for 1 2 3 4 5 6 we have the vector as {{1,6},{6,1},{1,2},{2,1},{2,3},{3,2}....} and so on.. note: make sure to insert sorted vector in map. else it may not match..

Last edit: 2020-08-10 18:23:35
Mitch Schwartz: 2014-05-24 00:34:05

"...but the incorrect logic... got AC on both the places which is definitely not right."

Your writing does not demonstrate a firm grasp of the difference between weak test data and wrong test data.

The issue merits further investigation, and I hope my previous comment was clear enough regarding action to be taken on the problem. We can email the problem setter about the issue, but he wasn't responsive in the past, so it may be a lost cause. We probably will not contact admins about this, as they tend to be busy and not interested in getting between the problem setter and his responsibility (or maybe they would phrase it a little differently, but with the same effect).

Thanks for commenting about it, and for clarifying that you took reversals into account.

Last edit: 2014-05-24 00:53:26
The_ROCK: 2014-05-23 19:46:36

I'm sorry but in my correct logic code(as to me it seems) I have considered both rotation and reversal which got me WA on a single testcase 2-b on the official site and thus here too but the incorrect logic(which sorts the six lengths) got AC on both the places which is definitely not right.
I think a single test case is wrong as inferenced from the official site but still I don't know.

Last edit: 2014-05-23 19:49:07
Mitch Schwartz: 2014-05-23 18:52:05

@Saurabh Prakash: You should have acknowledged the fact that your claim directly contradicts previous comments stating that the test data is merely weak (as opposed to wrong). You should also have mentioned that you are taking into account both rotation and reversal of the list of lengths, since that's not clear in (this version of) the problem statement. These things would give you more credibility. I'm not motivated to verify your claim at the moment, but maybe someone else will be.

On the basis of weak test data and the fact that there are already 423 solvers anyway, I think moving to tutorial is fine (if other EB members agree), and if the test data is found to be wrong then it can be hidden.

The_ROCK: 2014-05-23 18:21:16

link to original problem statement of the contest.
http://wcipeg.com/problem/ccc07s2p2
I ran my correct logic code and it gave a WA on Test Case 2-b; but wrong logic code got AC on all test cases.

Rishav Goyal: 2014-05-22 22:48:28

@Francky : Could u pls make the problem statement clear in comment. It seems something conflicting in the statements.
thankss.
--ans(Francky)--> We can see in comment that it was used like that for CCC07 (same description, same files). I'm waiting for reply for other EB advice ; there's no urge to act. Please be patient. We'll perhaps modify something.

reply(Rishav) : @Francky could u please give a link to originol problem , i tried search CCC07 but found nothing just.
--ans(Francky)--> My search engine gave me that.


Finally : Order does not matter.

Last edit: 2014-05-23 07:32:10
Rishav Goyal: 2014-05-22 22:17:40

(edit Francky)***********.that's all.
it's too much.
--(Francky)--> Please be respectful even if the task is very weak. The problem could be too old to be moved...

reply (rishav) : Sorry, man.! Actually it sucks if we still have wrong statement. even after so many comments. !!

Last edit: 2014-05-22 22:35:47
The_ROCK: 2014-05-17 09:30:36

This is very wrong. The correct logic i.e considering the lengths of arms of snowflakes in order (consecutive) is getting WA whereas the wrong logic i.e just sorting the six lengths is getting AC.
Pls correct the test data.


Added by:AnhDQ
Date:2009-05-11
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:CCC07