题目204 Coin Test

testcoin.org:特币 testcoin.org Testcoin是用于测试目的的硬币,目前在液体网络上发布 此硬币的详细信息将在此处使用机器可读数据进行记录 立即下载

Coin Test

时间限制:3000 ms  |  内存限制:65535 KB
难度:1
描述

As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be the right side or the other side or standing on the desk, If you don't believe this,just try In the past there were some famous mathematicians working on this .They repeat the throwing job once again. But jacmy is a lazy boy.He is busy with dating or playing games.He have no time to throw a single coin for 100000 times. Here comes his idea,He just go bank and exchange thousands of dollars into coins and then throw then on the desk only once. The only job left for him is to count the number of coins with three conditions.

He will show you the coins on the desk to you one by one. Please tell him the possiblility of the coin on the right side as a fractional number if the possiblity between the result and 0.5 is no larger than 0.003. BE CAREFUL that even 1/2,50/100,33/66 are equal only 1/2 is accepted ! if the difference between the result and 0.5 is larger than 0.003,Please tell him "Fail".Or if you see one coin standing on the desk,just say "Bingo" any way.

输入
Three will be two line as input.
The first line is a number N(1<N<65536)
telling you the number of coins on the desk.
The second line is the result with N litters.The letter are "U","D",or "S","U" means the coin is on the right side. "D" means the coin is on the other side ."S" means standing on the desk.
输出
If test successeded,just output the possibility of the coin on the right side.If the test failed please output "Fail",If there is one or more"S",please output "Bingo"
样例输入
6
UUUDDD
样例输出
1/2

只要注意如果有0个是向上的,直接输出0,不是输出0分之几。

#include<stdio.h>
#include<string.h>
#define MAX (0.5+0.003)
int gcd(int a,int b) 
{
    return !b?a:gcd(b,a%b);
}
int main()
{
	int i,judge,N,sum;
	char c;
	while(scanf("%d",&N)!=EOF)
	{
	    getchar();
		for(i=0,sum=0,judge=0;i<N;i++)
		{
		    scanf("%c",&c);
			if(c=='U') sum+=1;
			if(c=='S') 
			judge=1;
			   
		}
		if(judge==1)
		printf("Bingo\n");
		else if(sum==0)
		printf("0\n");
		else if(sum*1.0/N*1.0<=MAX)
		printf("%d/%d\n",sum/gcd(sum,N),N/gcd(sum,N));
		else 
		printf("Fail\n");
	}
	return 0;
}


coin-test-sr React实例 该目录是带有的应用程序的简短示例,可以通过Vercel和零配置进行部署。 自行部署 使用Vercel部署您自己的React项目以及无服务器功能。 实时示例: : 我们如何创建此示例 要开始使用React和一起使用Vercel,可以使用初始化项目: $ npx create-react-app my-app 立即下载

相关推荐

从想法到零件:手把手拆解一个汽车功能如何从PRD写到SSTS和CTS

本文详细拆解了汽车电子需求从市场文档(MRD)到零部件技术规范(CTS)的完整流程,以雨天自动关窗功能为例,展示了PRD、SSTS和CTS的编写要点与交互设计。文章重点解析了系统分解的艺术和零部件落地的精确参数要求,为汽车电子工程师提供了从概念到实现的全流程实践指南。

weixin_30300225的博客 485

Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be

标哥 1116

GX Works2系统启动失败排查指南:从环境配置到修复方案

在工业自动化与PLC编程调试中,软件启动异常是常见的工程痛点。当开发工具因系统环境配置不当而频繁报错时,往往不是简单的重启能解决的。运行库缺失、区域设置错误、临时目录失效或系统服务被禁用,都可能导致编程软件无法完成初始化流程。掌握从基础环境检查到系统组件修复的系统性排查思路,是提升工控开发效率的关键能力。本文从软件初始化原理出发,结合Windows系统维护实践,梳理一套适用于工业软件启动故障的通用诊断方法,并自然聚焦到三菱GX Works2常见启动失败问题的实际处理,帮助工程师快速定位并解决环境性故障,保障

weixin_42567046的博客 517

346-浅析TestCoin和LichCoin

pragma solidity >=0.4.22 <0.6.0; /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) pure internal returns (uint256) { uint256 c = a ...

Lich Howger 795

GIS技巧实战——ArcGIS Pro与SketchUp三维数据互导新方案

本文详细介绍了ArcGIS Pro与SketchUp三维数据互导的新方案,解决了传统方法中模型变形、格式不兼容等问题。通过64位架构的优势,实现高效、精准的三维模型转换,适用于城市规划、建筑设计等领域,提升工作效率。

weixin_29969209的博客 223

【02】【VisionMaster V4.0.0 】安装教程—— 授权文件更新报错:应用程序与本地LM通讯出错(怀疑电脑加密 和 上网受限 造成的 )

本文详细介绍了海康VisionMaster 4.0试用版的安装流程及常见问题解决方案。主要内容包括:1)从官网下载基础安装包、试用补丁和授权文件;2)按顺序安装主程序、补丁和授权文件;3)针对授权失败问题提供两种解决方案(更换未加密电脑或使用加密狗);4)说明试用版的功能限制(30天试用期、2个流程限制等)。文章特别指出电脑加密可能导致授权失败,并提供了安装报错时的处理建议,为初次使用者提供了完整的安装指导。

