ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1006. Square Frames

Tips for the question
Posted by Myrcella 21 Aug 2018 07:51
This problem bothered me a lot. So I decide to write something about it to help other people to solve it more quickly.
---------------------------------------------
1.unsigned char or getchar()(which returns int) must be used to deal with the input
---------------------------------------------
2.When you're testing the program you write, maybe you will find that your PC can't run correct answer(even your code is right)(at least on my local PC... My accepted code always output 0 be cause char such as ┌ is always regarded as two char(s?).

So here is how I check my program.
----------------------------------------------------------
This is the original sample:
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
...........┌─────┐................................
...........│.....│................................
....┌──────│.....│..........┌─┐...................
....│......│.....│..........│.│...................
....│......│.....│..........└─┘...................
....│......│....┌│────┐.............┌─┐...........
....│......└─────┘....│.............│.│...........
....│......│....│.....│.............└─┘...........
....│......│....│.....│.........┌──┐..............
....└──────┘....│.....│.........│..│..............
................│.....│.........│..│..............
................└─────┘.........└──┘..............
..................................................
..................................................

And I changed it to the figure below:
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
...........+,,,,,+................................
...........*.....*................................
....+,,,,,,*.....*..........+,+...................
....*......*.....*..........*.*...................
....*......*.....*..........+,+...................
....*......*....+*,,,,+.............+,+...........
....*......+,,,,,+....*.............*.*...........
....*......*....*.....*.............+,+...........
....*......*....*.....*.........+,,+..............
....+,,,,,,+....*.....*.........*..*..............
................*.....*.........*..*..............
................+,,,,,+.........+,,+..............
..................................................
..................................................

In this case my local PC gave the right answer.
You just need a little change to make it work (i.e. change the ascii)