From 268e7729abe05d97723783a9d139f32188185628 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Thu, 18 Sep 2025 11:27:07 +0900 Subject: [PATCH] complete 30917.kt 30924.kt --- storage/zeta/kt/completed/30917.kt | 25 +++++++++++++++++++++++++ storage/zeta/kt/completed/30924.kt | 24 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 storage/zeta/kt/completed/30917.kt create mode 100644 storage/zeta/kt/completed/30924.kt diff --git a/storage/zeta/kt/completed/30917.kt b/storage/zeta/kt/completed/30917.kt new file mode 100644 index 0000000..f208345 --- /dev/null +++ b/storage/zeta/kt/completed/30917.kt @@ -0,0 +1,25 @@ +fun main() = with(System.`in`.bufferedReader()) { + val a: Int = run { + for (i in 1 until 10) { + println("? A $i") + + if (this.readLine().toInt() == 1) { + return@run i + } + } + 0 + } + + val b: Int = run { + for (i in 1 until 10) { + println("? B $i") + + if (this.readLine().toInt() == 1) { + return@run i + } + } + 0 + } + + println("! ${a + b}") +} \ No newline at end of file diff --git a/storage/zeta/kt/completed/30924.kt b/storage/zeta/kt/completed/30924.kt new file mode 100644 index 0000000..5d56fa5 --- /dev/null +++ b/storage/zeta/kt/completed/30924.kt @@ -0,0 +1,24 @@ +fun main() = with(System.`in`.bufferedReader()) { + val a = run { + (1..9999).shuffled().forEach { + println("? A $it") + if (this.readLine().toInt() == 1) { + return@run it + } + } + 10000 + } + + val b: Int = run { + val cand = (1..10000).shuffled() + cand.slice(0 until 9998).forEach { + println("? B $it") + if (this.readLine().toInt() == 1) { + return@run it + } + } + cand.last() + } + + println("! ${a + b}") +} \ No newline at end of file