PAT a1048题解
来源:互联网 发布:放大镜 知乎 编辑:程序博客网 时间:2024/05/18 06:26
#include <cstdio>#include <algorithm>using namespace std;const int N = 1005;int hashTable[N];int main(){int n, m, a;scanf("%d %d", &n, &m);for(int i = 0; i < n; i++){scanf("%d", &a);++hashTable[a];}for(int i = 0; i < N; i++){if(hashTable[i] && hashTable[m - i]){if(i == m - i && hashTable[i] <= 1){continue;}printf("%d %d\n", i, m -i);return 0;}}printf("No Solution\n");return 0;}
阅读全文
1 0
- PAT a1048题解
- PAT A1048
- PAT-A1048
- PAT-A1048. Find Coins (25)
- PAT A1048. Find Coins (25)
- PAT 1001-1010 题解
- PAT 1011-1020 题解
- PAT 1021-1030 题解
- PAT 1031-1040 题解
- PAT 1041-1050 题解
- PAT 1051-1060 题解
- PAT(basic level)题解
- PAT乙级题解
- PAT题解目录
- PAT甲级题解目录
- PAT乙级题解目录
- PAT甲级1001题解
- PAT甲级1002题解
- JAVA基础知识
- 比真机还快的Genymotion模拟器
- JDBC连接数据库
- Spring源码学习(一):IOC容器初始化
- 矩阵cvMat
- PAT a1048题解
- 安卓性能优化之布局优化(一)
- Matlab绘制三维曲线(plot3)和三维图形(mesh & surf)
- [leetcode]30. Substring with Concatenation of All Words@Java
- Python基础——read(),readline(),readlines()的区别
- 16. 3Sum Closest
- 电脑无线网络固定IP设置方法
- PAT a1049题解
- CSS学习--CSS属性书写顺序和命名规则