Contest Duration: - (local time) (120 minutes)

Submission #19369336

Source Code Expand

Copy
```#input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end

def max(a,b)
return a>b ? a : b
end

def min(a,b)
return a>b ? b : a
end

INF=Float::INFINITY

N,M=get_i
dp=Array.new(100+1){Array.new(100+1){Array.new(100+1,0)}}
N.times do
a,b,c,w=get_i
dp[a][b][c]=[dp[a][b][c],w].max
end
(100+1).times do|a|
(100+1).times do|b|
(100+1).times do|c|
dp[a][b][c]=[dp[a][b][c],dp[a-1][b][c]].max if a-1>=0
dp[a][b][c]=[dp[a][b][c],dp[a][b-1][c]].max if b-1>=0
dp[a][b][c]=[dp[a][b][c],dp[a][b][c-1]].max if c-1>=0
end
end
end
M.times do
x,y,z=get_i
puts dp[x][y][z]
end```

#### Submission Info

Submission Time 2021-01-11 10:11:01+0900 C - Optimal Recommendations hokto Ruby (2.7.1) 100 1241 Byte AC 525 ms 28140 KB

#### Judge Result

Set Name All
Score / Max Score 100 / 100
Status
 AC × 24
Set Name Test Cases
All 10-random-00.txt, 10-random-01.txt, 10-random-02.txt, 10-random-03.txt, 10-random-04.txt, 20-absW-00.txt, 20-absW-01.txt, 20-absW-02.txt, 20-absW-03.txt, 20-absW-04.txt, 30-balance-00.txt, 30-balance-01.txt, 30-balance-02.txt, 30-balance-03.txt, 30-balance-04.txt, 40-limit_dim-00.txt, 40-limit_dim-01.txt, 40-limit_dim-02.txt, 40-limit_dim-03.txt, 40-limit_dim-04.txt, 40-limit_dim-05.txt, 40-limit_dim-06.txt, Corner1.txt, Sample1.txt
Case Name Status Exec Time Memory
10-random-00.txt AC 523 ms 27872 KB
10-random-01.txt AC 377 ms 21696 KB
10-random-02.txt AC 429 ms 27588 KB
10-random-03.txt AC 458 ms 28028 KB
10-random-04.txt AC 430 ms 27968 KB
20-absW-00.txt AC 525 ms 27928 KB
20-absW-01.txt AC 367 ms 21752 KB
20-absW-02.txt AC 456 ms 28020 KB
20-absW-03.txt AC 477 ms 27940 KB
20-absW-04.txt AC 410 ms 27964 KB
30-balance-00.txt AC 510 ms 27592 KB
30-balance-01.txt AC 370 ms 21748 KB
30-balance-02.txt AC 397 ms 28000 KB
30-balance-03.txt AC 458 ms 27440 KB
30-balance-04.txt AC 448 ms 27444 KB
40-limit_dim-00.txt AC 518 ms 28140 KB
40-limit_dim-01.txt AC 512 ms 28028 KB
40-limit_dim-02.txt AC 515 ms 27692 KB
40-limit_dim-03.txt AC 515 ms 28076 KB
40-limit_dim-04.txt AC 508 ms 28016 KB
40-limit_dim-05.txt AC 511 ms 27576 KB
40-limit_dim-06.txt AC 508 ms 27896 KB
Corner1.txt AC 369 ms 21676 KB
Sample1.txt AC 362 ms 21820 KB