結果

問題 No.1569 Nixoracci's Number
ユーザー Theta
提出日時 2022-10-27 14:31:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-05 00:08:21
合計ジャッジ時間 1,758 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
from operator import xor


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    if K <= N:
        print(A[K-1])
        return

    match (K-N-1) % (N+1):
        case 0:
            print(reduce(xor, A))
        case num:
            print(A[num-1])


if __name__ == "__main__":
    main()
0