886A. ACM icpc# mean distribution problem (violence)

Source: Internet
Author: User

Title Source: Http://codeforces.com/problemset/problem/886/A

The main topic: Six people are known to score, ask whether it can be divided into two three team to make each team score plus and equal

#include <stdio.h>//Choose from six numbers of three non-repeating numbers plus sum if this sum is exactly half of the totalintMain () {inta[6]; inti,j,k,sum=0, S;  for(i=0;i<6; i++) {scanf ("%d",&A[i]); Sum+=A[i]; }     for(i=0;i<6; i++)         for(j=i+1;j<6; j + +)             for(k=j+1;k<6; k++) {s=a[i]+a[j]+A[k]; if(s==sum-s) {printf ("yes\n"); return 0; }} printf ("no\n"); return 0;}

Data is small, add to 6 people, and then enumerate any three people, if the sum is half of

886A. ACM icpc# mean distribution problem (violence)

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.