PAT (Advanced Level) Practice 1078 Hashing

題目連接:1078 Hashingios 審題不難,思路也很簡單。若M不爲素數,先找出大於M的最小素數。因此,先打表素數。以後採用二次探測法進行哈希插入。輸出在Hash表中id。若不能插入則輸出 ‘-’。spa AC代碼:code #include <iostream> #include <cstdio> using namespace std; const int maxn = 10020; i
相關文章
相關標籤/搜索