結果

問題 No.1674 Introduction to XOR
ユーザー GatanityHouseGatanityHouse
提出日時 2021-10-17 02:10:57
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 325 ms / 1,000 ms
コード長 288 bytes
コンパイル時間 12,152 ms
コンパイル使用メモリ 434,768 KB
実行使用メモリ 54,576 KB
最終ジャッジ日時 2023-10-17 22:21:56
合計ジャッジ時間 21,668 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 319 ms
54,484 KB
testcase_01 AC 313 ms
54,492 KB
testcase_02 AC 316 ms
54,492 KB
testcase_03 AC 313 ms
54,496 KB
testcase_04 AC 308 ms
54,496 KB
testcase_05 AC 304 ms
54,492 KB
testcase_06 AC 304 ms
54,476 KB
testcase_07 AC 310 ms
54,496 KB
testcase_08 AC 311 ms
54,488 KB
testcase_09 AC 310 ms
54,484 KB
testcase_10 AC 312 ms
54,460 KB
testcase_11 AC 310 ms
54,496 KB
testcase_12 AC 308 ms
54,484 KB
testcase_13 AC 315 ms
54,484 KB
testcase_14 AC 324 ms
54,548 KB
testcase_15 AC 319 ms
54,560 KB
testcase_16 AC 312 ms
54,496 KB
testcase_17 AC 323 ms
54,560 KB
testcase_18 AC 321 ms
54,532 KB
testcase_19 AC 321 ms
54,556 KB
testcase_20 AC 318 ms
54,564 KB
testcase_21 AC 310 ms
54,508 KB
testcase_22 AC 325 ms
54,572 KB
testcase_23 AC 321 ms
54,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger

fun main() {
    readLine()
    val a = readLine()!!.split(" ").map { it.toBigInteger() }

    for (i in 0..60) {
        val x = BigInteger.TWO.pow(i)
        if (a.all { (it + x) == it.xor(x) }) {
            println(x)
            return
        }
    }
}
0