Please read the new rule regarding the restriction on the use of AI tools. ×

meta-totle's blog

By meta-totle, history, 4 years ago, In English

In the first problem of this round the number of operations is the number of bags and you have to include all the indices of the bags. The order of the indices doesn't matter because every bag gets added with the number of candies of the unaffected bag, in the end filling every bag with equally n(n+1)/2 candies. This is what I understand. There is no need to minimize m operations either, so can anyone tell me why this submission is wrong?

https://codeforces.me/contest/1447/submission/98465795

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The order of the indices does matter. In the j-th operation, you will pick one bag and add j candies to all bags apart from the chosen one. What matters is the index of the operation, not the number of candies in the specified bag.

Why are you writing a blog post on something that can easily be solved by rereading the question?