結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 4 ms
4,376 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 4 ms
4,380 KB
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 3 ms
4,376 KB
testcase_12 RE -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 AC 5 ms
4,376 KB
testcase_17 WA -
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=$((c/(b/a)))
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