13086 - Pirates of the Mega Ocean

All about problems in Volume 130. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Post Reply
dibery
Learning poster
Posts: 76
Joined: Sat Feb 23, 2013 4:16 pm
Location: Taiwan, Taipei
Contact:

13086 - Pirates of the Mega Ocean

Post by dibery »

Some explanation for this problem. In case there's anyone who's also confused with this problem.

1. There are N islands in total, M of which are small.
2. S_i means the ID of small island. In the following case,

4 2
0 1 1 2 1 4

There are 4 islands, 2 normal, 2 small ones.
Population is [ 2, 3, 4, 5 ], ID of small islands are [ 4, 3 ].
That means, island 3 & 4 are small, and island 1 & 2 are normal.

One more hint, use long long.
Life shouldn't be null.
Post Reply

Return to “Volume 130 (13000-13099)”