結果

問題 No.1184 Hà Nội
ユーザー face4face4
提出日時 2021-04-12 20:46:27
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 12,538 ms
コンパイル使用メモリ 420,464 KB
実行使用メモリ 55,072 KB
最終ジャッジ日時 2023-09-11 02:04:55
合計ジャッジ時間 24,101 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
53,076 KB
testcase_01 AC 292 ms
52,840 KB
testcase_02 AC 291 ms
52,908 KB
testcase_03 AC 290 ms
53,092 KB
testcase_04 AC 287 ms
52,808 KB
testcase_05 AC 294 ms
53,136 KB
testcase_06 AC 294 ms
53,108 KB
testcase_07 AC 293 ms
52,916 KB
testcase_08 AC 291 ms
53,000 KB
testcase_09 AC 294 ms
55,072 KB
testcase_10 AC 292 ms
52,996 KB
testcase_11 AC 290 ms
53,080 KB
testcase_12 AC 289 ms
52,956 KB
testcase_13 AC 290 ms
52,816 KB
testcase_14 AC 287 ms
53,060 KB
testcase_15 AC 290 ms
52,912 KB
testcase_16 AC 291 ms
52,964 KB
testcase_17 AC 292 ms
53,036 KB
testcase_18 AC 291 ms
53,108 KB
testcase_19 AC 299 ms
52,972 KB
testcase_20 AC 295 ms
52,960 KB
testcase_21 AC 292 ms
54,736 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

const val mod = 1000000007

fun modpow(x: Long, n: Long ): Long {
    return when (n) {
        0L -> {
            1
        }
        1L -> {
            x
        }
        else -> {
            val tmp = modpow(x, n / 2)
            tmp * tmp % mod * (if (n % 2 == 1L) x else 1) % mod
        }
    }
}

fun main() {
    val (n, l) = readLine()!!.split(" ").map { it.toLong() }
    val beki = (n + l - 1) / l
    println((modpow(2,beki)+mod-1)%mod)
}
0