結果

問題 No.513 宝探し2
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-24 00:16:13
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 1,900 ms
コンパイル使用メモリ 149,304 KB
実行使用メモリ 24,300 KB
平均クエリ数 16.00
最終ジャッジ日時 2023-10-14 17:55:29
合計ジャッジ時間 4,051 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,000 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 21 ms
23,460 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	const max: int :: 10
	var x: int
	block
		var ok: int :: -1
		var ng: int :: max
		while((ok - ng).abs() > 1)
			var mid: int :: (ok + ng) / 2
			var a: int :: f(mid, -1)
			var b: int :: f(mid + 1, -1)
			if(b < a)
				do ok :: mid
			else
				do ng :: mid
			end if
		end while
		do x :: ok + 1
	end block
	var y: int
	block
		var ok: int :: -1
		var ng: int :: max
		while((ok - ng).abs() > 1)
			var mid: int :: (ok + ng) / 2
			var a: int :: f(-1, mid)
			var b: int :: f(-1, mid + 1)
			if(b < a)
				do ok :: mid
			else
				do ng :: mid
			end if
		end while
		do y :: ok + 1
	end block
	
	do cui@print("\{x} \{y}\n")
	
	func f(x: int, y: int): int
		do cui@print("\{x} \{y}\n")
		do cui@flush()
		ret cui@inputInt()
	end func
end func
0