You are viewing a single comment's thread. Return to all comments →
C#
public static List<int> acmTeam(List<string> topic) { var teamLen = topic.Count(); var topicLen = topic.First().Length; var maxKnown = 0; var maxTeams = 0; for (int i = 0; i < teamLen; ++i) { var t1 = topic[i]; for (int j = i + 1; j < teamLen; ++j) { int know = 0; var t2 = topic[j]; for (int k = 0; k < topicLen; ++k) { if (t1[k] == '1' || t2[k] == '1') ++know; } if (know == maxKnown) ++maxTeams; else if (know > maxKnown) { maxKnown = know; maxTeams = 1; } } } return new List<int>() {maxKnown, maxTeams}; }
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
C#