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 ...
随机推荐
- 2018-2019-2 20165215《网络对抗技术》Exp8 Web基础
目录 实验内容 基础问题回答 实验步骤 (一)Web前端HTML (二) Web前端javascipt (三)Web后端:MySQL基础:正常安装.启动MySQL,建库.创建用户.修改密码.建表 (四 ...
- beta week 2/2 Scrum立会报告+燃尽图 06
此作业要求参见https://edu.cnblogs.com/campus/nenu/2019fall/homework/9959 一.小组情况 组长:贺敬文组员:彭思雨 王志文 位军营 徐丽君队名: ...
- LeetCode 63. 不同路径 II(Unique Paths II)
题目描述 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” ). 机器人每次只能向下或者向右移动一步.机器人试图达到网格的右下角(在下图中标记为“Finish”). ...
- 前端单点登录(SSO)实现方法(二级域名与主域名)
1.单点登录介绍 单点登录 SSO 全称 Singn Sign On .SSO 是指在多个应用系统中,用户只需要登录一次用户系统,就可以访问其他互相信任的应用系统.例如:在网易官网登录账户,那么再进入 ...
- openMP---第一篇
openMP 处理for循环 ///////////////////////////////////////////////////////////////////////////////////// ...
- 3.MapReduce原理和Yarn
1.MapReduce原理 2.MapReduce执行时间 3.MapReduce开发 4.Yarn
- spring mvc路径匹配原则
Ant path 匹配原则 在Spring MVC中经常要用到拦截器,在配置需要要拦截的路径时经常用到<mvc:mapping/>子标签,其有一个path属性,它就是用来指定需要拦截的路径 ...
- 七十三:flask信号之信号机制和使用场景
若安装flask是未默认安装blinker,则pip install blinker 使用信号分为3步,第一是定义一个信号,第二是监听一个信号,第三是发送一个信号 1.定义信号:定义信号需要使用到bl ...
- Jconsole、JvisualVM无法连接Tomcat服务
转载自:https://blog.csdn.net/qq_27790011/article/details/88799587 打开TomcatXw.exe找到java选项卡,添加以下参数 -Dcom. ...
- Servlet(4):Session
Session, Cookie及交互 会话(Session)跟踪是Web程序中常用的技术,用来跟踪用户的整个会话.常用的会话跟踪技术是Cookie与Session. Cookie通过在客户端记录信息确 ...