传送门

考虑如何保证限制,首先团队数最大就是 $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. vue+ts搭建项目

    Tip: 为了避免浪费您的时间,本文符合满足以下条件的同学借鉴参考 1.本文模版不适用于小型项目,两三个页面的也没必要用vue2.对typescript.vue全家桶能够掌握和运用 此次项目模版主要涉 ...

  2. ARTS打卡计划第二周

    Algorithms: https://leetcode-cn.com/problems/3sum/ 算法是先排序,然后按照两个数和两边逼中,考虑去重. Review: https://www.inf ...

  3. pytype

    与mypy相比不仅可以显示错误行数,还可以看到哪个函数错误. mypy的图 pytype的图

  4. beta week 2/2 Scrum立会报告+燃尽图 04

    此作业要求参见https://edu.cnblogs.com/campus/nenu/2019fall/homework/9957 一.小组情况 组长:贺敬文组员:彭思雨 王志文 位军营 徐丽君队名: ...

  5. git一键push至github脚本

    ######################################################################### # File Name: push.sh # Aut ...

  6. Service-stack.redis 使用PooledRedisClientManager 速度慢的原因之一

    现在越来越多的开发者使用service-stack.redis 来进行redis的访问,但是获取redisclient的方式有多种方式,其中有一种从缓冲池获取client的方式很是得到大家的认可. L ...

  7. CallableStatement获得存储过程多个结果集

    这里使用到的数据库为MySQL package com.dz.entity; import java.sql.*; public class Pro_inoutTest { public static ...

  8. Monkeyrunner 使用说明

    monkeyrunner为android系统新公开的一个测试工具.有助于开发人员通过脚本部署较大规模的自动化测试. Monkeyrunner       本文档中包含 一个简单的monkeyrunne ...

  9. CompletableFuture.allOf that doens't return Void(CompletableFuture.allOf不能返回Void的解决方法)

    import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Ti ...

  10. mac 安装photoshop + 破解

    项目开发中毫无疑问会用到图片,一般情况都是UI将图片切好的,只是,有时候项目中少了一张图片或者是改变图片的尺寸之类的问题,这里我们就不需要每次都找UI要图片了,作为程序员这些基础工具的使用,咱们还是要 ...