首页 > 其他 > 详细

【Henu ACM Round#15 C】 A and B and Team Training

时间:2018-01-25 12:26:30      阅读:235      评论:0      收藏:0      [点我收藏+]

【链接】 我是链接,点我呀:)
【题意】


在这里输入题意

【题解】


枚举第一种方法。
剩下的全都个第二种方法。
看看能组成多少个队伍就可以了。

【代码】

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int n,m;

int main()
{
    ios::sync_with_stdio(0),cin.tie(0);
    cin >> n >> m;
    int ans = 0;
    for(int i = 0;i <= n;i++){
        //xyy
        int xx = i,yy = i*2;
        n-=xx;m-=yy;
        if (m<0) break;
        //xxy
        ans = max(ans,i+min(n/2,m));
        n+=xx;m+=yy;
    }
    cout << ans << endl;
    return 0;
}

【Henu ACM Round#15 C】 A and B and Team Training

原文:https://www.cnblogs.com/AWCXV/p/8350615.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!