https://www.acmicpc.net/problem/21099
21099번: Four XOR
Given a sequence $A_{1...n}$ of distinct integers, you need to answer whether there exist four indices $x, y, z, w$ such that $1 \le x < y < z < w \le n$ and $A_x \oplus A_y \oplus A_z \oplus A_w = 0$. Recall that $x \oplus y$ means the bitwise exclusive-o
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
n = int(input())
if n > 60:
print("Yes")
exit()
else:
input_list = list(map(int, input().split()))
result = input_list[0]
for i in range(n):
for j in range(n):
for k in range(n):
for m in range(n):
result = (input_list[i] ^ input_list[j] ^ input_list[k] ^ input_list[m])
if result == 0 and (input_list[i] < input_list[j] < input_list[k] < input_list[m]):
print("Yes")
exit()
print("No")
|
cs |
'Problem Solving > 백준' 카테고리의 다른 글
[25175] 두~~부 두부 두부 (1) | 2022.05.21 |
---|---|
[14719] 빗물 (0) | 2021.09.21 |
[10943] 랜덤 게임~ (0) | 2021.09.04 |
[4661] Falling Leaves (0) | 2021.09.04 |
[2108] 통계학 (0) | 2021.08.02 |