F - Babelfish解题报告(map函数)(陈渊)

Halcon相机标定实战:从参数设置到精度优化全解析 本文详细解析Halcon相机标定的全流程,从基础概念到实战技巧,涵盖参数设置、精度优化及常见问题解决方案。通过实际案例和代码示例,帮助读者掌握工业视觉项目中相机标定的关键技术,提升测量精度和系统稳定性。 阅读详情

F - Babelfish
Time Limit:3000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.

Input

Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters.

Output

Output is the message translated to English, one word per line. Foreign words not in the dictionary should be translated as "eh".

Sample Input

dog ogday
cat atcay
pig igpay
froot ootfray
loops oopslay

atcay
ittenkay
oopslay

Sample Output

cat
eh
loops

Hint

Huge input and output,scanf and printf are recommended.

这个题目可以用到c++中的库函数map函数进行一对一的映射关系的建立,具体的关于map函数的用法,请见群共享。
#include<iostream>
#include<map>
#include<string>
using namespace std;
int main()
{
	map<string,string> search;//定义一个map函数 search
	char *a,*b;
	char line[1001];
	while(1)
	{
		gets(line);
		if(strlen(line)==0)
			break;
		a=strtok(line," ");//进行字符串的分割
		b=strtok(NULL," ");//进行字符串的分割
		search[string(b)]=string(a);//对相应的字符串进行标记
	}
	string word;
	while(cin>>word)
	{
		string result=search[word];//搜索单词
		if(result=="")
			result="eh";
		cout<<result<<endl;
	}
	return 0;
}




故障诊断 | CNN-BiGRU-Attention故障诊断 阅读详情

相关推荐

(目录)微气候模型ENVI-met模拟的基本使用教程

ENVI-met模拟操作系列(一) 介绍:

ysqzhatian的博客 2万+

POJ 2503 Babelfish(map)

Babelfish 题目传送门~ Time Limit:3000MS Memory Limit:65536K Total Submissions:56564 Accepted:23224 Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. F...

深秋无痕 589

振动信号相位测量的关键技术解析

本文深入解析了振动信号相位测量的关键技术,强调相位是振动信号的“身份证”,对于动平衡和故障诊断至关重要。文章详细阐述了键相传感器与振动传感器的选型、安装要点,以及时域和频域(FFT)核心算法,并针对现场噪声、转速波动等挑战提供了实战解决方案,帮助工程师实现精准、稳定的相位测量。

vv45678的博客 838

ACM: hash题 poj 2503

Babelfish Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understan

smile_benson 969

避开这些坑!DS18B20温度读取不准、时序混乱的5个常见问题与调试方法

本文深入解析DS18B20温度传感器在应用中常见的5个问题,包括温度读取不准、时序混乱等,并提供详细的调试方法。通过硬件设计优化、精准延时实现和数据解析技巧,帮助开发者有效解决温度值跳变、初始化失败等典型问题,提升OneWire协议下的温度测量精度。

weixin_29185493的博客 463

差分信号_差分信号的原理及其在PCB的设计

差分线是 PCB 设计中非常重要的一部分信号线,信号处理要求也是相当严谨,今天为大家介绍下差分信号的原理以及其在 PCB 设计中的处理方法。 什么是差分信号 差分传输是一种信号传输的技术,区别于传统的一根信号线一根地线的做法,差分传输在这两根线上都传输信号,这两个信号的振幅相等,相位相差 180 度,极性相反。在这两根线上传输的信号就是差分...

weixin_31849185的博客 1808

POJ-2503 Babelfish 解题报告

Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.

岁月流风、、 1472

大模型系列——一文看懂“提示词” vs “提示词工程” vs “上下文工程”

本文区分了AI领域的三个关键概念:提示词(Prompt)、提示词工程(Prompt Engineering)和上下文工程(Context Engineering)。提示词是直接输入给AI模型的指令文本;提示词工程则是系统化设计、测试和优化提示词的过程;而上下文工程是为AI构建动态上下文,提供恰当信息和工具的科学与艺术。文章通过翻译案例展示了提示词工程的迭代过程,并说明上下文工程在AI Agent中的核心作用——动态收集和组织必要信息。最后强调普通人只需掌握提示词编写,开发AI应用才需深入提示词工程,构建智能

