Acdream Hut Freshman Training tournament F-Nana in Wonderland Series-multi-ethnic kingdoms and collection

Source: Internet
Author: User

Problem-solving ideas: And check the water problems, many years ago with violent water.

Problem Solving Code:

1 //File name:c.c2 //Author:darkdream3 //Created time:2013 March 01 Friday 00:37 28 seconds4 5#include <stdio.h>6#include <string.h>7#include <stdlib.h>8#include <time.h>9#include <math.h>Ten  One BOOLa[102][102] = {0}; A intf[102]; - intb[102] = {0}; - intMain () { the  -  //freopen ("Input.txt", "R", stdin); -  //freopen ("Output.txt", "w", stdout); -   intN, m, p =0; +scanf"%d%d",&n,&m); -    for(inti =1; I <= N; i++) +     { A       intT; atscanf"%d",&f[i]); -       if(F[i] = =0 ) -{p++; -B[i] =1; -            -       } in        for(intj =1; J <= F[i]; j + +) -       { to         intK; +scanf"%d",&k); -A[I][K] =1; the       } *      $     }Panax Notoginseng    for(ints =1; s<=3; s + +) -    for(inti =1; i<= N; i++) the{if(!B[i]) +        for(intj = i+1; J <= N; j + +) A       { the           for(intt =1; T <= m; t++) +              if(A[i][t] = =1&& A[j][t] = =1) -              { $B[J] =1 ; $                 for(intK =1; K <= m; k + +) -A[I][K] = A[i][k] | |A[j][k]; -                 Break; the              } -       }Wuyi   } the   intsum =0;  -    for(inti =1; I <= N; i++) Wu       if(B[i] = =0) -       {  Aboutsum++; $       } -   if(Sum = =0) -sum =1; -sum = sum-1+p; Aprintf"%d", sum); + return 0 ; the}
View Code

Acdream Hut Freshman Training tournament F-Nana in Wonderland Series-multi-ethnic kingdoms and collection

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.