1121 Damn Single (25 point(s))

CoaXPress FMC子卡:高速图像采集与FPGA原型开发实战指南 在机器视觉和工业检测领域,高速、可靠的数据传输是核心需求。CoaXPress(CXP)协议作为一种基于同轴电缆的高速接口标准,通过其高带宽、长距离传输和低延迟的特性,有效解决了传统接口在确定性实时传输方面的短板。其技术价值在于为海量图像数据提供了稳定、高效的物理层和数据链路层解决方案,广泛应用于半导体检测、医疗成像等对吞吐量有极致要求的场景。要实现CXP系统的快速原型验证,集成了高速SerDes接口和时钟管理的FMC子卡与FPGA开发板的组合成为关键。这种平台将复杂的硬件设计封装,让开发者能聚焦于图像处理算 阅读详情

1121 Damn Single (25 point(s))

"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (≤ 50,000), the total number of couples. Then N lines of the couples follow, each gives a couple of ID's which are 5-digit numbers (i.e. from 00000 to 99999). After the list of couples, there is a positive integer M (≤ 10,000) followed by M ID's of the party guests. The numbers are separated by spaces. It is guaranteed that nobody is having bigamous marriage (重婚) or dangling with more than one companion.

Output Specification:

First print in a line the total number of lonely guests. Then in the next line, print their ID's in increasing order. The numbers must be separated by exactly 1 space, and there must be no extra space at the end of the line.

Sample Input:

3
11111 22222
33333 44444
55555 66666
7
55555 44444 10000 88888 22222 11111 23333

Sample Output:

5
10000 23333 44444 55555 88888

哈希、STL。

首先建立哈希表,假设每一个在场的人都是单身;然后遍历所有的夫妻数对,如果它们都在场,则说明他们不会孤独,于是取消标记、在场单身人数减2。

#include<iostream>
#include<cstring>
#include<vector> 
using namespace std;
vector<pair<int,int> > v;
const int MAX = 1e5+7;
bool mark[MAX]={false};
int main(void){
	int N,M,a,b;cin>>N;
	while(N--){
		cin>>a>>b;
		v.push_back(pair<int,int>(a,b));
	}
	cin>>M;
	for(int i=0;i<M;i++){
		cin>>a;mark[a]=true;
	}
	for(auto i :v){
		if(mark[i.first]&&mark[i.second]){
			M-=2;
			mark[i.first]=false;
			mark[i.second]=false;
		}
	}
	bool flag = false;cout<<M<<endl;
	for(int i=0;i<100001;i++){
		if(mark[i]){
			if(!flag) printf("%05d",i),flag=true;
			else printf(" %05d",i);
		}
	}
	return 0;
} 

 

Python实战:5分钟搞定N-CMAPSS航空发动机数据集解析(附完整代码) 本文提供了一份针对N-CMAPSS航空发动机数据集的快速解析实战指南。通过Python的h5py和Pandas库,详细演示了如何高效读取HDF5格式文件、理解数据结构、提取关键特征(如传感器数据与剩余使用寿命RUL),并整合为可用于预测性维护分析的DataFrame,帮助研究者和工程师快速上手这一重要的工业时序数据集。 阅读详情

相关推荐

从碰撞电离到雪崩击穿:Sentaurus仿真中的模型选择与验证艺术

本文深入探讨了Sentaurus TCAD中雪崩击穿模型的选取与验证方法,特别关注平行平面结的仿真实践。通过对比Chynoweth、van Overstraeten等主流模型的适用场景与精度差异,结合具体案例展示了从几何建模到边界条件设定的完整验证流程,并针对非理想因素提供了有效的补偿技术,助力工程师提升器件仿真的准确性与可靠性。

weixin_29074295的博客 592

PAT_甲级_1121 Damn Single (25point(s)) (C++)【二分查找】

目录 1,题目描述 题目大意 2,思路 数据结构 算法 3,AC代码 4,解题过程 第一搏 第二搏 1,题目描述 Sample Input: 3 11111 22222 33333 44444 55555 66666 7 55555 44444 10000 88888 22222 11111 23333 Sample Output: 5 10000 23...

