Codeforces697B Barnicle 模拟

YOLO数据集实现数据增强的方法(裁剪、平移 、旋转、改变亮度、加噪声等) 数据集样本太少怎么办?数据集优质图像不够怎么办?如何做到更好的数据预处理?一文带你学会数据增强,还可实现带标签的扩充。 阅读详情

Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate.

Barney asked the bar tender Carl about this distance value, but Carl was so busy talking to the customers so he wrote the distance value (it's a real number) on a napkin. The problem is that he wrote it in scientific notation. The scientific notation of some real number x is the notation of form AeB, whereA is a real number and B is an integer and x = A × 10B is true. In our case A is between 0 and 9 and Bis non-negative.

Barney doesn't know anything about scientific notation (as well as anything scientific at all). So he asked you to tell him the distance value in usual decimal representation with minimal number of digits after the decimal point (and no decimal point if it is an integer). See the output format for better understanding.

Input

The first and only line of input contains a single string of form a.deb where a, d and b are integers and eis usual character 'e' (0 ≤ a ≤ 9, 0 ≤ d < 10100, 0 ≤ b ≤ 100) — the scientific notation of the desired distance value.

a and b contain no leading zeros and d contains no trailing zeros (but may be equal to 0). Also, b can not be non-zero if a is zero.

Output

Print the only real number x (the desired distance value) in the only line in its decimal notation.

Thus if x is an integer, print it's integer value without decimal part and decimal point and without leading zeroes.

Otherwise print x in a form of p.q such that p is an integer that have no leading zeroes (but may be equal to zero), and q is an integer that have no trailing zeroes (and may not be equal to zero).

Examples
input
8.549e2
output
854.9
input
8.549e3
output
8549
input
0.33e0
output
0.33
题意很简单,将一个数的科学记数法表达还原。简单模拟即可,不过有坑点,题中已作提示,即1.0e0,0.0e0这种数据也是存在的,对于这些数据,单独判断即可。

#include <iostream>
#include <cstdio>
#include <map>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
#define LL long long
#define maxn 1000100
char b[505];
void f(int p,int q)
{
    int flag=1;
    for(int m=p;m<q;m++){
        if(b[m]!='0'){
            flag=0;
        }
        if(flag!=1||b[m]!='0'){
            printf("%c",b[m]);
        }
    }
}
void fff(int p,int q)
{
    for(int m=p;m<q;m++){
        printf("%c",b[m]);
    }
}
void ff(int n)
{
    while(n--){
        printf("0");
    }
}
void change(char *a)
{
    char c[200];
    char p;
    int l=strlen(a);
    p=a[0];
    int j=2;
    while(a[j]!='e'){
        b[j-2]=a[j];
        j++;
    }
    int ss=j-2;
    j++;
    int k=0;
    while(j<l){
        c[k++]=a[j];
        j++;
    }
    int t=0;
    int temp=1;
    for(int s=k-1;s>=0;s--){
        t+=temp*(c[s]-'0');
        temp*=10;
    }
    if(p=='0'){
        if(ss==1&&b[0]=='0'){
            printf("0\n");
        }else{
            if(t<ss){
                int flag=1,fa=1;
                for(int m=0;m<t;m++){
                    if(b[m]!='0'){
                        flag=0;
                    }
                    if(flag!=1||b[m]!='0'){
                        printf("%c",b[m]);
                        fa=0;
                    }
                }
                if(fa==1) printf("0");
                printf(".");
                fff(t,ss);
                printf("\n");
            }else{
                f(0,ss);
                ff(t-ss);
                printf("\n");
            }
        }
    }else{
        printf("%c",p);
        if(ss==1&&b[0]=='0'&&t==0){
            printf("\n");
        }else{
        if(t<ss){
            fff(0,t);
            printf(".");
            fff(t,ss);
            printf("\n");
        }else{
            fff(0,ss);
            ff(t-ss);
            printf("\n");
        }
        }
    }
}

int   main()
{
    char a[505];
    while(~scanf("%s",a)){
        change(a);
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
    }
    return   0;
}








基于Simulink的六旋翼无人机动力分配仿真建模示例 六旋翼无人机概述特点:高冗余度、增强的负载能力和更好的故障容忍性。关键组件电机与螺旋桨:提供升力和推力。电调(ESC):控制电机转速。IMU(惯性测量单元):包括加速度计和陀螺仪,用于姿态估计。飞控板:处理传感器数据并生成控制信号。应用场景:航拍摄影、农业监测、物流配送等。仿真目标搭建一个简化的六旋翼无人机动力分配模型,涵盖电机驱动、姿态控制及位置控制过程。分析不同条件下的性能指标(如响应时间、稳定性等),并探讨六旋翼无人机的设计优化。 阅读详情

相关推荐

OpenCV安装配置教程VS2022(超级顺利)

博主最开始没打算写这篇博客,只是想简单的在网上找一下最新版的OpenCV的安装配置教程,适用于VS2022的,但是我搜了一早上,也没搜到一个能让我成功安装配置的,看了很多很多文章,根本就没有几篇有用的。所以没办法了,只能自己研究了,于是就整理了这篇博客,希望能帮到和我一样的人,这就是博主一直信奉的利他精神!

weixin_47367099的博客 5万+

Codeforces-697B-Barnicle(模拟)

A - Barnicle Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeCodeForces 697B Description Barney is standing in a bar and starring at a pretty girl.

Prim 727

车辆动力学从入门到进阶之路(传统篇)

新手如何入门车辆动力学开发领域,本文为您引路!

CrazyRabbit的博客 1万+

Codeforces - 362 (Div. 2)B - Barnicle(模拟)

B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney is standing in a bar and starring at a pret

j6635788的博客 458

一文告诉你:如何在trae中编译运行STM32程序,并让AI帮你修改代码

本文详细介绍了如何将STM32程序从Keil迁移到国产免费工具Trae,并利用AI进行代码修改的全过程。

水滴爬呀爬 4887

Unity3D Pico VR 手势交互实战:基于MRTK3实现抓握与射线控制

本文针对Pico VR原生手势交互功能不足的问题,提供了基于MRTK3实现高级手势交互的实战解决方案。通过将MRTK3成熟的交互框架与Pico的手势追踪能力相结合,详细讲解了从环境配置、SDK导入、核心适配到真机调试的全流程,帮助开发者高效实现抓握与射线控制等复杂交互,有效提升Pico VR应用的开发效率与体验。

weixin_29011667的博客 391

Codeforces 697B Barnicle

B. Barnicle time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Barney is standing in a bar and starring at a pretty girl. He wants to shoot he

Jane_JXR的博客 831

1.3 重叠因子:希尔伯特变换趋势线(Hilbert Transform - Instantaneous Trendline)概念与Python实战

希尔伯特变换趋势线(Hilbert Transform - Instantaneous Trendline)是一种基于希尔伯特变换的高级技术分析工具。它使用数字信号处理技术来识别价格的主导周期,并生成一条平滑的趋势线。这种方法可以有效过滤市场噪音,提供更准确的趋势信号。

Kewin的博客 2085

Codeforces Round #362 (Div. 2) B. Barnicle

B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputBarney is standing in a bar and starring at a pretty girl. He wants to sh

滴水穿石,慢慢积累,总会有成果 747

【大模型应用开发-大模型知识】(二)大模型分类和常见大模型

目前包含 Claude 和 Claude-Instant 两种模型可供选择,其中 Claude Instant 的延迟更低,性能略差,价格比完全体的 Claude-v1 要便宜,两个模型的上下文窗口都是 9000 个token(约 5000 个单词,或 15 页)它的目标是“更安全”、“危害更小”的人工智能。Google 还开发了多种 PaLM 的改进版本。更强大的基础模型: ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用了更多样的训练数据、更充分的训练步数和更合理的训练策略。

1万+

构建高效的LLM应用测试框架

《构建高效的LLM应用测试框架》 关键词:LLM,测试框架,应用测试,效率优化,测试原理 摘要:本文将深入探讨构建高效LLM应用测试框架的必要性、方法与步骤,旨在为开发者提供一套系统化、可操作的测试解决方案,从而提升LLM

AI天才研究院 1048

Codeforces Round #362 (Div. 2) B 模拟

链接:戳这里 B. Barnicle time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Barney is standing in a bar and starring at a pretty girl. He

Cross 719

YOLO车辆测距、车辆识别与单目测距

YOLO(You Only Look Once)是一种实时物体检测系统,能够识别视频或图像中的多个对象,并确定其位置。结合车辆识别与单目测距技术,YOLO可以用于交通监控、自动驾驶等应用场景,通过单个摄像头实现车辆的识别与距离测量。YOLO结合单目测距技术,在多个应用领域展现出巨大的潜力与灵活性。其实时性和准确性为智能交通、自动驾驶等领域提供了强有力的技术支持。

走向CTO的路上... 1686

Barnicle【Codeforces 697 B】【模拟科学计数法】

Codeforces Round #362 (Div. 2) B 就是给你一个科学计数法,让你转换成为一般的数。 注意一点,0.001000e1 = 0.01这类的细节,其他倒是没什么了。 #include <iostream> #include <cstdio> #include <cmath> #include <string> #i...

既然弱小,就只顾变强就是了 325

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

CodeForces 697B Barnicle 模拟

强行模拟 纪念一下…… 1 #include<stdio.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<math.h> 5 #include<string.h> 6 #include<string> 7 #include<...

weixin_30569153的博客 106

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

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

Codeforces 697B. Barnicle(模拟)

题目链接简单题意把科学计数法转化成小数。思路字符串处理模拟就好,要小心谨慎,当时被疯狂hack T^T要注意的数据 1.0e0 0.0e0 1.005e0 0.0e10 这种#s = input() a = s[0] d = s[2:s.find('e')] b = int(s[s.find('e') + 1:]) + 1 a = a + d while len(a) < b: a +=

我为刀俎_题为鱼肉 749

visio安装包

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

CodeForces 697 B. Barnicle(简单模拟)

Description 给出一个形如a.bed的数,表示a.b*10^d,输出其小数形式 Input 一个形如a.bed形式的字符串(0 ≤ a ≤ 9, 0 ≤ d < 10^100, 0 ≤ b ≤ 100) (a,b无前置0,d无后缀0) Output 输出小数形式 Sample Input 8.549e2 Sample Output 854.9 Solution 简单

ZSQ 693

Codeforces-697B Barnicle(模拟)

题意是将一个数字的科学计数法转化为完整数字,模拟即可,不过要注意左0右0等等特殊情况,之前开始是用的一个个字符读入进字符数组然后进行分类讨论很复杂,后来发现直接读入字符串进行统一的划分操作即可 #include"iostream" #include"stdlib.h" #include"string" using namespace std; string s; string a,d,c

ak8877的博客 302

CodeForces 697B Barnicle(学习scanf(),科学计数法的转换)

http://codeforces.com/problemset/problem/697/B B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standar

Shyazhut 1150

CodeForces - 697B Barnicle (高精度小数点)

竞赛题目 CodeForces-697B 题解

WolfBolin技术博客 690

Codeforces 679B. Barnicle 模拟

B. Barnicle time limit per test: 1 second memory limit per test :256 megabytes input: standard input output: standard output Barney is standing in a bar and starring at a pretty...

weixin_30270889的博客 280

codeforces 697B. Barnicle - 字符串变数字

科学计数法 给出 a.deb 的形式 转化为数字 要考虑的情况真的好多 QAQ #include #include #include #include #include #include #include #include using namespace std; #define PI 3.1415926 int main() { string str; int s

糖分 296

Codeforces Round #362 (Div. 2)B. Barnicle(较坑模拟【菜鸡与大佬的区别】)

题目链接:http://codeforces.com/contest/697/problem/B【中文题意】给你一个浮点数的计数法表示形式,然后表示出他的正常形式,表示出的数不能有前导0也不能有后导0。 【思路分析】直接模拟就好了,注意几个坑:1. 0.0e0的时候 2. 1.0e0的时候。//第一个是本弱鸡的代码,写了100多行 【AC代码】#include<cstdio> #inclu

linlinsong—ACM界蒟水! 504

CodeForces 697B Barnicle

B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney is standing in a bar and starring at a pr

Calm微笑 520

【Codeforces Round 362 (Div 2)B】【模拟】Barnicle 科学计数法转普通表示法

B. Barnicle time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Barney is standing in a bar and starring at a pretty girl. He wants to shoot her wi

snowy_smile的博客 571

Codeforces Round 362 Div.2 B Barnicle

B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney is standing in a bar and starring at a pret

少女秘封俱乐部 337
上一篇: SPOJ7001 Visible Lattice Points 莫比乌斯反演+分块+前缀和
下一篇: SPOJ4491 Primes in GCD Table 莫比乌斯反演+分块+前缀和
Megumin
博客等级 码龄10年 3粉丝 89原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值