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 ...
随机推荐
- flink杂记
flink的特点:能同时满足高性能.高吞吐.低延时,相比较于storm和spark streaming,storm的吞吐量不如flink,而spark streaming的延时比较高,因为spark ...
- sublime tab转4个空格配置
打开Sublime Text3,选择菜单Preferences->Settings-User,打开用户配置文件 然后在大括号里加上下面两行代码: "tab_size": 4, ...
- ActiveXObject常用方法
function getusername() { var WshNetwork = new ActiveXObject("WScript.Network"); alert(&quo ...
- Python定时框架 Apscheduler 详解【转】
内容来自网络: https://www.cnblogs.com/luxiaojun/p/6567132.html 在平常的工作中几乎有一半的功能模块都需要定时任务来推动,例如项目中有一个定时统计程序, ...
- 哨兵模式java实例
/** * 测试Redis哨兵模式 * @author liu */ public class TestSentinels { @SuppressWarnings("resource&quo ...
- 2-mybatis-启动
启动相关的类主要位于session包下. 参照mybatis官方文档,从xml中构建SqlSessionFactory后,可以获取SqlSession,然后使用SqlSession查询数据库得到结果. ...
- pandas数据分析案例
1.数据分析步骤 ''' 数据分析步骤: 1.先加载数据 pandas.read_cvs("path") 2.查看数据详情 df.info() ,df.describe() ,df ...
- 解决SpringCloud使用Feign跨服调用时header请求头中的信息丢失
在使用SpringCloud进行Feign跨服调用时header请求头中的信息会丢失,是因为Feign是不会带上当前请求的Cookie信息和头信息的,这个时候就需要重写请求拦截. 1.需要重写Requ ...
- 在Linux上安装Python3.7.1
一.安装依赖环境 输入命令:yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readlin ...
- Kafka 可视化工具(Kafka Tool)
Kafka 可视化工具 使用Kafka的小伙伴,有没有为无法直观地查看 Kafka 的 Topic 里的内容而发过愁呢? 下面推荐给大家一款带有可视化页面Kafka工具:Kafka Tool (目前最 ...