哈希表
冰阔落
Stay hungry, Stay foolish, Stop when you are perfect.
展开
-
UVA 10282 - Babelfish
题目大意:解题思路:#include #include #include #include using namespace std;int main() { map word; char foreign[15], English[15], pair[50]; while (gets(pair), pair[0]) { sscanf(pair, "%s%s",原创 2014-09-04 17:53:50 · 1692 阅读 · 0 评论 -
UVA 10391 - Compound Words
题目大意:解题思路:#include #include #include using namespace std;int main() { string s; set word; while (cin >> s) word.insert(s); for (set ::const_iterator it = word.begin(); it != word.e原创 2014-09-04 20:51:39 · 1649 阅读 · 0 评论 -
UVA 10125 - Sumsets
#include #include using namespace std;int a, b, c, d, n, arr[1005];bool judge() { for (d = n - 1; d >= 0; d--) for (a = n - 1; a > 0; a--) for (b = a - 1, c = 0; b > c && a != d; ) if (原创 2014-09-04 23:09:00 · 1681 阅读 · 0 评论 -
UVA 10887 - Concatenation of Languages
#include #include #include using namespace std;int main() { int t, num = 1; cin >> t; while (t--) { set data; string word_1[1505], word_2[1505], str; int m, n; cin >> m >> n; getlin原创 2014-09-05 18:39:13 · 1808 阅读 · 0 评论 -
UVA 10591 - Happy Number
题目大意:jietisi#include int main() { int t, count = 1; scanf("%d", &t); while (t--) { int num, arr[800] = {0}; scanf("%d", &num); int n = num, sum; while (1) { sum = 0; while (n原创 2014-09-05 20:36:37 · 1847 阅读 · 0 评论 -
UVA 141 - The Spot Game
题目大意:解题思路:#include #include #include using namespace std;int main() { int n; while (scanf("%d", &n), n) { set data; int x, y, flag = 0; char c, s[4][2600] = {0}; for (int i =原创 2014-09-06 18:11:38 · 1726 阅读 · 0 评论 -
UVA 188 - Perfect Hash
#include #include int main() { char str[100]; while (gets(str)) { int w[15] = {0}, n = 0, C = 1 << 31 - 1; for (int i = 0; i < strlen(str); i++) if (str[i] >= 'a' && str[i] <= 'z') w[n原创 2014-09-02 23:39:08 · 1748 阅读 · 0 评论