백준 12833 XORXORXOR
https://www.acmicpc.net/problem/12833 12833번: XORXORXOR 세 수 A, B, C를 입력 받은 다음, ( ( ( ( A XOR B ) XOR B ) XOR B ) … ) XOR B 형태로 연산을 C회 했을 때의 결과값을 출력하는 프로그램을 작성하시오. www.acmicpc.net 1 2 3 4 5 6 7 8 def sol(a,b,c): answer = a if c%2 == 1: answer = a^b return answer if __name__ == '__main__': a,b,c = map(int, input().split()) print(sol(a,b,c)) cs 단순 반복문으로 풀게되면 시간초과가 나올거에요 If you use just loop, You go..
2022. 11. 14.