提出 #3211836
ソースコード 拡げる
N, X, *XS = $stdin.read.split.map(&:to_i)
def getn(xs)
ret = 0
ret += xs.last + X; n_garbages = 1
xs.reverse.each_cons(2) do |x2, x1|
cost = (n_garbages + 1)**2 * (x2-x1)
ret += cost
ret += X
n_garbages += 1
end
ret += (n_garbages + 1)**2 * xs[0]
ret += X
ret
end
ids = (0...N).to_a
p (1..N).map{|k|
(0...k).map{|m|
getn(XS.values_at(*ids.select{|i| i % k == m}))
}.inject(0, :+)
}.min
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Garbage Collector |
| ユーザ | yhara |
| 言語 | Ruby (2.3.3) |
| 得点 | 0 |
| コード長 | 448 Byte |
| 結果 | RE |
| 実行時間 | 2109 ms |
| メモリ | 36148 KiB |
ジャッジ結果
| セット名 | Sample | Subtask1 | All | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 400 | 0 / 300 | ||||||||||||
| 結果 |
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
| Subtask1 | sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, stest_01.txt, stest_02.txt, stest_03.txt, stest_04.txt, stest_05.txt, stest_06.txt, stest_07.txt, stest_08.txt, stest_09.txt, stest_10.txt, stest_11.txt, stest_12.txt |
| All | sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, stest_01.txt, stest_02.txt, stest_03.txt, stest_04.txt, stest_05.txt, stest_06.txt, stest_07.txt, stest_08.txt, stest_09.txt, stest_10.txt, stest_11.txt, stest_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| sample_01.txt | AC | 7 ms | 1788 KiB |
| sample_02.txt | AC | 7 ms | 1788 KiB |
| sample_03.txt | AC | 7 ms | 1788 KiB |
| sample_04.txt | AC | 7 ms | 1788 KiB |
| stest_01.txt | TLE | 2108 ms | 11148 KiB |
| stest_02.txt | TLE | 2108 ms | 11528 KiB |
| stest_03.txt | AC | 14 ms | 2172 KiB |
| stest_04.txt | AC | 148 ms | 3580 KiB |
| stest_05.txt | TLE | 2108 ms | 10084 KiB |
| stest_06.txt | TLE | 2108 ms | 8368 KiB |
| stest_07.txt | TLE | 2108 ms | 11392 KiB |
| stest_08.txt | TLE | 2108 ms | 11264 KiB |
| stest_09.txt | TLE | 2108 ms | 6104 KiB |
| stest_10.txt | TLE | 2108 ms | 11416 KiB |
| stest_11.txt | TLE | 2108 ms | 12844 KiB |
| stest_12.txt | AC | 862 ms | 5296 KiB |
| test_13.txt | RE | 116 ms | 20788 KiB |
| test_14.txt | RE | 116 ms | 20788 KiB |
| test_15.txt | TLE | 2108 ms | 31132 KiB |
| test_16.txt | RE | 108 ms | 20020 KiB |
| test_17.txt | RE | 108 ms | 20088 KiB |
| test_18.txt | TLE | 2109 ms | 21800 KiB |
| test_19.txt | RE | 111 ms | 20344 KiB |
| test_20.txt | RE | 111 ms | 20404 KiB |
| test_21.txt | RE | 111 ms | 20344 KiB |
| test_22.txt | RE | 111 ms | 20404 KiB |
| test_23.txt | RE | 108 ms | 20020 KiB |
| test_24.txt | RE | 108 ms | 20020 KiB |
| test_25.txt | TLE | 2108 ms | 36148 KiB |
| test_26.txt | RE | 111 ms | 20404 KiB |
| test_27.txt | RE | 111 ms | 22452 KiB |
| test_28.txt | RE | 83 ms | 15996 KiB |