1050 String Subtraction (20 point(s))

地平线旭日X3开发板--使用Opencv显示CSI摄像头例程 但是从libsrcampy获取的摄像头图像格式是NV12,无法直接在opencv上显示或者处理,调试过程发现旭日派无法直接用opencv的VideoCapture()调用CSI摄像头,需要使用opencv来做开发的小伙伴可以做个参考,效果如下图所示。需要使用libsrcampy库来获取CSI摄像头图像,为了能够使用opencv的API来处理图像,需要增加NV12转化成bgr像素格式的函数。opencv显示图像.png。 阅读详情

1050 String Subtraction (20 point(s))

Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after taking all the characters in S​2​​from S​1​​. Your task is simply to calculate S​1​​−S​2​​ for any given strings. However, it might not be that simple to do it fast.

Input Specification:

Each input file contains one test case. Each case consists of two lines which gives S​1​​ and S​2​​, respectively. The string lengths of both strings are no more than 10​4​​. It is guaranteed that all the characters are visible ASCII codes and white space, and a new line character signals the end of a string.

Output Specification:

For each test case, print S​1​​−S​2​​ in one line.

Sample Input:

They are students.
aeiou

Sample Output:

Thy r stdnts.

考点:字符串处理、哈希表。

ASCⅡ共有128个(0~127),使用哈希表标记其是否属于s2的字符。如果标记,在s1中不输出,否则输出。常规方法会出现TLE。 

#include<iostream>
#include<string>
using namespace std;
const int LEN = 128;
bool mark[LEN]={false};
int main(void){
	string s1,s2;
	getline(cin,s1);
	getline(cin,s2);
	for(int i=0;i<s2.length();i++){
		mark[s2[i]]=true;
	}
	for(int i=0;i<s1.length();i++){
		if(!mark[s1[i]]) cout<<s1[i];
	}
	cout<<endl;
	return 0;
} 

 

【补充篇】三万字了解AUTOSAR软件架构(一) 主要讲解了AUTOSAR软件架构的分层及各个栈的作用 阅读详情

相关推荐

PLC作为Modbus TCP客户端

PLC作为Modbus TCP客户端,Modbus Slave作为服务器

soledad_chao的博客 4378

1050 String Subtraction(20 分)

1050 String Subtraction(20 分) Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​. Your task is simply to calcul...

galesaur_wcy 401

用Python搞定超效率SBM模型:从数据清洗到结果可视化全流程指南

本文详细介绍了如何使用Python实现超效率SBM模型,从数据清洗到结果可视化的全流程指南。超效率SBM模型作为传统DEA的进化版本,能有效处理非期望产出(如环境污染)并对高效单元进行精细排序。通过实战案例和代码示例,帮助读者掌握这一先进模型的Python实现技巧,提升效率评估的准确性和可视化效果。

silver的专栏 650

A1050 String Subtraction (20 分)(哈希)(水题)

Given two stringsS​1​​andS​2​​,S=S​1​​−S​2​​is defined to be the remaining string after taking all the characters inS​2​​fromS​1​​. Your task is simply to calculateS​1​​−S​2​​for any given s...

julia7_的博客 235

GD32模拟IIC读写DVC1124

GD32模拟IIC读写集澈AFE芯片DVC1124

ponyma_的博客 1226

2025年12月GESP真题及题解(C++一级): 小杨的爱心快递

2025年12月GESP真题及题解(C++一级): 小杨的爱心快递

王老师青少年编程 1648

PTA 7-2 输出整数各位数字

本题要求编写程序,对输入的一个整数,从高位开始逐位分割并输出它的各位数字。 输入格式: 输入在一行中给出一个长整型范围内的非负整数。 输出格式: 从高位开始逐位输出该整数的各位数字,每个数字后面有一个空格。 输入样例: 123456 输出样例: 1 2 3 4 5 6 #include #include int main(){ int a,

LeoPhilo的博客 1万+

[PCIe5.0] 3.4.1 Flow Control Initialization State Machine Rules

流控初始化是PCIe链路中每个虚拟通道(VC)启用的必经流程,分为FC_INIT1和FC_INIT2两个阶段,确保发送端与接收端的缓冲区信用值协商一致。

系统固件工程师 139

1050 String Subtraction (20 分)题解 甲级

1050 String Subtraction (20 分) Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​. Your task is simply to calcu...

lzy我就来随便逛逛的博客 343

Ceph入门到精通-存储桶通知

