Submission #5903348
Source Code Expand
N,K = gets.split.map(&:to_i) x = gets.split.map(&:to_i) idx = x.index(1) l,r = idx,idx ans = 0 while l > 0 l -= K-1 ans += 1 end r += l.abs if l < 0 while r < N-1 r += K-1 ans += 1 end p ans
Submission Info
Submission Time | |
---|---|
Task | C - Minimization |
User | rinzu |
Language | Ruby (2.3.3) |
Score | 300 |
Code Size | 214 Byte |
Status | AC |
Exec Time | 45 ms |
Memory | 8076 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
1.txt | AC | 22 ms | 4220 KB |
10.txt | AC | 35 ms | 6668 KB |
2.txt | AC | 43 ms | 8076 KB |
3.txt | AC | 31 ms | 5388 KB |
4.txt | AC | 45 ms | 7948 KB |
5.txt | AC | 43 ms | 8076 KB |
6.txt | AC | 43 ms | 8076 KB |
7.txt | AC | 10 ms | 2172 KB |
8.txt | AC | 38 ms | 7308 KB |
9.txt | AC | 7 ms | 1788 KB |
sample1.txt | AC | 7 ms | 3836 KB |
sample2.txt | AC | 7 ms | 1788 KB |
sample3.txt | AC | 7 ms | 1788 KB |