用了建表和in set()這種快速的判斷方式還是超時,最後還是乖乖用C解吧QQ
不知能給您什麼樣的建議,
您私訊給我的解法,建表的方式根本不對。
check={'4', '32', '64', '67108864', '131072', '512', '524288', '2048', '1073741824', '8192', '134217728', '8388608', '2', '1048576', '8', '33554432', '268435456', '16', '128', '4194304', '1', '4096', '65536', '2097152', '16777216', '32768', '536870912', '256', '16384', '1024', '262144'}
while(1):
try:
print('Yes' if(input() in set(check)) else 'No')
except:
break
我已經幹成這樣了#1還是TLEQQ