Thread: Olympiad of Brazilian informatics 2011

  1. #1
    Registered User
    Join Date
    Jul 2018

    Olympiad of Brazilian informatics 2011

    Every week, Juquinha has classes in ACM (Performing and Musical Arts) at the school where she studies and, recently, her teacher announced that there will be a gymkhana at the end of the semester. However, teams should be trained as soon as possible so that students can rehearse.
    Each team consists of one or more students, and each student has to belong to exactly one team. In addition, teams can not be formed anyway: if one student is friends with another, these students must be on the same team. The teacher then asked the students to inform her of the friendship relations in the classroom. The students then numbered from 1 to N and wrote a list whose lines contain pairs of
    numbers. If two students whose numbers are i and j are friends, there will be at least one line
    containing i and j or j and i in the list. Conversely, if there is a line containing i and j in the list, then the
    Students whose numbers are i and j are friends.
    The teacher then collected the list and, in the next class, should decide what teams to train. She is thinking of forming as many teams as possible and would like to know how many times she would form. Help the teacher by writing a program that, given the friends list, determines how many teams she can train.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Ok, so where is your attempt?

    Just posting your assignment and expecting a complete free answer right off the bat isn't going to work.

    Show us what you know, and we'll help you over the hurdles.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Women's World Chess Championship 2011
    By laserlight in forum General Discussions
    Replies: 10
    Last Post: 11-28-2011, 11:59 PM
  2. Replies: 17
    Last Post: 07-08-2011, 07:11 AM
  3. Three Brazilian Soldiers
    By Dave_Sinkula in forum A Brief History of
    Replies: 79
    Last Post: 06-10-2007, 02:14 PM

Tags for this Thread