結果

問題 No.581 XOR
ユーザー バカらっくバカらっく
提出日時 2022-02-04 13:46:01
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 12,254 ms
コンパイル使用メモリ 415,600 KB
実行使用メモリ 53,040 KB
最終ジャッジ日時 2023-09-02 03:32:47
合計ジャッジ時間 16,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 263 ms
52,800 KB
testcase_01 AC 265 ms
52,952 KB
testcase_02 AC 261 ms
52,836 KB
testcase_03 AC 270 ms
52,720 KB
testcase_04 AC 268 ms
53,040 KB
testcase_05 AC 269 ms
52,744 KB
testcase_06 AC 264 ms
52,816 KB
testcase_07 AC 273 ms
52,616 KB
testcase_08 AC 266 ms
52,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val (a,c) = readLine()!!.split(" ").map { it.toLong() }
    var ans = 0L
    for(i in 0..63) {
        val n = (1L shl i)
        if(a and n == 0L) {
            if(c and n != 0L) {
                ans += n
            }
        } else if(c and n == 0L) {
            ans += n
        }
    }
    println(ans)
}
0