結果

問題 No.246 質問と回答
ユーザー mura40424mura40424
提出日時 2015-08-01 14:12:36
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 12,458 ms
コンパイル使用メモリ 417,764 KB
実行使用メモリ 66,800 KB
平均クエリ数 100.00
最終ジャッジ日時 2023-09-07 22:46:19
合計ジャッジ時間 24,009 ms
ジャッジサーバーID
(参考情報)
judge3 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 321 ms
66,520 KB
testcase_01 AC 316 ms
66,068 KB
testcase_02 AC 318 ms
66,376 KB
testcase_03 AC 316 ms
66,800 KB
testcase_04 AC 312 ms
66,032 KB
testcase_05 AC 311 ms
65,984 KB
testcase_06 AC 312 ms
66,284 KB
testcase_07 AC 316 ms
66,532 KB
testcase_08 AC 316 ms
66,700 KB
testcase_09 AC 308 ms
66,408 KB
testcase_10 AC 321 ms
66,632 KB
testcase_11 AC 313 ms
65,812 KB
testcase_12 AC 316 ms
66,200 KB
testcase_13 AC 316 ms
66,624 KB
testcase_14 AC 317 ms
66,528 KB
testcase_15 AC 315 ms
66,568 KB
testcase_16 AC 312 ms
66,392 KB
testcase_17 AC 318 ms
66,412 KB
testcase_18 AC 321 ms
66,076 KB
testcase_19 AC 320 ms
66,452 KB
testcase_20 AC 327 ms
66,280 KB
testcase_21 AC 326 ms
66,288 KB
testcase_22 AC 330 ms
66,212 KB
testcase_23 AC 315 ms
66,664 KB
testcase_24 AC 309 ms
66,288 KB
testcase_25 AC 306 ms
66,168 KB
testcase_26 AC 304 ms
66,224 KB
testcase_27 AC 301 ms
66,596 KB
testcase_28 AC 304 ms
66,184 KB
testcase_29 AC 307 ms
66,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:27:10: warning: parameter 'args' is never used
fun main(args : Array<String>) {
         ^

ソースコード

diff #

package No246

var MAX = Math.pow(10.0,9.0)
var conut = 0
var ans = 0

fun QandA(left : Double, right : Double) {
    conut++
    var x = (left + right) / 2

    if(conut == 100) {
        System.out.println("! " + x.toInt())
        return
    }

    System.out.println("? " + x.toInt())
    ans = readLine()!!.toInt()

    if(ans == 1) {
        QandA(x, right)
    }
    else {
        QandA(left, x - 1)
    }
}

fun main(args : Array<String>) {
    QandA(0.0, MAX)
}
0