“Homer no function beer well without.”
Homer Simpson
Every Friday night, Alice, Clara and Mary go to Koerner’s pub to relax after a long week. At the pub, lots of guys ask them for their phone numbers. In fact, the three ladies are so popular that they have started counting the number of times each one is asked for her phone number during one evening. On day i, Alice, Clara and Mary were asked Ai , Ci and Mi times, respectively. 100 Fridays have passed, and the records were lost, but there are 3 things Alice still remembers.

  1. X of the 100 days, Ai was equal to Ci.
  2. Y of the 100 days, Ci was equal to Mi.
  3. Z of the 100 days, Ai was equal to Mi.

How many time were Ai , Ci and Mi all equal?
Input
The first line of input gives the number of cases, N. N test cases follow. Each one contains the integers X, Y and Z on a line.
Output
For each test case, output one line containing ‘Case #x:’ followed by ‘Between A and B times.’, where A and B are the lowest and highest number of times that Ai , Ci and Mi could have been equal.
    If the situation is impossible, print ‘The records are faulty.’ instead.
Sample Input
5
50 50 50
100 100 99
100 50 50
101 50 50
100 100 100
Sample Output
Case #1: Between 25 and 50 times.
Case #2: The records are faulty.
Case #3: Between 50 and 50 times.
Case #4: The records are faulty.
Case #5: Between 100 and 100 times.

问题链接:UVA10882 Koerner’s Pub
问题简述:(略)
问题分析
    给程序代码,暂时不解释。
程序说明:(略)
参考链接:(略)
题记:(略)

AC的C++语言程序如下:

/* UVA10882 Koerner's Pub */#include <bits/stdc++.h>using namespace std;int main()
{int t;scanf("%d", &t);for(int k = 1; k <= t; k++) {int a[3];scanf("%d%d%d", &a[0], &a[1], &a[2]);sort(a, a + 3);int ol = a[1] + a[2] - 100;ol = ol < 0 ? 0 : ol;int ra = 100 - (a[1] + a[2]);ra = ra < 0 ? 0 : ra;int ne = a[0] - ol - ra;ne = ne < 0 ? 0 : ne;if(ol > a[0])printf("Case #%d: The records are faulty.\n", k);elseprintf("Case #%d: Between %d and %d times.\n", k, ol + (ne + 1) / 2, a[0]);}return 0;
}

UVA10882 Koerner's Pub【数学】相关推荐

  1. Competitive Programming 3题解

    题目一览: Competitive Programming 3: The New Lower Bound of Programming Contests(1) Competitive Programm ...

  2. python绘制如下图形、小三角形边长20_在编程中发现数学之美——使用Python小龟绘制多边形...

    在使用数学知识画出很酷的各种图形之前,你需要先学习Python编程语言的基础知识.本文将会带你熟悉以下编程概念:循环.变量.函数.使用小龟模块绘制图像.本文假设你已经安装了Python,如果没有,欢迎 ...

  3. 我们该如何学习机器学习中的数学

    数学在机器学习中非常重要,不论是在算法上理解模型代码,还是在工程上构建系统,数学都必不可少.通常离开学校后很难有机会静下心学习数学知识,因此我们最好能通过阅读小组或读书会等形式营造环境,并专注学习那些 ...

  4. 转载 Latex各种命令、符号、公式、数学符号、排版(非常详细)

    Latex各种命令.符号.公式.数学符号.排版等 本文仅供学习参考使用,一切版权和解释权均归原作者所有,转载地址: 数学符号详细内容见:http://mohu.org/info/symbols/sym ...

  5. 转载:数学工具常见问题集

      首页  |  信息资讯  |  个人文集  |  资源检索  |  浏览精彩论坛   设为首页 收藏本站 站点导航    近期活动  气象资料  专业绘图  算法模式  高性能计算  网格技术   ...

  6. 免费数据库及常用统计网址-数学建模(二十)

    1.国外统计学网址 http://www.bloomberg.com/ 美国金融情报 http://www.bridge.com/ 美国金融brigle http://www.math.yorku.c ...

  7. 23电工杯数学建模B题

    23电工杯数学建模B题:https://mbd.pub/o/bread/ZJmYk5dt 1.对附件2中所给数据进行分析和数值化处理,并给出处理方法; 首先,仔细阅读附件2中的调查反馈结果,并理解其中 ...

  8. 23电工杯数学建模A题

    (思路和求解代码以及参考文献,见地址): https://mbd.pub/o/bread/ZJmYk5Zt 思路和求解代码以及参考文献地址 023电工杯数学建模A题:电采暖负荷参与电力系统功率调节的技 ...

  9. 2023年美赛数学模型与思路 美国大学生数学建模竞赛

    文章说明 文章链接: https://zhuanlan.zhihu.com/p/607229539 本文由知乎作者:@小琴 制作,如果您购买的解题思路不是来自于我们,请及时进行举报. 同时如果您有其它 ...

最新文章

  1. 【Git】Git 基础命令 ( 查看提交记录 git log | 版本回滚 git reset | 撤销回滚 git reflog )
  2. 计算机网络可以把在区域上分散的单个,计算机网络技术及应用课后习题
  3. 自动化测试学习之路--java String、StringBuilder
  4. 【动态规划】 数字游戏 (ssl 1653)
  5. 一张“神图”看懂单机/集群/热备/磁盘阵列(RAID)
  6. SYSTEM表空间过大问题
  7. private、public、protected、internal修饰符的访问权限
  8. paip. erlang语法C++语法对比attilax总结
  9. svn和git版本管理
  10. hse是什么意思的缩写_什么是HSE
  11. 程序猿段子_程序员的十个段子,能看懂的都是深有同感!
  12. 计算机编程知识竞赛,程序设计竞赛
  13. 从零开始搭建智能客服
  14. 流媒体协议之RTMP详解
  15. hbuilderx 使用总结
  16. 关于texlive2021安装,一直卡在安装界面怎么回事?
  17. java启动参数xmm_JVM所有参数一览
  18. python判断数是整数还是小数
  19. 根据指定的n,返回相应的斐波纳契数列。
  20. Win10设置开机账户为本地账户,而不是微软账户

热门文章

  1. 设置和使用地图的范围—ArcGIS API for JavaScript
  2. Java高阶入门N篇
  3. android driver log,Android调试驱动抓log的方法
  4. github 搜索_github 项目搜索技巧让你更高效精准地搜索项目
  5. python要求将字符串循环右移n次_python 基础知识
  6. Python 之 循环
  7. ajax请求队列,使AJAX队列稍后解析请求
  8. oracle 01102 两实例,ORA 01102
  9. java微服务实战.pdf_Spring微服务实战 ([美]约翰·卡内尔) 中文完整pdf扫描版[172MB]...
  10. scala中的伴生对象,