切换到宽版
  • 12219阅读
  • 9回复

怎么做Transformations? [复制链接]

上一主题 下一主题
离线cpp_student
 
只看楼主 倒序阅读 0 发表于: 2007-03-25
Transformations

A square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformations:

#1: 90 Degree Rotation: The pattern was rotated clockwise 90 degrees.
#2: 180 Degree Rotation: The pattern was rotated clockwise 180 degrees.
#3: 270 Degree Rotation: The pattern was rotated clockwise 270 degrees.
#4: Reflection: The pattern was reflected horizontally (turned into a mirror image of itself).
#5: Combination: The pattern was reflected horizontally and then subjected to one of the rotations (#1-#3).
#6: No Change: The original pattern was not changed.
#7: Invalid Transformation: The new pattern was not obtained by any of the above methods.
In the case that more than one transform could have been used, choose the one with the minimum number above.

PROGRAM NAME: transform
INPUT FORMAT
Line 1: A single integer, N
Line 2..N+1: N lines of N characters (each either `@' or `-'); this is the square before transformation
Line N+2..2*N+1: N lines of N characters (each either `@' or `-'); this is the square after transformation

SAMPLE INPUT (file transform.in)
3
@-@
---
@@-
@-@
@--
--@

OUTPUT FORMAT
A single line containing the the number from 1 through 7 (described above) that categorizes the transformation required to change from the `before' representation to the `after' representation.
SAMPLE OUTPUT (file transform.out)
1



--------------------------------------------------------------------------------
求助。
谢谢大虾们。
离线stevenjl

只看该作者 1 发表于: 2007-03-25
Dream Walker...
离线ddegg
只看该作者 2 发表于: 2007-06-08
枚举...可能变换的方式...
离线宇轩
只看该作者 3 发表于: 2007-06-09
貌似是个烦题。。。
离线bigbryant
只看该作者 4 发表于: 2007-10-28
枚举题目,欢迎光临我的空间,USACO解题分析
http://hi.baidu.com/bigbryant
离线zhuojingwei
只看该作者 5 发表于: 2008-01-06
硬搜
离线archimedes

只看该作者 6 发表于: 2008-01-13
引用第5楼zhuojingwei于2008-01-06 21:20发表的  :
硬搜

没必要 枚举就可以了
离线yonghu86cs
只看该作者 7 发表于: 2008-02-23
。。。
离线skywalker
只看该作者 8 发表于: 2008-02-29
枚举出所有情况,然后硬性搜索,不会超时的!
离线gamelees
只看该作者 9 发表于: 2008-06-16
好贴子哦,大家不顶说不过去
好贴子哦,大家不顶说不过去

-------------------------
We provide all WoW Gold services. You can buy Cheap WoW Power Leveling here!
Welcome to our website for you World of Warcraft Gold,WoW Power Leveling,Cheap World of Warcraft Gold,buy cheap WoW Power Leveling,real WoW Gold,sell WoW Gold,
快速回复
限100 字节
 
上一个 下一个