UVa 10050

From Algorithmist
Jump to navigation Jump to search

10050 - Hartals[edit]

Summary[edit]

Simulate the hartal strikes given the number of days, the number of political parties, and the hartal parameter of each party.

Explanation[edit]

  • Simulate each party and count the number of strikes over the number of days excluding friday and saturday.

Optimizations[edit]

For each party if h(i) is divisible by another h(j) discard that h(i). Another Tricks: Just Count the columns which has atleast one hartal. The hartal days are multiplier of hartal parameters.

References[edit]

Solution by shawon[edit]

http://shawonruet.blogspot.com/2016/07/uva-10050-hartals.html

solution by erfanashorion[edit]

download c++ solution on:(http://s2.picofile.com/file/7122018816/10050.cpp.html) my email:erfanashorion@gmail.com