結果

問題 No.1674 Introduction to XOR
ユーザー GatanityHouse
提出日時 2021-10-17 02:10:57
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 294 ms / 1,000 ms
コード長 288 bytes
コンパイル時間 9,396 ms
コンパイル使用メモリ 432,424 KB
実行使用メモリ 57,244 KB
最終ジャッジ日時 2024-09-17 19:35:49
合計ジャッジ時間 16,917 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

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