시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 9 | 1 | 1 | 25.000% |
A software company started working on a utility software for detecting duplicate image files. Of course, one simple solution could be the comparison of the file name, extension, creation and modification date-time. But the result is not going to be accurate. To check if two images are duplicate their content should be compared (pixel to pixel comparison).
As a starting point, they want to add the functionality of comparing images with the same size and possibility of 90, 180 or 270 degrees rotation. Write a program that gets the image file name and its content as pixels matrix for input and lists the duplicate image names as output.
First line contains I W H
Next, each image starts with:
Images are separated with a line containing 5 dashes (-).
Print the name of duplicate images sorted alphabetically in ascending order each in one line.
3 4 3 untitled.png 345+ 2344 3455 ----- trip2019.png 323 434 545 54+ ----- game.png +10 210 351 445
trip2019.png untitled.png
Based on the input, there are 3 images, each has a 4x3 or 3x4 dimension. In the table below each image is rotated back to 0 degrees and then compared.
File Name | untitled.png | trip2019.png | game.png |
Input |
345+ 2344 3455 |
323 434 545 54+ |
+10 210 351 445 |
Note | Originally the + sign should be in bottom-left, but because it is rotated +/-180 degrees it is now in top-right. | The image was rotated 90 degrees (or - 270). | The image is rotated 270 (or -90) degrees. |
After Rotation |
5543 4432 +543 |
5543 4432 +543 |
0015 1154 +234 |
So [untitled.png, and trip2019.png] are duplicate because they have the same content (pixels).