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 ...
随机推荐
- TypeScript----数据类型
TypeScript 简介 TypeScript 由 Microsoft开发和维护的一种开源编程语言.它支持 JavaScript 的所有语法和语义,同时通过作为 ECMAScript 的超集来提供一 ...
- [JZOJ5400]:Repulsed(贪心+树形DP)
题目描述 小$w$心里的火焰就要被熄灭了. 简便起见,假设小$w$的内心是一棵$n-1$条边,$n$个节点的树. 现在你要在每个节点里放一些个灭火器,每个节点可以放任意多个. 接下来每个节点都要被分配 ...
- 0.2 IDEA配置
一.IDEA配置maven 在启动配置设置清理方式:clean jetty:run maven版本以及本地setting和repository JRE版本以及编码格式:-Dfile.encoding= ...
- ARTS打卡计划第一周
Algorithms: https://leetcode-cn.com/problems/two-sum/ Review: https://www.infoq.cn/article/EafgGJEtq ...
- CSS标签详解
CSS3标签 Css3概述 从2010年开始,HTML5与CSS3就一直是互联网技术中最受关注的两个话题.从前端技术的角度可以把互联网的发展分为三个阶段:第一阶段是web1.0以内容为主的网络,前端主 ...
- 查看HearthBuddy.exe文件是x86还是x64版本
https://www.cnblogs.com/chucklu/p/10020221.html 使用Powershell查看 PS C:\repository\GitHub\ChuckLu\Test\ ...
- 卸载apache
1.查看httpd相关软件包 rpm -qa|grep httpd 2.卸载命令, “rpm -e 软件或服务名” 如果出现类似“httpd >= 2.2.0 is needed by (ins ...
- 浏览器端-W3School-HTML:HTML DOM Video 对象
ylbtech-浏览器端-W3School-HTML:HTML DOM Video 对象 1.返回顶部 1. HTML DOM Video 对象 Video 对象 Video 对象是 HTML5 中的 ...
- JSTL核心标签库详解
<c:out>标签 标签用于输出一段文本到浏览器中. 属性名 是否支持EL 属性类型 属 性 描 述 value true Object 指定要输出的内容 escapeXml true B ...
- pandas之数据选择
pandas中有三种索引方法:.loc,.iloc和[],注意:.ix的用法在0.20.0中已经不建议使用了 import pandas as pd import numpy as np In [5] ...