結果

問題 No.817 Coin donation
ユーザー yuruhiyayuruhiya
提出日時 2020-05-03 20:19:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 618 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 11,180 KB
実行使用メモリ 23,500 KB
最終ジャッジ日時 2023-09-04 20:54:14
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,264 KB
testcase_01 AC 78 ms
15,156 KB
testcase_02 AC 79 ms
15,196 KB
testcase_03 AC 80 ms
15,180 KB
testcase_04 AC 79 ms
15,256 KB
testcase_05 AC 96 ms
15,332 KB
testcase_06 AC 152 ms
15,940 KB
testcase_07 AC 169 ms
16,528 KB
testcase_08 AC 443 ms
20,464 KB
testcase_09 AC 183 ms
16,492 KB
testcase_10 AC 611 ms
23,484 KB
testcase_11 AC 607 ms
23,500 KB
testcase_12 AC 618 ms
23,368 KB
testcase_13 AC 81 ms
15,060 KB
testcase_14 AC 79 ms
15,204 KB
testcase_15 AC 79 ms
15,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, k = gets.split.map &:to_i
a, b = n.times.map {gets.split.map &:to_i}.transpose
puts (1..10**9).bsearch {|num|
    n.times.sum {|i| [0, (b[i] < num ? b[i] : num) - a[i] + 1].max } >= k
}
0