Codeforces 1221C. Perfect Team
考虑如何保证限制,首先团队数最大就是 $min(c,m)$
但是还不够,每个团队还要 $3$ 个人,所以还要和 $(c+m+x)/3$ 再取 $min$
这样就满足所有限制了
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long ll;
inline int read()
{
int x=,f=; char ch=getchar();
while(ch<''||ch>'') { if(ch=='-') f=-; ch=getchar(); }
while(ch>=''&&ch<='') { x=(x<<)+(x<<)+(ch^); ch=getchar(); }
return x*f;
}
int Q,a,b,c;
int main()
{
Q=read();
while(Q--)
{
a=read(),b=read(),c=read();
int ans=min(min(a,b),(a+b+c)/);
printf("%d\n",ans);
}
return ;
}
Codeforces 1221C. Perfect Team的更多相关文章
- codeforces 122C perfect team
You may have already known that a standard ICPC team consists of exactly three members. The perfect ...
- Educational Codeforces Round 73 (Rated for Div. 2) C. Perfect Team
链接: https://codeforces.com/contest/1221/problem/C 题意: You may have already known that a standard ICP ...
- Codeforces 986D Perfect Encoding FFT 分治 高精度
原文链接https://www.cnblogs.com/zhouzhendong/p/9161557.html 题目传送门 - Codeforces 986D 题意 给定一个数 $n(n\leq 10 ...
- Codeforces 980D Perfect Groups 计数
原文链接https://www.cnblogs.com/zhouzhendong/p/9074164.html 题目传送门 - Codeforces 980D 题意 $\rm Codeforces$ ...
- [CodeForces - 919B] Perfect Number
题目链接:http://codeforces.com/problemset/problem/919/B AC代码: #include<cstdio> using namespace std ...
- Codeforces 948D Perfect Security(字典树)
题目链接:Perfect Security 题意:给出N个数代表密码,再给出N个数代表key.现在要将key组排序,使key组和密码组的亦或所形成的组字典序最小. 题解:要使密码组里面每个数都找到能使 ...
- Codeforces 932 E. Team Work(组合数学)
http://codeforces.com/contest/932/problem/E 题意: 可以看做 有n种小球,每种小球有无限个,先从中选出x种,再在这x种小球中任选k个小球的方案数 选出的 ...
- Codeforces 932.E Team Work
E. Team Work time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...
- CodeForces - 233A Perfect Permutation
A. Perfect Permutation time limit per test: 2 seconds memory limit per test: 256 megabytes input: st ...
随机推荐
- 分享代码到GitHub
1.本地安装git 2.项目文件夹右键Git bash here,弹出git命令窗口 3.输入git init,使项目加入Git管理 4.输入git add .,将项目全部内容添加到git 5.输入“ ...
- Java写入的常用技巧
一.批量写入 Java写入大量数据到磁盘/数据库等其它第三方介质时,由于IO是比较耗费资源的操作,通常采用攒一批然后批量写入的模式 //通常构造一个缓存池,一个限制指标,可以是内存大小也可以是时间 B ...
- 黑马在线教育项目---15-16、datatables插件
黑马在线教育项目---15-16.datatables插件 一.总结 一句话总结: datatables插件也比较好用,引入好插件的js和css后,核心代码也就是插件的初始化,如果要修改配置可以百度 ...
- BitmapRegionDecoder
Android加载大图——BitmapRegionDecoder(转) BitmapRegionDecoder,从API10就引入了.如下图: NPONRY0T35GE$13{254X8Z1. ...
- java list对象按照某个属性去重
/** * 去重 * * @param orderList * @return * @author jqlin */ private static List<ansVo> removeDu ...
- javascript之String对象
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- lucene 快速入门
日常开发中,相信大家经常会用like去匹配一些数据,同时我们也知道,like往往会导致全表扫描,当数据量越来越大的时候,我们会纠结于 数据库的龟速查找,此时我们必须另寻蹊跷,这时lucene就可以大显 ...
- 客户端连接oracle11出现提示ORA-12514:错误解决方法
近来安装oracle11g,使用后发现plsql和sqldeveloper等客户端工具不能用,提示以下错误: 1.ORA-12514: TNS: 程序无法监听 原因:OracleOraDb11g_ho ...
- 內部作业 OH01 0001710000 无价格可确定
在CO15报工时,提示:“內部作業 OH01 0001710000 無價格可確定” 出现以上错误信息,表示没有在KP26维护价格, 只需要进入KP26维护成本中心和作业类型的价格即可, 具体操作如下图 ...
- Computed Styles
The style object offers no information about the styles that have cascaded from style sheets and aff ...