Skip to content

Commit

Permalink
- new feature
Browse files Browse the repository at this point in the history
- change the way of how memory limits are proceed. It's now constant for all (security, not part of competition) that limit it to 32 MB
- above means there is no need to keep any memory limit related info in Problems Service anymore
  • Loading branch information
spolnik committed Feb 13, 2017
1 parent da8be56 commit f97a9a4
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 87 deletions.
Binary file modified ProblemsStore/00000000000.xd
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/versioning.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//noinspection GroovyAssignabilityCheck
version = new ProjectVersion(
'1', '0', '31', System.env.TRAVIS_BUILD_NUMBER
'1', '0', '32', System.env.TRAVIS_BUILD_NUMBER
)

println "Version number: " + version
Expand Down
154 changes: 77 additions & 77 deletions problems.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class XodusProblemsRepository(dbName: String) : ProblemsRepository {
setProperty(Constants.problemTitle, problem.title)
setProperty(Constants.problemDescription, problem.description)
setProperty(Constants.problemLevel, problem.level)
setProperty(Constants.problemMemoryLimit, problem.memoryLimit)
setProperty(Constants.problemTimeLimit, problem.timeLimit)
setProperty(Constants.problemFunction, toJson(problem.func!!))
setProperty(Constants.problemTestCases, toJson(problem.testCases!!))
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/com/jalgoarena/domain/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ object Constants {
val problemTitle = "title"
val problemDescription = "description"
val problemLevel = "level"
val problemMemoryLimit = "memoryLimit"
val problemTimeLimit = "timeLimit"
val problemFunction = "func"
val problemTestCases = "testCases"
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/com/jalgoarena/domain/Problem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ data class Problem(val id: String,
val title: String,
val description: String,
val timeLimit: Long,
val memoryLimit: Int,
val func: Function?,
val testCases: List<TestCase>?,
val level: Int) {
Expand All @@ -40,7 +39,6 @@ data class Problem(val id: String,
entity.getProperty(Constants.problemTitle) as String,
entity.getProperty(Constants.problemDescription) as String,
entity.getProperty(Constants.problemTimeLimit) as Long,
entity.getProperty(Constants.problemMemoryLimit) as Int,
function,
testCases.toList(),
entity.getProperty(Constants.problemLevel) as Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class ProblemsRepositorySpec {
"Test Title",
fibProblem.description,
fibProblem.timeLimit,
fibProblem.memoryLimit,
fibProblem.func,
fibProblem.testCases,
fibProblem.level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ProblemSerializationTest {
"2 Sum",
"Given an array of integers, find two numbers such that they add up to a specific target number.\r\n\r\nThe method `twoSum` should return indices of the two numbers such that they add up to the target, where *index1* must be less than *index2*. Please note that your returned answers (both *index1* and *index2*) are not zero-based.\r\n\r\n**Note**: You may assume that each input would have exactly one solution.\r\n\r\n### Example\r\n\r\n* `[2,7,11,15], 9` -> `[1,2]`",
1L,
32,
Function("twoSum",
Function.Return("[I",
" Indices of the two numbers"),
Expand Down Expand Up @@ -71,7 +70,6 @@ class ProblemSerializationTest {
"title": "2 Sum",
"description": "Given an array of integers, find two numbers such that they add up to a specific target number.\r\n\r\nThe method `twoSum` should return indices of the two numbers such that they add up to the target, where *index1* must be less than *index2*. Please note that your returned answers (both *index1* and *index2*) are not zero-based.\r\n\r\n**Note**: You may assume that each input would have exactly one solution.\r\n\r\n### Example\r\n\r\n* `[2,7,11,15], 9` -> `[1,2]`",
"timeLimit": 1,
"memoryLimit": 32,
"func": {
"name": "twoSum",
"returnStatement": {
Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/com/jalgoarena/utils/SetupProblemsStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SetupProblemsStore(val dbName: String) {
setProperty(Constants.problemTitle, problem.title)
setProperty(Constants.problemDescription, problem.description)
setProperty(Constants.problemLevel, problem.level)
setProperty(Constants.problemMemoryLimit, problem.memoryLimit)
setProperty(Constants.problemTimeLimit, problem.timeLimit)
setProperty(Constants.problemFunction, toJson(problem.func!!))
setProperty(Constants.problemTestCases, toJson(problem.testCases!!))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"title": "2 Sum",
"description": "Given an array of integers, find two numbers such that they add up to a specific target number.\r\n\r\nThe method `twoSum` should return indices of the two numbers such that they add up to the target, where *index1* must be less than *index2*. Please note that your returned answers (both *index1* and *index2*) are not zero-based.\r\n\r\n**Note**: You may assume that each input would have exactly one solution.\r\n\r\n### Example\r\n\r\n* `[2,7,11,15], 9` -> `[1,2]`",
"timeLimit": 1,
"memoryLimit": 32,
"func": {
"name": "twoSum",
"returnStatement": {
Expand Down

0 comments on commit f97a9a4

Please sign in to comment.