結果

問題 No.604 誕生日のお小遣い
ユーザー nebukuro09nebukuro09
提出日時 2017-12-04 14:45:10
言語 Bash
(Bash 5.1.16)
結果
WA  
実行時間 -
コード長 233 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 5,144 KB
実行使用メモリ 5,020 KB
最終ジャッジ日時 2023-08-19 02:24:09
合計ジャッジ時間 1,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 5 ms
4,384 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 5 ms
4,384 KB
testcase_04 AC 4 ms
4,380 KB
testcase_05 AC 5 ms
4,380 KB
testcase_06 AC 4 ms
4,384 KB
testcase_07 AC 4 ms
4,384 KB
testcase_08 AC 5 ms
4,384 KB
testcase_09 AC 4 ms
4,380 KB
testcase_10 AC 5 ms
4,384 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 AC 4 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 5 ms
4,572 KB
testcase_16 AC 4 ms
4,384 KB
testcase_17 AC 5 ms
4,384 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

TEXT=`cat`
set -- $TEXT
a=$1
b=$2
c=$3
hi=1000000000000000000
lo=0

while [ $((hi-lo)) -gt 1 ]
do
    mid=$(((hi+lo)/2))
    if [ $((mid/a*b+(mid-mid/a))) -ge $c ] ; then
        hi=$mid
    else
        lo=$mid
    fi
done
echo $hi
0