You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/fCUW_MhWEW8
vector<int> acmTeam(vector<string> topic) { int h = 0, cp = 0; for(int i = 0; i < topic.size() - 1; i++){ bitset<500> a = bitset<500>(topic[i]); for(int j = i + 1; j < topic.size(); j++){ bitset<500> b = bitset<500>(topic[j]); bitset<500> c = a | b; int x = c.count(); if( x > h){h = x; cp = 1;} else if( x == h) cp++; } } return {h, cp}; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/fCUW_MhWEW8