![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
哈希表
文章平均质量分 84
苏摩夜
持之以恒
展开
-
UVA - 10591 Happy Number
题目:#include #include #include #include #define ll long long int using namespace std;int vis[100000000];ll bit(int u) { ll sum = 0; while (u) { int v = u %10; sum += v * v; u = u / 1原创 2014-11-08 20:08:08 · 436 阅读 · 0 评论 -
UVA - 141 The Spot Game
The Spot Game The game of Spot is played on an NxN board as shown below for N = 4. During the game, alternate players may either place a black counter (spot) in an empty square or remove原创 2014-11-07 19:56:25 · 650 阅读 · 0 评论 -
UVA - 10391 Compound Words
Problem E: Compound WordsYou are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of exactly two other words in原创 2014-11-04 00:04:08 · 393 阅读 · 0 评论 -
UVA - 10282 Babelfish
Problem C: BabelfishYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you underst原创 2014-11-03 23:11:06 · 438 阅读 · 0 评论 -
UVA - 188 Perfect Hash
aaaa#include#include#includeusing namespace std;int c,k;int x[15];int f(){ int i,j; for(i=0;i<k;i++) for(j=i+1;j<k;j++) if((c/x[i]%k)==(c/x[j]%k)){ c=min((c/x[i]+1)*x[i],(c/x[j]+1)*x[原创 2014-10-31 22:19:52 · 459 阅读 · 0 评论 -
UVA - 10125 Sumsets
#include #include #include #include #include #include using namespace std; const int MAXN = 10000003; const int MAXSIZE = 1030; int n; int rear; struct node {原创 2014-11-06 22:40:12 · 377 阅读 · 0 评论 -
UVA - 10887 Concatenation of Languages
Problem AConcatenation of LanguagesInput File: Standard InputOutput: Standard Output A language is a set of strings. And the concatenation of two languages is the set of all strings that are原创 2014-11-07 16:21:55 · 373 阅读 · 0 评论