"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