diff --git a/storage/zeta/kt/completed/12075.kt b/storage/zeta/kt/completed/12075.kt new file mode 100644 index 0000000..134935d --- /dev/null +++ b/storage/zeta/kt/completed/12075.kt @@ -0,0 +1,25 @@ +fun getGoogolStringSplitLocation(n: Int): Long { + return (1L shl n) +} + +fun getGoogolStringK(k: Long, n: Int): Boolean { + if (n == 1) { + return false + } + val split = getGoogolStringSplitLocation(n - 1) + return if (k > split) { + !getGoogolStringK(split - (k - split), n - 1) + } else if (k == split) { + false + } else { // k < split + getGoogolStringK(k, n - 1) + } +} + +fun main() = with(System.`in`.bufferedReader()) { + val t = readln().toInt() + (1..t).forEach { i -> + val k = readln().toLong() + println("Case #${i}: ${if (getGoogolStringK(k, 62)) 1 else 0}") + } +} \ No newline at end of file