Poj 2028 when can we meet? (Another question)

Source: Internet
Author: User

[Description]: N indicates several members. Q indicates that the meeting is valid only when there are several members. In the next n rows, the first number in each row indicates that the row has m numbers, which days does the member have. Finally, let's find the meeting day as soon as possible.

[Analysis]: for simple questions, see the code.


// 248 K 47 Ms # include <iostream> using namespace STD; int M [101]; int N, Q; int main () {int m; int M1; while (1) {CIN> N> q; If (n = 0 & Q = 0) break; memset (M, 0, sizeof (m )); while (n --) {CIN> m; For (INT I = 0; I <m; I ++) {CIN> m1; M [M1] ++ ;}} int max = 0; int A; For (Int J = 0; j <= 100; j ++) {If (M [J]> MAX) {max = m [J]; A = J ;}} if (max >= q) cout <A <Endl; elsecout <"0" <Endl;} return 0 ;}


Poj 2028 when can we meet? (Another question)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.