結果

問題 No.1372 Median of Submasks
ユーザー 👑 箱
提出日時 2021-02-05 21:24:16
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 729 bytes
コンパイル時間 13,065 ms
コンパイル使用メモリ 423,008 KB
実行使用メモリ 52,196 KB
最終ジャッジ日時 2023-09-15 07:07:09
合計ジャッジ時間 22,009 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 257 ms
50,376 KB
testcase_01 AC 259 ms
50,300 KB
testcase_02 AC 262 ms
52,196 KB
testcase_03 AC 260 ms
50,492 KB
testcase_04 AC 266 ms
50,304 KB
testcase_05 AC 258 ms
50,196 KB
testcase_06 AC 258 ms
50,272 KB
testcase_07 AC 255 ms
50,280 KB
testcase_08 AC 254 ms
50,304 KB
testcase_09 AC 256 ms
50,328 KB
testcase_10 AC 258 ms
50,536 KB
testcase_11 AC 257 ms
50,308 KB
testcase_12 AC 258 ms
50,340 KB
testcase_13 AC 258 ms
50,308 KB
testcase_14 AC 255 ms
50,280 KB
testcase_15 AC 258 ms
50,212 KB
testcase_16 AC 262 ms
50,732 KB
testcase_17 AC 264 ms
50,244 KB
testcase_18 AC 259 ms
50,216 KB
testcase_19 AC 259 ms
50,728 KB
testcase_20 AC 257 ms
50,324 KB
testcase_21 AC 270 ms
52,040 KB
testcase_22 AC 260 ms
50,108 KB
testcase_23 AC 261 ms
50,344 KB
testcase_24 AC 276 ms
50,372 KB
testcase_25 AC 263 ms
50,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    var n = nextLong()
    var num = 0
    while (n / 2 > 0) {
        n /= 2
        num++
    }
    for (i in 0 until num) {
        n *= 2
    }
    println(n)
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve()
    writer.flush()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()!!
fun nextDouble() = next().toDouble()
// endregion
0