这 通知还可以根据前缀的匹配项过滤掉事件,并且 (1) 键的后缀,(2) 附加到对象的元数据属性, 或 (3) 对象标签。在此模式下,操作仅在以下之后确认(确认) 通知将发送到主题的已配置终端节点。这意味着 通知的往返时间(发送 通知主题的终端节点以及接收 确认)被添加到操作本身的延迟中。要更新主题,请使用用于创建主题的相同命令(但在 更新时,使用现有主题的名称和不同的终端节点值)。端口:对于未加密的连接,默认为 5672,对于未加密的连接,默认为 5671 SSL 加密连接。(默认情况下,这是“假的”。

隔壁老瓦的专栏 1131

YOLOv11【第二十章:模型迭代与生态闭环篇·第1节】在线增量学习——部署后新数据自动回流重训!

🏆 本文收录于专栏 《YOLOv11实战:从入门到深度优化》。本专栏围绕 YOLOv11 的改进、训练、部署与工程优化 展开,系统梳理并复现当前主流的 YOLOv11 实战案例与优化方案,内容目前已覆盖 分类、检测、分割、追踪、关键点、OBB 检测 等多个方向。

**My Coding Family** 432

1050. String Subtraction (20)

Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1 - S2 for any given strings. However,

大胖子狗的博客 558

NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.解决方案

本文主要介绍了NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.解决方案,希望能对使用jupyter notebook的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 11万+

1050 String Subtraction (20 point(s))

Hash思想

Bonstoppo 189

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

1050 String Subtraction (20point(s))

1050 String Subtraction (20point(s)) Given two strings S ​1 ​​ and S ​2 ​​ , S=S ​1 ​​ −S ​2 ​​ is defined to be the remaining string after taking all the characters in S ​2 ​​ from S ​1 ​​ . Your task is simply to calculate S ​1 ​​ −S ​2 ​​ for any gi

佳迪斯的博客 128

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

1050 String Subtraction (20 point(s))

#include&lt;cstdio&gt; #include&lt;iostream&gt; #include&lt;string&gt; using namespace std; string a, b; bool book[256]; int main() { getline(cin, a); getline(cin, b); for(int i = 0; i &lt; b.le...

徐伯莱 230

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

1050 String Subtraction (20 point(s)) -C语言 PAT 甲级

设计思路: 数组索引,映射 S<sub>2</sub> 中出现的字符,根据映射数组重新输出 S<sub>1</sub>

有三只土豆 194

PAT (甲级)1050 String Subtraction (20point(s))

题目 题目链接 思路 题目大意:把s2中出现的字符从s1中删除,并不需要真的删除,只要对s2中的每个字符做上标记,遍历s1时如果某个字符标记过不输出就可以了; 题目虽然简单,但还是有两个知识点的; 1、gets函数不能通过编译,要使用 cin.getline(字符数组名,字符长度,结束符),其中结束符默认为 \n; fetchar(); //读取多余字符,包括回车和空格; getline(cin, string); //读取一行到string中,可以读取回车; 2、阿斯克码表一共有128个字符,包括可见的不

hjyp的博客 229

pat 甲级1050 String Subtraction (20 point(s))

题意:给出两个字符串s1,s2,除去s1中s2的元素,然后输出; 代码: #include<iostream> #include<vector> using namespace std; int main(){ string s1,s2; getline(cin,s1); getline(cin,s2); vector<char >v; int s1len=s1.length(); for(int i=0;i<s1len;i++){ if

m0_51711089的博客 237

PAT甲 1050 String Subtraction (20point(s)) & codeup 问题 D: String Subtraction (20)

题目链接:PAT A 1050 Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​. Your task is simply to calculate S​1​​−S​2​​ for any given strings. However, it might not be that si

ECNUACRush的博客 197

1050 String Subtraction (20 分)

1050 String Subtraction (20 分) Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after taking all the characters in S​2​​ from S​1​​. Your task is simply to calcu...

92377 282

1050. String Subtraction (20)解题报告

#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <cstdlib> #include <iostream> #include <cstring> #define N 11000 int main(void) { bool h[300]; char str1[N], str2[N], str3[N]; fge

信道者 384

7-5 矩阵运算 (10 分)

7-5 矩阵运算 (10 分) 给定一个n×n的方阵,本题要求计算该矩阵除副对角线、最后一列和最后一行以外的所有元素之和。副对角线为从矩阵的右上角至左下角的连线。 输入格式: 输入第一行给出正整数n(1&lt;n≤10);随后n行,每行给出n个整数,其间以空格分隔。 输出格式: 在一行中给出该矩阵除副对角线、最后一列和最后一行以外的所有元素之和。 输入样例: 4 2 3 4 1 5 6 1 1 7...

Guooooozy的博客 3883

PAT (Advanced Level) Practice A1050 String Subtraction (20 分)(C++)(甲级)(散列)

1050 String Subtraction (20 分) Given two strings S1 and S​2 , S=S​1−S2 is defined to be the remaining string after taking all the characters in S​2​​ from S1. Your task is simply to calculate S1 −S​2...

izhxxx的博客 260

1050. String Subtraction

1050. String Subtraction (20) 时间限制 10 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given two strings S1and S2, S = S1- S2is defined to be the rem...

aaa1230550的博客 243

算法笔记练习 4.2 散列 问题 D: 【PAT A1050】String Subtraction

题目链接 题目 Given two strings S1 and S​2, S = S1−S2 is defined to be the remaining string after taking all the characters in S​2 from S​1. Your task is simply to calculate S1−S​2 for any given strings. Ho...

Gorgeoustray 405
上一篇: 1085 Perfect Sequence (25 point(s))
下一篇: 1069 The Black Hole of Numbers (20 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值