Codeforces Round #311 (Div. 2) A Ilya and diplomas

Source: Internet
Author: User

"Match link" click here~~

"The main topic"

n individuals, obtaining one to three degrees, each diploma has a size range, and the final diploma is awarded how many

"Problem-solving ideas" are enumerated directly,

Read the question, hurriedly wrote a code, found unexpectedly Miss registration time, System prompt can not submit code, really drunk ~ ~, later still have to register in advance:

A problem, relatively simple:

Code:

#include <iostream> #include <bits/stdc++.h>using namespace Std;int main () {    int n,m;    int a1,a2;    int b1,b2;    int c1,c2;    while (Cin>>n)    {        cin>>a1>>a2;        cin>>b1>>b2;        cin>>c1>>c2;        int max1=0,max2=0,max3=0;        for (int i=a1;i<=a2;++i)        {for (            int. j=b1;j<=b2;++j)            {for              (int k=c1;k<=c2;++k)              {                  Max1=max (max1,i);                  Max2=max (max2,j);                  Max3=max (max3,k);                  if (max1+max2+max3==n)                  {                      cout<<max1<< "" <<max2<< "" <<max3<<endl;                      return 0    ;    }}}} return 0;} /*61 7output1 2 3input101 5output2 3 5input61 2 2output2


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Codeforces Round #311 (Div. 2) A Ilya and diplomas

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.