zoj 3432 Find the Lost Sock (ZOJ Monthly, November 2010)
摘要:题目地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3432题目思路: 其实就是找那个只出现了1次的字符串。 但是如果用数组或者map记录出现的次数,10w的数量会导致超时,学到一种神奇的方式--直接用异或处理先看代码:#include#include#includeusing namespace std;string s;char sock[9];char ans[9];int main(){ int n; cin>>n; while(cin>>n) { getchar(); n=...
阅读全文
posted @ 2013-09-20 23:21
浙公网安备 33010602011771号