Canadian Computing Competition: 2001 Stage 1, Junior #4, Senior #2
A spiral of numbers can start and end with any positive integers less than
A spiral starts with the first number in the centre. The next number appears immediately below the first number. The spiral continues with the numbers increasing in a counter-clockwise direction until the last number is printed.
Sample Input 1
Copy
10
27
Sample Output 1
Copy
27 26
16 15 14 25
17 10 13 24
18 11 12 23
19 20 21 22
Sample Input 2
Copy
7
12
Sample Output 2
Copy
12 11
7 10
8 9
Comments
Leading and trailing whitespace do not matter. In other words: as long as the right numbers are on the right line in the right order, then it is correct, unlike some other questions which are a bit more strict with output (e.g. ccc00j1).
this is ridiculous i wanna use numpy but it gives module no found error
I tend to use Turing a lot for some questions due to how fast it can solve questions, but it seems that the DMOJ Turing Judge doesn't really allow the Text.Locate method to work and constantly produces IR as a result. I can work around that of course, but was just wondering why the DMOJ Turing Judge seems to dislike Text.Locate
The DMOJ is primarily a text-based input/output system, so using standard IO methods is required.
Text.Locate
functionality is fundamentally unsupported at the operating system level for file streams.My code works for all the other cases expect test case #1, anybody know why?
I'm sure you have figured it out by now, but for anyone else: x == y.