传送门

考虑如何保证限制,首先团队数最大就是 $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的更多相关文章

  1. codeforces 122C perfect team

    You may have already known that a standard ICPC team consists of exactly three members. The perfect ...

  2. 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 ...

  3. Codeforces 986D Perfect Encoding FFT 分治 高精度

    原文链接https://www.cnblogs.com/zhouzhendong/p/9161557.html 题目传送门 - Codeforces 986D 题意 给定一个数 $n(n\leq 10 ...

  4. Codeforces 980D Perfect Groups 计数

    原文链接https://www.cnblogs.com/zhouzhendong/p/9074164.html 题目传送门 - Codeforces 980D 题意 $\rm Codeforces$ ...

  5. [CodeForces - 919B] Perfect Number

    题目链接:http://codeforces.com/problemset/problem/919/B AC代码: #include<cstdio> using namespace std ...

  6. Codeforces 948D Perfect Security(字典树)

    题目链接:Perfect Security 题意:给出N个数代表密码,再给出N个数代表key.现在要将key组排序,使key组和密码组的亦或所形成的组字典序最小. 题解:要使密码组里面每个数都找到能使 ...

  7. Codeforces 932 E. Team Work(组合数学)

    http://codeforces.com/contest/932/problem/E 题意:   可以看做 有n种小球,每种小球有无限个,先从中选出x种,再在这x种小球中任选k个小球的方案数 选出的 ...

  8. Codeforces 932.E Team Work

    E. Team Work time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  9. CodeForces - 233A Perfect Permutation

    A. Perfect Permutation time limit per test: 2 seconds memory limit per test: 256 megabytes input: st ...

随机推荐

  1. 网络爬虫技术实现java依赖库整理输出

    网络爬虫技术实现java依赖库整理输出 目录 1       简介... 2 1.1      背景介绍... 2 1.2      现有方法优缺点对比... 2 2       实现方法... 2 ...

  2. phpstorm 比较修改过的代码 version control

  3. AttributeError:module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name

    在jupyter notebooks上运行tensorflow-keras的Mask R-CNN时遇到如下错误: 参考博客中写了两种解决方案: 解决方案一:报错是由于keras版本不对造成的.load ...

  4. jxbrowser 实现自定义右键菜单

    https://blog.csdn.net/shuaizai88/article/details/73743691 public static void main(String[] args) { J ...

  5. 七十六:flask.Restful之flask-Restful插件的基本使用

    安装:flask 0.8以上.python2.6或者3.3以上:pip install flask-restful 使用方法:1.从flask_restful中导入Api,来创建对象 2.写一个视图函 ...

  6. python 中 __dict__函数的使用

    class F: def __init__(self, name, age): self.name = name self.age = age obj = F('tom', 20)s = obj.__ ...

  7. Eureka 2.0 闭源--选择Consul???[转]

    原文链接: https://www.cnblogs.com/williamjie/p/9369800.html 在上个月我们知道 Eureka 2.0 闭源了,但其实对国内的用户影响甚小,一方面国内大 ...

  8. delphi中and和or的特殊用法

    1=1 10=2 100=4 1000=8 1 or 2 = 3(11); 1 and 3 = 1; 2 and 3 = 2; 2 or 4 = 6(110); 2 and 6 = 2; 4 and ...

  9. VMWare虚拟机->锁定文件失败,打不开磁盘的解决办法

    VMWare虚拟机提示:锁定文件失败,打不开磁盘的解决办法   如果使用VMWare虚拟机的时候突然系统崩溃蓝屏,有一定几率会导致无法启动,会提示:“锁定文件失败,打不开磁盘...或它所依赖的某个快照 ...

  10. "美团"APP学习记录知识点

    1.APP进入加载广告视图展示: -(void)initAdvView{ // 判断图片是否已经存在 NSArray *paths = NSSearchPathForDirectoriesInDoma ...