&再见萤火虫&的博客 264

实战指南 | Adjust 与 Facebook、Google Ads 自归因配置全流程解析

本文详细解析了Adjust与Facebook、Google Ads自归因配置的全流程,帮助移动应用出海推广者解决广告归因难题。通过自归因功能(SAN),开发者可以获取更准确的数据、简化配置流程并扩大安装来源覆盖,显著提升广告效果监测和ROI计算效率。

weixin_42528780的博客 539

【PAT】A1121 Damn Single (25point(s))

文章目录A1121 Damn Single (25point(s))Input Specification:Output Specification:Sample Input:Sample Output:CodeAnalysis Author: CHEN, Yue Organization: 浙江大学 Time Limit: 200 ms Memory Limit: 64 MB Code Size...

Duke 327

从SolidWorks到Simscape:URDF导出模型错位的5个常见原因及修复方法

本文深入分析了从SolidWorks导出URDF模型到Simscape时出现模型错位的5个常见原因,包括坐标系定义、RPY角陷阱、轴方向统一、质量属性导出和层次结构错乱,并提供了详细的修复方法和实战技巧,帮助工程师高效解决模型错位问题。

weixin_30664051的博客 443

CCC数字钥匙3.0标准解读(22)

介绍设备制造商服务器和车辆制造商服务器之间的通信协议.

weixin_41738640的博客 1748

PAT(A)1121 Damn Single (25point(s))

Sample Input 3 11111 22222 33333 44444 55555 66666 7 55555 44444 10000 88888 22222 11111 23333 Sample Output 5 10000 23333 44444 55555 88888 思路: map记录输出。 代码 #include <iostream> #include &lt...

Sqssq的博客 199

基于STM32XX的LCD液晶显示屏(HS19264G06A、驱动芯片:ST7525)驱动C程序设计

define USE_HW_SPI 1 // 1:使用硬件SPI, 0:使用软件模拟SPI。

myron6688的博客 236

Sicily 1121(递推)

找出递推式。 #include #include using namespace std; int main() { int n; int rank[31]={1,0,3,0,11}; int i; for (i=6;i<=30;i+=2) { rank[i]=3*rank[i-2]; int temp=i-4; while (temp>=0) { rank

immiao的专栏 676

24、手机GPS天线设计与有源GNSS天线性能评估

本文系统介绍了手机GPS天线的代表性设计,包括隔离磁偶极子、共面平衡偶极子和小型陶瓷加载QHA天线,分析了其结构特点、性能参数及适用场景。同时详细阐述了有源GNSS天线的组成结构与G/T比作为关键性能指标的评估方法,并提出了组件选择、噪声控制和增益提升等优化策略。最后展望了未来手机GPS天线在小型化、多频集成和智能适应性方面的发展趋势。

pytorch8learner的博客 724

C#实战:YOLOv5+海康工业相机上位机开发全攻略(从图像采集到检测落地)

工业场景下AI质检系统的开发需要综合考虑硬件适配性、算法性能和稳定性。本文针对新能源电池极片缺陷检测场景,提出基于海康工业相机+YOLOv5+C#的技术方案,涵盖以下关键点: 工业级技术选型:选择支持全局快门的海康相机、OpenCvSharp图像处理、YOLOv5s轻量化模型,确保在无GPU工控机上稳定运行。 开发流程优化: 海康SDK集成:详细说明DLL配置和常见报错解决方案 YOLOv5模型导出:强调batch=1、opset12等工业适配参数 相机采集封装:提供线程安全的C#封装类,支持触发采集模式

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1197

1121 Damn Single (25point(s)) map,set的使用

题目 题目链接 思路 用map把每个组合存入,这里谁是关键字不重要; 用set把要判断的人存入,,set有自动排序的功能; 遍历map中的每一个元素,当且仅当map中一个组合中的key和value都可以在set中找到时,才将这个组合从set中删去; 代码 #include <iostream> #include <vector> #include <cstring> #include <algorithm> #include <stack> #in

