미리 범위 내 세제곱 수 구해놓은다음 매칭시켰스비낟.
import sys
input = sys.stdin.readline
dic = {}
for i in range(1, 10001):
dic[i**3] = True
for test in range(int(input())):
x = int(input())
for num in dic:
if x - num in dic:
print("YES")
break
if num > x // 2:
print("NO")
break
'practivceAlgorithm > codeforce' 카테고리의 다른 글
[Codeforce][Python] #702 D. Permutation Transformation (0) | 2021.11.07 |
---|---|
[Codeforce][Python] #702 E. Accidental Victory (0) | 2021.11.07 |
[Codeforce][Python] #702 B. Balanced Remainders (0) | 2021.11.07 |
[Codeforce][Python] #702 A.Dense Array (0) | 2021.11.07 |
[codeforce][Python] #719 E.Arranging The Sheep (0) | 2021.10.17 |