思路:
emm…瞎搞分类讨论推结论
代码:
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <map> // STL
#include <string>
#include <vector>
#include <queue>
#include <stack>
#define mpr make_pair
using namespace std;
typedef long long LL;
const int inf = 1 << 30;
LL a,b,c;
LL n,m;
int main(){
cin>>a>>b>>c>>n>>m;
LL s=(a+b+c);
if((a+c)>n)s=n;
if((b+c)>m)s=min(s,m);
cout<<s<<endl;
return 0;
}
本文探讨了UrnwithBalls问题的解决方案,通过分类讨论的方法推导出结论,并给出了具体的C++实现代码。该问题关注如何在给定条件下求解容器中球的最大数量。
411

被折叠的 条评论
为什么被折叠?