程序员,他们想的是什么?他们想的永远都是技术,他们崇尚的也永远都是技术。 7296

nyoj-204Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~i

u010211389的专栏 732

C++中为什么要引入引用变量?

C++引用机制的设计哲学在于平衡性能与安全性。它解决了指针的三个痛点:语法噪音、空指针风险和语义模糊,同时保持了指针的效率优势。引用必须绑定有效对象且不可重绑定的特性增强了安全性,其值语义语法更直观。尤其在运算符重载和const引用场景中,引用展现了不可替代的优势。本质上,引用是编译器优化的指针实现,体现了C++"零开销抽象"的核心思想——既保持底层性能,又提供高级抽象。这种设计允许开发者根据场景灵活选择指针或引用,反映了C++多范式共存的语言智慧。

教学 & 技术专栏 179

题目204 Coin Test

已AC代码: #include #include using namespace std; int GCD(int m, int n) { if(m==0) return n; else return GCD(n%m, m); } int main() { int n, temp=0; int t=0; scanf("%d

izhouxiaofei的博客 312

以ATT&CK为例构建网络安全知识图

随着攻击工具、方法的逐渐升级和复杂化,安全数据的大规模融合,攻防对抗愈加激烈。安全团队如何在浩瀚数据中有效发现高级威胁的蛛丝马迹,如何把网络安全专家的经验、知识有效转化为可复制可扩展的数据分析能力,如何将对抗高级威胁的“炼金术”逐步升级为科学淘金指南,如何将安全从业者从繁重的体力劳动中解放出来,愈发成为安全能力亟需突破的难点和重点,也是我们正在探索的方向。正如医疗行业中治疗疑难杂症依赖医疗专家,网络空间高级威胁的防护和处置也依赖安全专家的经验与知识。

2401_88752684的博客 1095

PyTorch实战(19)——变分自编码器(Variational Autoencoder,VAE)

变分自编码器 (Variational Autoencoder, VAE) 是一种结合了自编码器和概率建模的生成模型,通过编码器将输入数据映射到潜在空间中的概率分布,并通过解码器将从潜在空间采样得到的潜在变量映射回原始数据空间,实现了数据的生成和特征学习。本节中,将介绍变分自编码器的基本概念,并使用 PyTorch 实现变分自编码器生成新图像。

盼小辉丶的博客 3093

NYOJ 题目204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be

小寒 507

YOLO26涨点改进 | 全网首发Conv独家改进篇 | CVPR 2025 | 引入GCConv卷积改进YOLO26,含GCC3k2二次创新,能够捕捉更加丰富和复杂的特征信息,助力高效涨点

本文提出了一种基于GCConv模块的YOLO26目标检测模型改进方案。GCConv模块通过多路径结构增强特征学习能力,在训练阶段采用垂直多卷积和水平多路径配置,推理时重参数化为单一3x3卷积,显著提升推理速度而不损失性能。实验表明,该模块在复杂场景和多尺度目标检测任务中表现优异,特别适合资源受限的实时应用场景。文章详细介绍了GCConv的网络结构、核心代码实现、YAML配置文件修改方法,并提供了两种改进方案(GCConv和GCC3k2)的具体配置指导。

Ai缝合怪、助力小伙伴高效发论文 328

南阳题目204-Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can

LiuKe369的博客 532

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

南阳oj 题目204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~i

jianjun的专栏 609

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

NYOJ---题目204Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be

在未来等你的专栏 527

南阳 oj 语言入门 Coin test 题目204

给大家推荐个靠谱的公众号程序员探索之路,大家一起加油  #include&lt;stdio.h&gt; int u,d; int gcd(int a,int b) { if(a==0) return b; else return gcd(b%a,a); } int main() { int n; char c; scanf("%d",&amp;n); getchar(...

yueloveme的博客 418

NYOJ 204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~i

Chunzhen的博客 793

204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~i

syklar&miracle 482

南阳OJ 204 Coin Test

Coin Test 时间限制:3000 ms | 内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be t

qingdu007的专栏 1497

NYOJ 204题 Coin Test

做这道题对我来说真是费了牛劲了!但不管怎么说,通过了就好。 下面说说我为什么在这道题上走了这么多弯路。 1.题意没理解对。题目中“Please tell him the possiblility of the coin on the right side as a fractional number if the possiblity between the result and 0.5 is

静-静的雪 721

NYOJ-204 Coin Test

描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be the right side or the other side or standing on th

qq_35562816的博客 357

nyoj 204-Coin Test

http://acm.nyist.net/JudgeOnline/problem.php?pid=204 题目的意思: 我们都知道,如果你扔一枚硬币并让它掉在桌子上,通常有三种结果。是的,相信我的话吧,它可能是正面朝上,背面朝上,亦或竖立起来。你不信吗,尽管试试吧。过去有些著名数学家研究过。他们一次次重复的扔硬币。但是jacmy是一个懒人,他忙着和女孩约会或玩游戏,没时间扔一枚硬币100000

shofe的学习随记 722

NYOJ 204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it ca

Python3 爬虫实战 1:应对特殊字体,爬取猫眼电影实时排行榜 2005

nyoj 204 Coin Test

Coin Test 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~i

莫道青天真无道,能逍遥时且逍遥! 887
上一篇: hdoj 2438 Turn the corner
下一篇: 1102 Constructing Roads
SimonCoder
博客等级 码龄13年 1413粉丝 231原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址