Canadian Computing Competition: 2001 Stage 1, Junior #4, Senior #2
A spiral of numbers can start and end with any positive integers less than . Write a program which will accept two positive integers and as input, and output a list of numbers from to inclusive, shown in a spiral. You may assume that the end value is greater than or equal to the start value.
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
10
27
Sample Output 1
27 26
16 15 14 25
17 10 13 24
18 11 12 23
19 20 21 22
Sample Input 2
7
12
Sample Output 2
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.