online-judge | code for some OJs | Learning library
kandi X-RAY | online-judge Summary
kandi X-RAY | online-judge Summary
code for some OJs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main method for testing
- Converts decimal to binary string representation
- Calculates the Hamming distance between two points
- Test program
- Converts a string to lower case
- Main method for testing
- 12 5
- Searches for median sorted arrays
- Returns the kthth element of a matrix
- Main entry point
- Flips the image
- Convert a String to a String
- Calculate two sets
- Checks if the two strings are equal
- Sorts an array of integers
- Checks if the specified iniString is different
- Reverses the ini string
- Returns the length of the longest substrings in the string
- Replace the space characters in an ini string with the given length
- Check if the given character is a Palindrome code
- Create an ini string from a string
- Returns the number closest to the specified number
- Convert a string to an integer value
- Sorts an array of ints
online-judge Key Features
online-judge Examples and Code Snippets
Community Discussions
Trending Discussions on online-judge
QUESTION
I tried to solve this problem with BFS, but for input "99 100" my program uses more than 260 Mb and online-judge system throws MEMORY_LIMIT_EXCEEDED. I guess the problem is the way I use QUEUE. So what do you think is the problem? And how should I solve it?
Here is my code. And thanks in advance!:
...ANSWER
Answered 2018-Feb-08 at 09:55Your algorithm is not BFS, because, you can visit the same state more than one.
For example, 4 -> 3 -> 6 and 4 -> 8 -> 7 -> 6, which 6 will end up to be processed twice.
Secondly, for number x
that is greater than the target
, the minimum number of step is always
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install online-judge
You can use online-judge like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the online-judge component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page