A1048】的更多相关文章

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: f…
给n个正整数,再给一个m,如果n个数中存在a+b=m(a<=b),则输出a,b. 如果有两组以上,则输出a最小的一组. #include<cstdio> #include<algorithm> using namespace std; ; int hashTable[N]; int main(){ int n,m,a; scanf("%d %d",&n,&m); ;i<n;i++){ scanf("%d",&…
一.技术总结 首先初看题目有点没读懂,题目大致意思是小明有很多个硬币不同面值的,但是现在他要到商家这里换新的面值, 且商家有一个规定,一个新的硬币必须要你两个硬币面值相加等于的来换,这一有第一个问题产生,就是会出现两两组合产生新硬币有多种 其中这里取最小的,然后输出小的面值在前.第二个问题是可能出现两个一样的硬币. 所以,我开始使用bool类型的数组,不行要采用int类型的看看是否可能出现同一个硬币面值两次.所以当时第一次提交时有一个测试点没通过. 改正后问题解决. 二.参考代码 #includ…
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: f…
#include<cstdio> #include<cstring> const int maxn = 1000; bool HashTable[maxn] = { false };//用HashTable的一个数组标记字符是否被输出过了 int main() { char str1[maxn], str2[maxn]; gets_s(str1); gets_s(str2); int len1 = strlen(str1);//获取长度 int len2 = strlen(str2…
发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintained by Stephen J. Gowdy <linux.usb.ids@gmail.com> # If you have any new entries, please submit them via # http://www.linux-usb.org/usb-ids.html # or s…
1048 Find Coins (25 分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requir…
Source: PAT A1048 Find Coins (25 分) Description: Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,…
专题一  字符串处理 A1001 Format(20) #include<cstdio> int main () { ]; int a,b,sum; scanf ("%d %d",&a,&b); sum=a+b; ) { printf ("-"); sum=-sum; } ; ) { s[top++]=; } ) { s[top++]=sum%; sum/=; } ;i>=;i--) { printf ("%d"…