CF51A.Cheaterius's Problem
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Cheaterius is a famous in all the Berland astrologist, magician and wizard, and he also is a liar and a cheater. One of his latest inventions is Cheaterius' amulets! They bring luck and wealth, but are rather expensive. Cheaterius makes them himself. The technology of their making is kept secret. But we know that throughout long nights Cheaterius glues together domino pairs with super glue to get squares 2 × 2 which are the Cheaterius' magic amulets!
That's what one of Cheaterius's amulets looks like
After a hard night Cheaterius made n amulets. Everyone of them represents a square 2 × 2, every quarter contains 1 to 6 dots. Now he wants sort them into piles, every pile must contain similar amulets. Two amulets are called similar if they can be rotated by 90, 180 or 270 degrees so that the following condition is met: the numbers of dots in the corresponding quarters should be the same. It is forbidden to turn over the amulets.
Write a program that by the given amulets will find the number of piles on Cheaterius' desk.
切特里乌斯是整个贝尔兰赫赫有名的占星家、魔法师和巫师,同时他也是个骗子和作弊者。他最近的一项发明是“切特里乌斯护身符”!这些护身符能带来好运与财富,但价格不菲。切特里乌斯亲自制作它们,其制作工艺严格保密。不过我们知道,他在漫漫长夜里,用强力胶将多米诺骨牌两两粘合,从而制成 2×2 的正方形——这正是切特里乌斯的魔法护身符!
这就是切特里乌斯的一枚护身符
经过一个辛苦的夜晚,切特里乌斯共制作了 n 枚护身符。每枚护身符均为一个 2×2 的正方形,其中每个小方格内含有 1 至 6 个点。现在他想把这些护身符分堆存放,要求每一堆内的护身符彼此“相似”。若两枚护身符可通过绕中心顺时针旋转 90∘、180∘ 或 270∘(禁止翻转)后,使得对应位置上的点数完全相同,则称这两枚护身符是“相似”的。
请编写一个程序,根据给定的 n 枚护身符,计算出切特里乌斯桌面上共有多少堆。
输入格式
The first line contains an integer n (1 ≤ n ≤ 1000), where n is the number of amulets. Then the amulet's descriptions are contained. Every description occupies two lines and contains two numbers (from 1 to 6) in each line. Between every pair of amulets the line "**" is located.
第一行包含一个整数 n(1≤n≤1000),其中 n 表示护符的数量。随后是护符的描述信息。每个护符的描述占据两行,且每行包含两个数字(范围为 1 到 6)。每对护符之间用一行 ** 分隔。
输出格式
Print the required number of piles.
输出所需的堆数。
输入输出样例
输入#1
4 31 23 ** 31 23 ** 13 32 ** 32 13
输出#1
1
输入#2
4 51 26 ** 54 35 ** 25 61 ** 45 53
输出#2
2
输入解题思路,AI测评打分。不知道怎么写?