POJ 3349
发布日期:2021-06-30 15:31:07 浏览次数:2 分类:技术文章

本文共 716 字,大约阅读时间需要 2 分钟。

小优大佬说的特别好

思路就是他说的了,但大佬的代码格外复杂。

简短些的话见下:

HASH表的内容见:

#include 
#include
#include
using namespace std;const int maxn = 100000+10;const int mod = 10997;typedef struct{ int a[6];}node; vector
arr[mod+1]; int getHash(node y){ int value = 0; for(int i = 0;i<6;i++) { value += y.a[i]%mod; value %= mod; } return value;} bool cmp(node x,int value){ for(int i = 0;i
=0;k--) { if(arr[value][i].a[l++]!=x.a[(k+j)%6]) break; } if(k==-1) return true; } } return false;} int main(){ int n; scanf("%d",&n); int gg = 0; for(int i = 0;i

 

转载地址:https://joycez.blog.csdn.net/article/details/83097419 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:POJ 3274
下一篇:POJ 2299

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月23日 01时25分18秒