It's UWAweek 47

help3001

This forum is provided to promote discussion amongst students enrolled in CITS3001 Advanced Algorithms.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 6 articles in this topic
Showing 6 of 202 articles.
Currently no other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
3:38pm Fri 4th Oct, ANONYMOUS

is it possible that my device's specs are interfering with domjudge's results? what i meant is that even though the time taken for traversing the maximum 1000x1000 grid done on my device is within the given time limit, when i run it on domjudge it ends up as TIME LIMIT(for the hidden cases, the given ones pass in 0.026s each) if so, are there any command lines i can run to make my device mirror domjudge's processor speed?


SVG not supported

Login to reply

👍?
helpful
5:14pm Fri 4th Oct, Max WG.

ANONYMOUS wrote:
> is it possible that my device's specs are interfering with domjudge's results? > what i meant is that even though the time taken for traversing the maximum 1000x1000 grid done on my device is within the given time limit, when i run it on domjudge it ends up as TIME LIMIT(for the hidden cases, the given ones pass in 0.026s each) > if so, are there any command lines i can run to make my device mirror domjudge's processor speed?
Your code is run on our sever. It's the same server that all submissions are run on. There are no special command line options we use to run your code. I suspect that you are not testing the worst case inputs locally. You are probably testing randomly generated inputs. It's possible random inputs happen to be fast for your algorithm, but there is some input that causes it to hit its worst case time complexity.


SVG not supported

Login to reply

👍?
helpful
11:32am Sat 5th Oct, ANONYMOUS

by locally, do you mean feeding the program a file with the 1000x1000 grid data? i am using diagram = [[random.choice(symbols) for _ in range(num_columns)] for _ in range(num_rows)] to generate the 1000x1000 grid when i test my code, but i didnt get the impression that doing so would significantly reduce the time for my program, or am i severely mistaken?


SVG not supported

Login to reply

👍?
helpful
6:58pm Sat 5th Oct, ANONYMOUS

If you did a 1000x1000 grid, but it was all one colour, then the program would probably run very quickly. In the same way, you can try to generate a test that would cause your program to run the maximum amount of computations (worst case), and see if that exceeds the 10s limit rather than using random inputs because random ones are most likely going to run very quickly


SVG not supported

Login to reply

👍?
helpful
10:56pm Sat 5th Oct, Joshua C.

ANONYMOUS wrote:
> If you did a 1000x1000 grid, but it was all one colour, then the program would probably run very quickly. In the same way, you can try to generate a test that would cause your program to run the maximum amount of computations (worst case), and see if that exceeds the 10s limit rather than using random inputs because random ones are most likely going to run very quickly
the full code is symbols = ['.', 'x'] diagram = [[random.choice(symbols) for _ in range(num_columns)] for _ in range(num_rows)] it is completely random on what the grid would look like for the two colours, and i dont know how to 'really' generate a true worst case given it has to have 1000 rows and 1000 columns by hand i have tried creating a file containing the 1000x1000 grid with again completely randomised dots and x's, then feeding it into my program directly which also gives a time within 10s i am really lost on what to do since the hidden cases always output TIME LIMIT when it should give WRONG ANSWER if my program doesnt give the correct answer in the first place


SVG not supported

Login to reply

👍?
helpful
9:11am Sun 6th Oct, Max WG.

"Joshua Chin" <23*0*7*4@s*u*e*t*u*a*e*u*a*> wrote:
> ANONYMOUS wrote: > > > If you did a 1000x1000 grid, but it was all one colour, then the program would probably run very quickly. In the same way, you can try to generate a test that would cause your program to run the maximum amount of computations (worst case), and see if that exceeds the 10s limit rather than using random inputs because random ones are most likely going to run very quickly > > the full code is > symbols = ['.', 'x'] > diagram = [[random.choice(symbols) for _ in range(num_columns)] for _ in range(num_rows)] > > it is completely random on what the grid would look like for the two colours, and i dont know how to 'really' generate a true worst case given it has to have 1000 rows and 1000 columns by hand > > i have tried creating a file containing the 1000x1000 grid with again completely randomised dots and x's, then feeding it into my program directly which also gives a time within 10s > > i am really lost on what to do since the hidden cases always output TIME LIMIT when it should give WRONG ANSWER if my program doesnt give the correct answer in the first place
If you are struggling to solve the question, and properly analyzing the worst case is part of solving, then I suggest moving on to trying different problems. You can get 93 points without solving flip.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy