题目链接:http://poj.org/problem?id=3349 题意:雪花有6个瓣,有n个雪花,输入每个雪花的瓣长,判断是否有一模一样的雪花(通过旋转或翻转最终一样,即瓣长对应相等).如果前面的雪花判断出有重复,则不需对后续的进行操作. 题解:直接将花瓣存在二维数组里面,然后每次新输入一个,再对之前的进行遍历判重.但是这种做法很低效,遍历花了很多时间.所以用哈希表,可直接访问是否存在重复,如果不重复,则用一维数组将雪花存起来(数组包含在结构体里),并将其"挂"在相应的哈希值(k…
题目链接. 分析: 哈希竟然能这么用.检查两片雪花是否相同不难,但如果是直接暴力,定会超时.所以要求哈希值相同时再检查. AC代码: #include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <algorithm> #include <vector> #include <map> #include <cstr…
Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 27312   Accepted: 7213 题目链接:http://poj.org/problem?id=3349 Description You may have heard that no two snowflakes are alike. Your task is to write a program to dete…
Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 39324   Accepted: 10298 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true.…
Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 30529   Accepted: 8033 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Y…
Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 30512   Accepted: 8024 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Y…
相应POJ题目:点击打开链接 Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 33595   Accepted: 8811 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is…
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 34762 Accepted: 9126 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your…
Snowflake Snow Snowflakes Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 35642   Accepted: 9373 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Y…
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 37615 Accepted: 9882 Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your…