传送门

考虑如何保证限制,首先团队数最大就是 $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. Git与Repo 的使用

    一.Linux常用命令 pwd           用于显示工作目录,执行pwd指令可立刻得知您目前所在的工作目录的绝对路径名称. chmod      用来变更文件或目录的权限. >      ...

  2. spring自定义自动配置注解

    我们知道springboot自动配置@EnableAutoConfiguration是通过@Import(AutoConfigurationImportSelector.class)来把自动配置组件加 ...

  3. [Java]手动构建SQL语法树(sql简单无嵌套)并输出与之对应的SQL语句之二

    Entry入口 main中自顶向下手动创建了sql语法树 package com.hy; // 构建SQL语法树 public class Entry { public static void mai ...

  4. GitHub:Python

    ylbtech-GitHub:Python 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 1. https://github.com/python 2.   6 ...

  5. css中设置table中的td内容自动换行

    word-break:break-all和word-wrap:break-word都是能使其容器如DIV的内容自动换行. 它们的区别就在于: 1,word-break:break-all 例如div宽 ...

  6. ubuntu14.04 安装apache+php7.2*

    1.安装apache2 sudo apt-get update sudo apt-get install apache2 这时http://你机器的ip,就可以访问了 2.安装php7.0+及一些必要 ...

  7. 阿里巴巴 fastjson-1.2.12.jar json解析异常java.lang.ClassFormatError: Invalid method Code length 66865 in class file com/alibaba/fastjson/serializer/ASMSerializer_6_UserKdlb

    承接上篇:fastjson反序列化LocalDateTime失败的问题java.time.format.DateTimeParseException: Text '2019-05-24 13:52:1 ...

  8. Python:Base3(函数,切片,迭代,列表生成式)

    1.Python之调用函数: Python内置了很多有用的函数,我们可以直接调用. 要调用一个函数,需要知道函数的名称和参数,比如求绝对值的函数 abs,它接收一个参数. 可以直接从Python的官方 ...

  9. python中的set集合

    当使用爬虫URL保存时,一般会选择set来保存urls,set是集合,集合中的元素不能重复,其次还有交集,并集等集合的功能, 爬虫每次获取的网页中提取网页中的urls,并保存,这就需要利用urls = ...

  10. Golang 单例模式 singleton pattern

    在Java中,单例模式的实现主要依靠类中的静态字段.在Go语言中,没有静态类成员,所以我们使用的包访问机制和函数来提供类似的功能.来看下下面的例子: package singleton         ...