2401_84052244的博客 748

Babelfish(c语言)

题目描述 You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. 输入 Input consists of up to 100,000 dictionary entries, followed b

qq_63683485的博客 2373

FT2004(D2000)开发实战之AMD R5 230显卡驱动适配

AMD R5 230显卡驱动适配

嵌入式Linux 3194

STM32CubeMX | 38-使用硬件SPI驱动以太网模块(W5500)

本篇详细的记录了如何使用STM32CubeMX配置STM32L431RCT6的硬件SPI外设与以W5500通信,驱动以太网模块。 1. 准备工作 硬件准备 开发板 首先需要准备一个开发板,这里我准备的是STM32L4的开发板(BearPi): W5500以太网模块 这里我使用常见的以太网模块W5500: W5500官网 http://www.w5500.cn/ W5500中文手册 iEthernet W5500 Datasheet 软件准备 需要安装好Keil - MDK及芯片对应的包,以

Mculover666的博客(嵌入式) 7386

Babelfish

Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. ...

raptor 2006

基于STM32L4XX 、HAL库的SGM452B数字温度传感器驱动应用C语言程序设计

SGM452B_RESOLUTION_12BIT = SGM452B_CONFIG_R1 | SGM452B_CONFIG_R0 /* 12位分辨率,精度0.0625°C,转换时间200ms */SGM452B_RESOLUTION_11BIT = SGM452B_CONFIG_R1, /* 11位分辨率,精度0.125°C,转换时间100ms */SGM452B_RESOLUTION_10BIT = SGM452B_CONFIG_R0, /* 10位分辨率,精度0.25°C,转换时间50ms */

PP_Cottage的博客 325

UVA - 10282 Babelfish map的应用

题目大意:给出一系列的单词和对于

静静地码 721

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

POJ 2503 - Babelfish(STL)

题目:http://poj.org/problem?id=2503 思路:STL 中map 的使用,处理空行则结束输入会麻烦一点。 CODE: #include #include #include #include using namespace std; map mp; int main() { //freopen("in", "r", stdin); string a

Halo 613

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

ICPC训练联盟2021寒假冬令营(6)_2021.01.25_笔记

试题链接 点我进入代码提交OJ 学习笔记 - C++ STL 简介 • STL(Standard Template Library),也被称为标准模板库,包含大量的模板类和模板函数,是C++提供的一个由一些容器、算法和其他一些组件组成的集合。用于完成诸如输入/输出、数学计算等功能。 • STL被内置到支持C++的编译器中。在C++标准中,STL被组织为13个头文件:<iterator>,<functional>,<vector>,<deque>,<lis

qq_19403405的博客 1381

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

fjnu 1548 Babelfish

DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.

异リ度ュ空ウ間(镜像站) 1052

二分贪心练习题-B2

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. Input

snayf的博客 487

poj 2503 Babelfish——字典映射

Babelfish Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. Input Input consists of up to 100,000 dictionary

five_east_west的博客 484

poj 2503 Babelfish(字典树或着STL)

Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 35828   Accepted: 15320 Description You have just moved from Waterloo to a big city. The people her

舒哥的blog 1213

POJ 2503 Babelfish

Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 28103   Accepted: 12128 Description You have just moved from Waterloo to a big city. The people here

你说我能坚持多久。。 693

输入总结

第一篇原创博客,有必要好好写写

dominating的修行之路 488

ZCMU--1787: Problem C: Babelfish

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.Input consists of up to 100,000 dictionary entries, followed by a blank

小小小Why的博客 466

分治总结2

问题 B: 【分治】Babelfish 题目: You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you underst...

Spidy_harker的博客 1286

POJ 2503 Babelfish(字典树模板题)

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. Input Input ...

kuronekonano的博客 367

Poj 2503 Babelfish

Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 34221   Accepted: 14678 Description You have just moved from Waterloo to a big city. The people her

u013082590的专栏 607
上一篇: I - Expanding Rods解题报告(黄杰)
下一篇: B - Gold Balanced Lineup解题报告(张浩盛伦)
CSUST_ACM
博客等级 码龄15年 42粉丝 127原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值