結果

問題 No.1674 Introduction to XOR
コンテスト
ユーザー GatanityHouse
提出日時 2021-10-17 02:10:57
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
AC  
実行時間 198 ms / 1,000 ms
コード長 288 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,257 ms
コンパイル使用メモリ 470,964 KB
実行使用メモリ 53,312 KB
最終ジャッジ日時 2026-04-06 10:30:55
合計ジャッジ時間 13,829 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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