JOIN
 Revision History
 Select a Forum     Round Tables New Member Discussions News Discussions Algorithm Matches Marathon Matches NASA Tournament Lab TopCoder Cookbook High School Matches Sponsor Discussions Development Forums Design Forums Search My Post History  |  My Watches  |  User Settings Forums TopCoder Cookbook Algorithm Competitions - Rewriting Phase Re: Iterating Over All Subsets of a Set Revision History (2 edits)
 Re: Iterating Over All Subsets of a Set (response to post by dimkadimon) // iterate over all the subsets with no more than m elementsfor (int i = 0; i < (1<< m ? i+1 : (i|(i-1))+1){ ...}why i can't modify it as below?for (int i = 0; i < (1<<=m; i++){ ...}
 Re: Iterating Over All Subsets of a Set (response to post by dimkadimon) // iterate over all the subsets with no more than m elementsfor (int i = 0; i < (1<< m ? i+1 : (i|(i-1))+1){ ...}why i can't modify it as below?// iterate over all the subsets with no more than m elementsfor (int i = 0; i < (1<<=m; i++){ ...}
 Re: Iterating Over All Subsets of a Set (response to post by dimkadimon) // iterate over all the subsets with no more than m elementsfor (int i = 0; i < (1<< m ? i+1 : (i|(i-1))+1){ ...}why i can't modify it as below?// iterate over all the subsets with no more than m elementsfor (int i = 0; i < (1<<=m; i++){ ...}