用个unordered_map存一下那些数字,每次找a[target-a[i]存不存在。存在加上a[i],以元素值为键值,次数为实值
点赞 4

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务