POJ 3349 Snowflake Snow Snowflakes
| Time Limit: 4000MS | Memory Limit: 65536K | |
| Total Submissions: 27598 | Accepted: 7312 |
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 program will read information about a collection of snowflakes, and search for a pair that may be identical. Each snowflake has six arms. For each snowflake, your program will be provided with a measurement of the length of each of the six arms. Any pair of snowflakes which have the same lengths of corresponding arms should be flagged by your program as possibly identical.
Input
The first line of input will contain a single integer n, 0 < n ≤ 100000, the number of snowflakes to follow. This will be followed by n lines, each describing a snowflake. Each snowflake will be described by a line containing six integers (each integer is at least 0 and less than 10000000), the lengths of the arms of the snow ake. The lengths of the arms will be given in order around the snowflake (either clockwise or counterclockwise), but they may begin with any of the six arms. For example, the same snowflake could be described as 1 2 3 4 5 6 or 4 3 2 1 6 5.
Output
If all of the snowflakes are distinct, your program should print the message:
No two snowflakes are alike.
If there is a pair of possibly identical snow akes, your program should print the message:
Twin snowflakes found.
Sample Input
2
1 2 3 4 5 6
4 3 2 1 6 5
Sample Output
Twin snowflakes found.
Source
hash函数。。。3750ms。。。险过。。。
|
#include <iostream>
#include <cstdio> #include <cstring> #include <vector> using namespace std; struct ST bool cmp(const ST x,const ST y) int main() |
* This source code was highlighted by YcdoiT. ( style: Codeblocks )
POJ 3349 Snowflake Snow Snowflakes的更多相关文章
- 哈希—— POJ 3349 Snowflake Snow Snowflakes
相应POJ题目:点击打开链接 Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions ...
- POJ 3349 Snowflake Snow Snowflakes(简单哈希)
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 39324 Accep ...
- poj 3349:Snowflake Snow Snowflakes(哈希查找,求和取余法+拉链法)
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 30529 Accep ...
- POJ 3349 Snowflake Snow Snowflakes (Hash)
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 48646 Accep ...
- [ACM] POJ 3349 Snowflake Snow Snowflakes(哈希查找,链式解决冲突)
Snowflake Snow Snowflakes Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 30512 Accep ...
- [poj 3349] Snowflake Snow Snowflakes 解题报告 (hash表)
题目链接:http://poj.org/problem?id=3349 Description You may have heard that no two snowflakes are alike. ...
- POJ 3349 Snowflake Snow Snowflakes(哈希)
http://poj.org/problem?id=3349 题意 :分别给你n片雪花的六个角的长度,让你比较一下这n个雪花有没有相同的. 思路:一开始以为把每一个雪花的六个角的长度sort一下,然后 ...
- POJ 3349 Snowflake Snow Snowflakes Hash
题目链接: http://poj.org/problem?id=3349 #include <stdio.h> #include <string.h> #include < ...
- hash应用以及vector的使用简介:POJ 3349 Snowflake Snow Snowflakes
今天学的hash.说实话还没怎么搞懂,明天有时间把知识点总结写了,今天就小小的写个结题报告吧! 题意: 在n (n<100000)个雪花中判断是否存在两片完全相同的雪花,每片雪花有6个角,每个角 ...
随机推荐
- ios —— UIViewAdditions 布局坐标类库
方便大家计算视图的高度,宽度,上下左右坐标,简化代码操作,更加直观 下载地址:http://download.csdn.net/detail/humingtao2013/7511657
- Opencv step by step - 视频进度条
上一个博文只是进行了视频播放,这里加上进度条. 下面是修改好的代码: #include <cv.h> #include <highgui.h> /* * tan@ubuntu: ...
- 不得不说的JavaScript异步加载
同步加载的问题 默认的js是同步加载的,这里的“加载”可以理解成是解析.执行,而不是“下载”,在最新版本的浏览器中,浏览器对于代码请求的资源都是瀑布式的加载,而不是阻塞式的,但是js的执行总是阻塞的. ...
- OOP多态和继承要点
早期绑定和多态 C#函数重载的签名规则是用参数的类型和数量判断,而不是函数的名字. 函数返回值不作为重载签名. 修饰符不作为签名的一部分,如static 同函数中,多个参数名称要唯一 ref ...
- word删除水平线(分割线)的方法(原创)
在word里面,有时候我们会输入3个“-”或者“=”等符合,然后一个回车,生成了一条水平线(分割线). 研究了很久,今天终于发现删除它的方法了. 选中文本,点“格式”,选中“边框和底线”,点第一个子页 ...
- 深入理解C#泛型
前面两篇文章介绍了C#泛型的基本知识和特性,下面我们看看泛型是怎么工作的,了解一下泛型内部机制. 泛型内部机制 泛型拥有类型参数,通过类型参数可以提供"参数化"的类型,事实上,泛型 ...
- JS表单学习笔记(思维导图)
导图
- WebClient和HttpClient, 以及webapi上传图片
httppost请求. applicationkey/x-www-form-urlencoded请求: Email=321a&Name=kkfewwebapi里面, 如果用实体, 能接受到. ...
- web服务器
1.打破信息孤岛,实现信息的集成 2.配置文件 web.xml 定义自己的服务器应该要哪些功能! 3.tomcat 是一个servlet容器,一个web服务器. 部署:将web应用 ...
- hdu1686 KMP
简单KMP 求单词出现的次数.直接可以考虑,在每一次匹配成功时,让ans++,k=next[k],直到结束. #include<stdio.h> #include<string.h& ...