# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
22645 | | 이대회 트래쉬 대회에야옹 (#40) | Window Xor (KRIII5_WX) | Cpython 3 | | 1074 ms | 54 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
N, K, T = map(lambda x: int(x), input().split(' '))
X = list(map(lambda x: int(x), input().split(' ')))
repeat = []
def trans(X, K, N):
X2 = [0] * N
for i in range(0, N):
x = 0
for j in range(0, K):
x = x ^ X[(i+j)%N]
X2[i]=x
return X2
def s(X):
return list(map(lambda x: str(x), X))
ss = ""
repeat.append(s(X))
for i in range(1, T+1):
X = trans(X, K, N)
v = s(X)
if v in repeat:
st = repeat.index(v)
# repeat st~i
size = i - st
ss = ""
for r in repeat[(T-st)%size]:
ss = ss + r + " "
break
repeat.append(v)
#print(X, i+1)
#print(repeat)
if ss == "":
for r in repeat[len(repeat)-1]:
ss = ss + r + " "
print(ss)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |