「You know what? I have a lot of friends! I am so strong.」
「Show off = =, tell you what, I have a huge pack of friends, too!」
「Come ’on, I think neither of you two is the one that have the most friends. I am!!」
Well, how about let’s count how many friends each of us has?‛
As for ‚friend‛, here, it must be approved by both people in the ‚friendship relation‛, that is, if Jack were to be James’ friend, then so was James Jack’s friend. Now the scientist Tom is doing a research on a group of students. Tom asks everybody from the group to write down how many friends they have. However, some people, due to self-esteem issue, might lie to Tom (i.e. what they write down is not true!). As an enthusiastic programmer, you decide to write a program to analyze whether the research result is trustable.
There are multiple test cases in the input file, terminated by EOF. For each test case, the first line contains one integers n (1 ≦ n ≦ 10000) , indicating the number of students. Second line contains n integers, s1, ..., sn, where 1 ≦ si ≦ n, is the number of friends which ith student have.
For each test case, if any student lies, please output: Weak, otherwise output: Strong
5 4 2 1 2 1 3 2 2 1
Strong Weak
Migrated from old NTUJ.
ttcpc2009 problem 7
No. | Testdata Range | Score |
---|