1416: Find the Lost Sock
来源:互联网 发布:安装ubuntu出错 编辑:程序博客网 时间:2024/05/21 13:54
1416: Find the Lost Sock
Time Limit: 2 Sec Memory Limit: 128 MBSubmit: 335 Solved: 72
[Submit][Status][Web Board]
Description
Alice bought a lot of pairs of socks yesterday. But when she went home, she found that she has lost one of them. Each sock has a name which contains exactly 7 charaters.
Alice wants to know which sock she has lost. Maybe you can help her.
Input
There are multiple cases. The first line containing an integer n (1 <= n <= 1000000) indicates that Alice bought n pairs of socks. For the following 2*n-1 lines, each line is a string with 7 charaters indicating the name of the socks that Alice took back.
Output
The name of the lost sock.
Sample Input
2
aabcdef
bzyxwvu
bzyxwvu
4
aqwerty
easafgh
aqwerty
easdfgh
easdfgh
aqwerty
aqwerty
2
0x0abcd
0ABCDEF
0x0abcd
Sample Output
aabcdef
easafgh
0ABCDEF
HINT
Source
能用异或算我怎么没想到呢。。。用map,string什么的都稳稳的超时
#include<cstdio>int main(){ int n,i,j;char a[10],b[10]; while(~scanf("%d",&n)){ scanf("%s",a); for(i=1;i<n*2-1;i++){ scanf("%s",b);for(j=0;j<7;j++)a[j]^=b[j]; } puts(a); }}
阅读全文
0 0
- 1416: Find the Lost Sock
- ZCMU-1416-Find the Lost Sock
- zoj3432——Find the Lost Sock
- zoj 3432 Find the Lost Sock
- zoj 3432 Find the Lost Sock
- 异或解题:Find the Lost Sock
- ZOJ 3432 Find the Lost Sock
- ZOJ 3432 Find the Lost Sock
- ZOJ3432 Find the Lost Sock,异或运算
- zoj 3432 Find the Lost Sock(解决时间超时问题)
- ZOJ 3432 Find the Lost Sock 解题报告
- ZOJ3432 Find the Lost Sock 字符串异或
- ZOJ 3432 Find the Lost Sock(模拟)
- ZOJ3432 Find the Lost Sock(异或运算)
- zoj3432 Find the Lost Sock 亦或的运用
- zoj 3432 Find the Lost Sock(zoj月赛,受打击了 = =)
- ZOJ 3432 Find the Lost Sock
- zoj 3432 Find the Lost Sock (ZOJ Monthly, November 2010)
- (记录合并)union和union all 的区别
- UVALive 2755 Hidden Password (最小表示法)
- 2017思维导图学习法,掌握这八点事半功倍!
- Spring学习笔记
- 简单数据格式zTree数据回显
- 1416: Find the Lost Sock
- nginx 配置 auth_basic 应用于SpringBootAdmin 登录
- IOS UIVIiew 指定一个方向的圆角处理
- 标准差、方差、协方差和互相关系数
- 剑指offer_位运算---二进制中1的个数
- Hadoop生产环境的配置札记
- docker安装和常用命令
- DDR 2 和DDR3的区别
- SpringMVC 获取前端值的方式