hjyp的博客 179

YOLOv26全流程实战手册:从yaml配置拆解到训练推理参数调优(附虚拟环境搭建)

以“车辆、行人、小型物体”3类数据集为例,修改# 1. 修改类别数nc: 3# 2. 调整锚框(适配小目标)anchors:- [12,16, 16,24, 33,23] # 增加小锚框# 3. 轻量化调整(边缘部署)depth_multiple: 0.25 # 降低深度系数width_multiple: 0.20 # 降低宽度系数# 其余Backbone/Head结构不变yaml配置:核心是调整nc(类别数)、(轻量化)、anchors(适配目标尺度);虚拟环境。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 879

1121 Damn Single (25 point(s))

#include&lt;iostream&gt; #include&lt;set&gt; #include&lt;vector&gt; using namespace std; int main(){ int n, a, b, m; scanf("%d", &amp;n); vector&lt;int&gt; couple(100000, -1); for(int i = 0; i ...

徐伯莱 265

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

1121 Damn Single (25point(s)) - C语言 PAT 甲级

1. 用 -1 当初始值,均为单身狗(因为有 0 号客人,所以最好不用 0 当初始值) 2. 用数组映射一对伴侣 3. 用 -2 表示客人到场。读取客人入场,用映射寻找自己的伴侣,当自己单身或伴侣还未到场,自己用 -2 表示到场 4. 若映射的伴侣状态为 -2 到场,则两人配对成功,两人用 -3 表示脱离单身狗标签,单身狗数目减二

有三只土豆 201

efm32 入门.pdf

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

PAT(A) 1121 Damn Single (25 point(s))

#include<bits/stdc++.h> using namespace std; int main(void){ int N, M, a, b, c[100005], g[100005] = {0}; set<int> s; fill(c, c+100005, 100000); scanf("%d", &N); for(int i = 0; i < N; i++){ scanf("%d %d",

Anpotan的博客 104

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

PAT甲级1121 Damn Single (25分) 简单题,注意输出就好

1121 Damn Single (25分) “Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification: Each input file contains one test case. For

qq_32691667的博客 343

1121 Damn Single(25 分)(cj)

1121 Damn Single(25 分) "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input S...

Cute_jinx的博客 219

1121. Damn Single (25)解题报告

直接一对一哈希。 如果没有单身狗,第二行为空。 #define _CRT_SECURE_NO_WARNINGS #include #include struct couple { int c1, c2; bool flag, iscouple; }; const int N = 100000; int main(void) { couple *arr = (couple *)ca

信道者 840

PAT :1121. Damn Single (25) 第二个测试点过不去 希望能有知道的大佬指点

"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input Specification:Each input fi...

zjykshen的博客 682

PAT 甲级1121 Damn Single (25分)

“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification: Each input ...

Seqlist_base的博客 207

1121 Damn Single (25 point(s))(配对关系无重叠:在给定序列中判断是否有配对)

题目链接 silu 题目要求对参加聚会的人进行判断 对单身狗进行保留 考虑到删除操作使迭代器失效是一个头疼的问题 那就不删吧 要么就不用容器,就用一个静态数组存储参加聚会的人 都是在避免删除操作留下的烂摊子 代码 using namespace std; #include<set> #include<map> #include <iomanip> #include <iostream> int n,p, q; map<int, int>couple

Abider2的博客 229

Sicily 1121. Tri Tiling

题目链接:Sicily 1121 题目歹

sysu_smie_WuZewei的专栏 1262

1121 Damn Single(25 分)

"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification: Each inpu...

ysq96的博客 737

Sicily1121

dp[i][j]表示第i列第j种切口情况的

immiao的专栏 1085

1121 Damn Single(25 分)(PAT甲级)

  题目描述:   "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of. Input Specification...

zclimou的博客 313
上一篇: 1134 Vertex Cover (25 point(s))
下一篇: 1148 Werewolf - Simple Version (20 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值