ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1964. Chinese Dialects

Why find two mins is wrong algoritm?
Posted by AlexRad 14 Apr 2015 10:54
What is correct algorithm?

My program that find 2 mins and print Math.Max(min1 + min2 - n, 0) don't pass test 13.
Re: Why find two mins is wrong algoritm?
Posted by MVM 15 Apr 2015 01:45
Consider test

3 3
2 2 2

Your solution says that there is a person who knows three different dialects.
But we can construct an example where it is not true:
1) first person knows dialects number 1 and 2
2) second knows 1 and 3
3) third knows 2 and 3
Re: Why find two mins is wrong algoritm?
Posted by abid1729 18 Jul 2019 07:19
Do u give me ur wrong code?